DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Counter request +1/-1  (Read 6,697 times)

Brian_IT

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 3
IDEA: Counter request +1/-1
« on: May 17, 2013, 01:48 AM »
Howdy folks,

Request/idea is pretty simple, just a +1 or -1 counter on screen with a 1 key press (such as [up arrow] +1 | [down arrow] -1) to make it go in the desired direction, while doing another task in another window.  I never use those arrow keys so they would be ideal for me.  (perhaps option of picking specific keys for +1|-1 is better)

Ability to save the status with a timestamp recorded with it (as a log maybe?) would be super sweet.

If going further, I suppose a goal box in options and some type of indicator when you hit it would be cool as well.  

Thanks in advance, I wish I could do this.

 -Brian
« Last Edit: May 17, 2013, 01:54 AM by Brian_IT »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Counter request +1/-1
« Reply #1 on: May 17, 2013, 01:51 AM »
Sounds like a fun idea for a snack to me. :up:

Brian_IT

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 3
Re: IDEA: Counter request +1/-1
« Reply #2 on: May 17, 2013, 02:14 AM »
I hope so, wanted it years ago and forgot why, and had another use for it come up recently and dusted off idea and here I am.   :D

I forgot to also request a reset button, but one that wouldn't be hit accidentally, like CTRL+SHIFT+R in hindsight, a little important feature.   ;D

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: IDEA: Counter request +1/-1
« Reply #3 on: May 17, 2013, 02:19 AM »
I don't have global hotkeys set on it and it doesn't count down, but is this something like what you had in mind?

http://www.donationcoder.com/forum/index.php?topic=11170.0

Brian_IT

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 3
Re: IDEA: Counter request +1/-1
« Reply #4 on: May 17, 2013, 05:22 AM »
hi app103, interesting tool, but no hotkeys for +1 or -1 makes it more a passive tool, what I had in mind was very in the moment counting tool.

Definitely in the right direction though!  8)

theotherone

  • Participant
  • Joined in 2013
  • *
  • Posts: 1
Re: IDEA: Counter request +1/-1
« Reply #5 on: May 17, 2013, 11:22 AM »
Hi, I came across this earlier while getting a key for FARR and decided to try something.

I tried to implement the requested functionality in a AutoHotkey script:
Code
; Variables
; ====================================================
global counter := 0
global goal := 0

global counterText := "Current count: "
global goalText := "Counting towards goal: "

; ====================================================
Main:
	Gui +AlwaysOnTop -ToolWindow -MinimizeBox
	Gui, Font, underline
	Gui Add, Text, w150 x15 y15 gSetGoal vgoal cBlue, %goalText%%goal%
	Gui, Font, norm s12
	Gui Add, Text, w150 h25 x15 y50 vcounter, %counterText%%counter%
	Gui Show

; Hotkeys
; ====================================================
Up::
	counter++
	goto RefreshGui
return

Down::
	counter--
	goto RefreshGui
return


; Subroutines
; ====================================================
GuiClose:
GuiEscape:
	Gui, Cancel
	ExitApp

SetGoal:
	tmpGoal := goal

	Gui -AlwaysOnTop
	InputBox goal, , Set the goal count:, , 150, 120
	if ErrorLevel
	{
		goal := tmpGoal
	}
	if goal = 
	{
		goal := tmpGoal
	}
	Gui +AlwaysOnTop
	goto RefreshGui
return

RefreshGui:
	GuiControl text, goal, %goalText%%goal%
	GuiControl text, counter, %counterText%%counter%
	
	if % counter = goal
	{
		Gui -AlwaysOnTop
		MsgBox, , , Goal Reached!
		Gui +AlwaysOnTop
	}
return

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: IDEA: Counter request +1/-1
« Reply #6 on: May 17, 2013, 03:54 PM »
hi app103, interesting tool, but no hotkeys for +1 or -1 makes it more a passive tool, what I had in mind was very in the moment counting tool.

Definitely in the right direction though!   8)

It can be added though, which is why I mentioned it.  ;)

I was already thinking of adding a little more to it, for adding more than +1. From my own use of it, it's kind of annoying if you need to +20, having to hit the button 20 times. Even adding a hotkey for it wouldn't help that. While I am doing that, adding -1, hotkeys, and allowing for use without a goal can also be added. (that way it acts as just a counter, the way you wanted)

Original address: https://www.donationcoder.com/forum/index.php?topic=34951.0