Jump to content

How to add timer?


Recommended Posts

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

But you were correct, I had the TimerInit() in the loop, oops. :D

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. :D

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...