Sign in to follow this  
Followers 0
kazhkaz

Hotkeyset Problem :)

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

thanks :think: i think it will work fine :(

Share this post


Link to post
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
Sign in to follow this  
Followers 0