Luxlucis

Terminate hotkeys wont work?

5 posts in this topic

Im trying to make a loop that exits with hotkeys but i cant get them to work at all even after taking example scripts and plugging my own code into them

; Press Esc to terminate script, Pause/Break to "pause"
 
Global $Paused, $Runner
HotKeySet("{F2}", "TogglePause")
HotKeySet("{F1}", "Terminate")
 
MsgBox(0,"Vivace Training Bot1","Author: aj1" & @CRLF & 
 
"Version: v1" & @CRLF & @CRLF & "Press OK to begin, press Left 
 
Shift to exit")
 
 
;;;; Body of program would go here ;;;;
While 1
    Sleep(1000)
Send("1")
Sleep(3000)
Send("{ESC}")
Sleep(9000)
WEnd
;;;;;;;;
 
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause
 
Func Terminate()
    Exit 0
EndFunc   ;==>Terminate
 
 
can anyone give me advice on this?

Share this post


Link to post
Share on other sites



Maybe it could be because im using it for a game?

1 person likes this

Share this post


Link to post
Share on other sites

At top of script below includes

HotKeySet("{ESC}", "Terminate")

at bottom of script

Func Terminate()
Exit 0
EndFunc
 
the end

Share this post


Link to post
Share on other sites

Maybe it could be because im using it for a game?

Please read our forum rules first before continuing posting in our forums.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.