Sample Code:
PHP Code:
While 1
Sleep(50)
HotKeySet("{F11}","Terminate")
WEnd
Func Terminate()
= 5 ;What buttons that show in messagebox 5 = Retry and Cancel
= 2 ;What button is pressed to exit the script 2 = Cancel, If Cancel buton is pushed the script stops.
If MsgBox(, , "Retry or Cancel the bot?") == Then
Exit
EndIf
EndFunc ;==>Terminate
Enjoy that

For any additional help with AutoIt, you can always PM me. Also check out my extensive 2 part AutoIt guides in which the link is in my signature titled "The Full Guide To Making Your Own Bots/Macros"
It explains in the most basic knowledge the fundamentals used in programming, basic coding in AutoIt and GUI Creation using AutoIt and KODA.
Hiyoal