Code:
Dim $paused ; Bool variable for pausing the bot
; Pauses the bot upon use of Hotkey {INSERT}
Func Pause()
$paused = NOT $paused
if $paused Then
FileWrite($file, "[" & @Hour & ":" & @Min & ":" & @Sec & "] BastBot paused." & @CRLF) ; Log Message
Else
FileWrite($file, "[" & @Hour & ":" & @Min & ":" & @Sec & "] BastBot unpaused." & @CRLF) ; Log Message
EndIf
While $paused
sleep(100)
WEnd
EndFunc
That's the exact pause function and variable definition I use in all of my bots. You can remove the log messages, but other than that, that code works.