Jump to content

Terminate hotkeys wont work?


Recommended Posts

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?
Link to comment
Share on other sites

  • Developers

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

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...