#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$PickUpBot = GUICreate("PickUp-Bot by InYourFace", 365, 174, 194, 116)
$Einstellungen = GUICtrlCreateGroup("Einstellungen", 8, 8, 353, 161)
$ZeitInput = GUICtrlCreateInput("0.1", 208, 64, 57, 24)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$NameText = GUICtrlCreateLabel("Name des Metin2-Fensters:", 16, 32, 168, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$ZeitText = GUICtrlCreateLabel("Zeit bis zum nächsten PickUp:", 16, 56, 181, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$KlammerText = GUICtrlCreateLabel("(in Sekunden, Komma als Punkt)", 16, 80, 158, 17)
$NameInput = GUICtrlCreateInput("METIN2", 208, 32, 73, 21)
$DetectButton = GUICtrlCreateButton("AutoDetect", 288, 32, 65, 25)
$HotkeyText = GUICtrlCreateLabel("Hotkeys:", 16, 104, 57, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$StartText = GUICtrlCreateLabel("Start:", 24, 128, 34, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$StartInput = GUICtrlCreateInput("F9", 88, 128, 33, 21)
$PauseText = GUICtrlCreateLabel("Pause:", 152, 128, 46, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$PauseInput = GUICtrlCreateInput("F10", 224, 128, 33, 21)
$GOButton = GUICtrlCreateButton("GO!", 280, 72, 65, 49)
$Exit = GUICtrlCreateButton("Exit", 280, 136, 65, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GOButton
$Name = GUICtrlRead ($NameInput)
WinActivate ("" & $Name & "")
$Start = GUICtrlRead ($StartInput)
HotKeySet ("{" & $Start & "}", "Start")
$Pause = GUICtrlRead ("" & $PauseInput & "")
HotKeySet ("{" & $Pause & "}", "Pause")
Case $Exit
Exit
EndSwitch
WEnd
Func Start ()
While (1)
$Start = GUICtrlRead ($StartInput)
HotKeySet ("{" & $Start & "}", "Start")
$Pause = GUICtrlRead ("" & $PauseInput & "")
$Wait = GUICtrlRead ($ZeitInput)
HotKeySet ("{" & $Pause & "}", "Pause")
$Wait = GUICtrlRead ($ZeitInput)
If WinActive ("" & $Name & "") Then
Send ("{^ down}")
Sleep ($Wait*1000/4)
Send ("{^ up}")
Sleep ($Wait*1000/4)
Send ("{y down}")
Sleep ($Wait*1000/4)
Send ("{y up}")
Sleep ($Wait*1000/4)
Else
Sleep (1000)
EndIf
WEnd
EndFunc
Func Pause ()
While (1)
Sleep (1000)
WEnd
EndFunc
Ich habe das Problem, dass, wenn der Bot kurz gelaufen ist, er sich nicht mehr über Exit oder GuiClose beenden lässt.