acidfear Posted June 27, 2006 Share Posted June 27, 2006 This program i made allows you to glitch a merc for Diablo 2. It works fine, i just want to add a timer. So when you start the glitch 2 minutes later it will stop. heres my code: HotKeySet("{f11}", "stop") hotkeyset("{home}", "start") hotkeyset("{end}", "close") while 1 ;sleeps until function is pressed sleep(20) WEnd func start() ;starts click while 1 Mouseclick("left",365,156,1,3) sleep(200) WEnd EndFunc func stop() ; stops and idles the bot while 1 sleep(10) WEnd EndFunc func close() ; closes the bot Exit EndFunc Link to comment Share on other sites More sharing options...
Nomad Posted June 27, 2006 Share Posted June 27, 2006 While (1) TimerInit($begin) ;do your glitch Sleep(100) ;whatever you need here $dif = TimerDiff($begin) If $dif > 120000 Then ExitLoop ; number of milliseconds in 2 minutes WEnd Nomad Link to comment Share on other sites More sharing options...
rakudave Posted June 27, 2006 Share Posted June 27, 2006 after the hotkeys: $time = timerinit() then, in the while-loop if timerdiff($time) > 120000 then close() Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
rakudave Posted June 27, 2006 Share Posted June 27, 2006 doh, Nomad was faster... ^^ Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
Nomad Posted June 27, 2006 Share Posted June 27, 2006 But you were correct, I had the TimerInit() in the loop, oops. Make sure the TimerInit() is not in the loop or it will reset every time it loops and so it will never reach 120000 milliseconds and thus never exit the loop. Link to comment Share on other sites More sharing options...
acidfear Posted June 28, 2006 Author Share Posted June 28, 2006 SWEET! Thanks guys Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now