Jump to content

Start Stop A Loop?


 Share

Recommended Posts

When i push "Home" i want it to do the function home until "End" is Pushed.

HotKeySet("{HOME}", "Start")
HotKeySet("{END}", "Stop")

MsgBox(4096, "Instructions", "Hover Mouse Over Drop Gold Hit Home To Drop", 10)

While 1
    Sleep(100)
WEnd

Func Start()
    MouseClick("Left")
    Sleep(50)
    Send("1")
    Sleep(50)
    Send("{ENTER}")
    Sleep(50)
EndFunc

Func Stop()
    Exit
EndFunc

I was going to try

Func Start()
While 1
    MouseClick("Left")
    Sleep(50)
    Send("1")
    Sleep(50)
    Send("{ENTER}")
    Sleep(50)
WEnd
EndFunc

But the program will have to exit to stop it, Thanks.

Link to comment
Share on other sites

You could do:

HotKeySet("{HOME}", "Start")
HotKeySet("{END}", "Stop")
Global $Go

MsgBox(4096, "Instructions", "Hover Mouse Over Drop Gold Hit Home To Drop", 10)

While 1
    While $Go = 1
           MouseClick("Left")
           Sleep(50)
           Send("1")
           Sleep(50)
           Send("{ENTER}")
           Sleep(50)
   WEnd
  Sleep(100)
WEnd

Func Start()
    $Go = 1
EndFunc

Func Stop()
    $Go = 0
EndFunc
Edited by =sinister=
Link to comment
Share on other sites

You could do:

HotKeySet("{HOME}", "Start")
HotKeySet("{END}", "Stop")
Global $Go

MsgBox(4096, "Instructions", "Hover Mouse Over Drop Gold Hit Home To Drop", 10)

While 1
    While $Go = 1
           MouseClick("Left")
           Sleep(50)
           Send("1")
           Sleep(50)
           Send("{ENTER}")
           Sleep(50)
   WEnd
  Sleep(100)
WEnd

Func Start()
    $Go = 1
EndFunc

Func Stop()
    $Go = 0
EndFunc
Trying This.

Edit: Works Fine, Thanks.

Edited by Death
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...