Jump to content

Help With Pausing A Script


 Share

Recommended Posts

Below is a script that i created and i am trying to get it to pause. However, i cant seem to get the commands right. I can get it to close with esc key, but i cant get it to pause with the chosen capslock key. Any ideas on what i am doing wrong?

Global $Paused
HotKeySet("{CAPSLOCK}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

WinActive('Delta Force, V1.5.0.5')

While 1
    MouseClick("left")
    Sleep(10)
    
WEnd
Func TogglePause()
    EndFunc

Func Terminate()
    Exit
EndFunc
Link to comment
Share on other sites

Maybe:

Global $Paused = "False
HotKeySet("{CAPSLOCK}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

WinActive('Delta Force, V1.5.0.5')

While 1
If $Paused <> "True" Then
    MouseClick("left")
    Sleep(10)
Else
        Sleep(10)
EndIf
WEnd
Func TogglePause()
If $Paused = "True" Then 
    $Paused = "False" 
Else 
        $Paused = "True"
EndIf
EndFunc

Func Terminate()
    Exit
EndFunc
Edited by Simucal
AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Well you have to make it do something when it goes into the pause function....

Global $Paused = 0
HotKeySet("{CAPSLOCK}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

WinActive('Delta Force, V1.5.0.5')

While 1
    MouseClick("left")
    Sleep(10)
    
WEnd
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep (10)
    WEnd
EndFunc

Func Terminate()
    Exit
EndFunc
Link to comment
Share on other sites

Well you have to make it do something when it goes into the pause function....

Global $Paused = 0
HotKeySet("{CAPSLOCK}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

WinActive('Delta Force, V1.5.0.5')

While 1
    MouseClick("left")
    Sleep(10)
    
WEnd
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep (10)
    WEnd
EndFunc

Func Terminate()
    Exit
EndFunc
hey thanks... it worked like a charm!
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...