ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Counter request +1/-1

<< < (2/2)

theotherone:
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:

--- ---; 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:
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)
-Brian_IT (May 17, 2013, 12:22 AM)
--- End quote ---

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)

Navigation

[0] Message Index

[*] Previous page

Go to full version