Jump to content

Hotkeyset Problem :)


Recommended Posts

Hello :think:

I found out how to end script with hoekeyset :( but i dont know how to set, that the script will start paused, and then after i press some hotkey it will start going :) thanks for help ;)

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Global $Paused
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

While 1
Send("{F4}")
Sleep(1000)
MouseClick("left" , 362, 333)
Sleep(1000)
MouseClick("left" , 148, 65)
WEnd
Link to comment
Share on other sites

Simply make it start by Toggling Pause :think:

here you go:

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Global $Paused
TogglePause()
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

While 1
Send("{F4}")
Sleep(1000)
MouseClick("left" , 362, 333)
Sleep(1000)
MouseClick("left" , 148, 65)
WEnd

Also it might be a good idea to put your functions at the end of your script, so you can get a better look at what your script does.

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