#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Sollte laufen

", 205, 50, 366, 222)
$Start = GUICtrlCreateButton("Start", 16, 8, 75, 25)
$Stop = GUICtrlCreateButton("Stop", 112, 8, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
global $nMsg
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
Mainscript()
EndSwitch
WEnd
func mainscript()
While 1
$nMsg = GUIGetMsg()
If $nMsg = $Stop then exitloop
#cs
Send("{TAB}")
Send("2")
Sleep(50)
Send("1")
Sleep(1000)
#ce
ToolTip("Bot läuft",0,0)
WEnd
ToolTip("Bot läuft nicht",0,0)
MsgBox(0,"","You pressed the Stop button!")
EndFunc