Jump to content

Little Timer Example


scriptkitty
 Share

Recommended Posts

This is just an example of a little quick timer you might have a use for.

It uses variations of one button to do almost everything. I use it personally inside a game I play to keep track of stuff.

winclose("mycountdown")
AutoItWinSetTitle ( "mycountdown" )
$loc=StringSplit("546,378",","); default location
$amount=90; default time
HotKeySet ("!{NUMPADADD}","testoff")
HotKeySet ("{NUMPADADD}","test")
HotKeySet ("^{NUMPADADD}","amount")
HotKeySet ("^!{NUMPADADD}","loc")
ToolTip("Click + to start", 0, 0)
sleep(2000)

$begin=0
While 1
while $begin<>0
ToolTip("", 0, 0)
while (TimerStop($begin)/1000)<$amount
$time=$amount-int(TimerStop($begin)/1000)/1
if $time>120 then
ToolTip(int($time/60)&" min left "&$time-int($time/60)*60&" seconds",$loc[1],$loc[2])
else
if $time<30 then
ToolTip("Warning Warning Warning, Only "&$time&" seconds left ",$loc[1],$loc[2])
else
ToolTip($time&" seconds left ",$loc[1],$loc[2])
endif
endif

sleep(20)
wend
wend
ToolTip("", 0, 0)
sleep(20)
wend


sleep(-1)

func test()
$begin = TimerStart()
endfunc

func testoff()
ToolTip("")
$begin = 0
endfunc

func amount()
$amount = InputBox("Question", "How many sec?"&@crlf&"or XXmin", "1min", "", -1, -1, 0, 0)
if stringinstr($amount,"min")>0 then $amount=int(stringreplace($amount,"min","")*60)
return $amount
endfunc

func loc()
$loc1 = InputBox("Question", "Location x,y?", "546,378", "", -1, -1, 0, 0)
$loc=StringSplit($loc1,",")
endfunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

  • 7 years later...

This script is not complete. Compile bombs on the first few lines with an error pointing to a lack of a Function named TimerStop.

Since it is used as an example of how to do hotkeys, I feel it should be a complete program. I ask the writer to look it over and repost the code to be a complete program that will compile and let me play with it.

Thanks in advance.

Ogre

This is just an example of a little quick timer you might have a use for.

It uses variations of one button to do almost everything. I use it personally inside a game I play to keep track of stuff.

Link to comment
Share on other sites

This script is not complete. Compile bombs on the first few lines with an error pointing to a lack of a Function named TimerStop.

Since it is used as an example of how to do hotkeys, I feel it should be a complete program. I ask the writer to look it over and repost the code to be a complete program that will compile and let me play with it.

Thanks in advance.

Ogre

Have a little think about how old the thraed is that you just dug up, then re-asses your suggestion.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...