Abend beisammen,
also ich Code seit heute Nachmittag Autoit und programmiere momentan einen Silkroad Online Autopotter. Wenn ich jedoch auf den Startknopf drücke hängt das Programm und lässt sich nur noch über den Taskmanager beenden.
Eventuell weiß auch einer wie ich den Pauseknopf programmieren kann sodass er wirklich stoppt wenn ich darauf klicke.
Hoffe ihr blickt durch meinen Code:
Spoiler anzeigen
; SRO Autopotter 0.8
; Author: born2die
; Copyright 2008 152x87, 152x93 rgb=DA4348 rgb=F7DA4E
#include
Global $health = "1"
Global $food = "2"
Global $sro_name
$Sro = GUICreate("Sro Autopotter by born2die 0.8", 285, 340, 193, 125)
$Group1 = GUICtrlCreateGroup("Autopot", 24, 8, 65, 89)
$Checkbox1 = GUICtrlCreateCheckbox("Life", 32, 32, 57, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox2 = GUICtrlCreateCheckbox("Food", 32, 56, 49, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Start", 104, 16, 73, 25, 0)
$Button2 = GUICtrlCreateButton("Stop", 104, 48, 75, 25, 0)
$Button3 = GUICtrlCreateButton("About", 192, 16, 75, 25, 0)
$Button4 = GUICtrlCreateButton("Exit", 192, 48, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("Copyright by born2die 2008", 24, 312, 133, 17)
$Group2 = GUICtrlCreateGroup("Place of Life", 24, 112, 185, 89)
$Radio1 = GUICtrlCreateRadio("1", 72, 144, 25, 17)
$Radio2 = GUICtrlCreateRadio("2", 104, 144, 25, 17)
$Radio3 = GUICtrlCreateRadio("3", 136, 144, 33, 17)
$Radio4 = GUICtrlCreateRadio("4", 168, 144, 25, 17)
$Radio5 = GUICtrlCreateRadio("5", 32, 168, 25, 17)
$Radio6 = GUICtrlCreateRadio("6", 72, 168, 25, 17)
$Radio7 = GUICtrlCreateRadio("7", 104, 168, 25, 17)
$Radio8 = GUICtrlCreateRadio("8", 136, 168, 25, 17)
$Radio9 = GUICtrlCreateRadio("9", 168, 168, 25, 17)
$Radio10 = GUICtrlCreateRadio("0", 32, 144, 25, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Place of Food", 22, 215, 185, 89)
$Radio11 = GUICtrlCreateRadio("1", 70, 247, 25, 17)
$Radio12 = GUICtrlCreateRadio("2", 102, 247, 25, 17)
$Radio13 = GUICtrlCreateRadio("3", 134, 247, 33, 17)
$Radio14 = GUICtrlCreateRadio("4", 166, 247, 25, 17)
$Radio15 = GUICtrlCreateRadio("5", 30, 271, 25, 17)
$Radio16 = GUICtrlCreateRadio("6", 70, 271, 25, 17)
$Radio17 = GUICtrlCreateRadio("7", 102, 271, 25, 17)
$Radio18 = GUICtrlCreateRadio("8", 134, 271, 25, 17)
$Radio19 = GUICtrlCreateRadio("9", 166, 271, 25, 17)
$Radio20 = GUICtrlCreateRadio("0", 30, 247, 25, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input1 = GUICtrlCreateInput("Silkroad-Online", 152, 88, 121, 21)
$Label2 = GUICtrlCreateLabel("Sro-Name:", 96, 88, 54, 17)
$Label3 = GUICtrlCreateLabel("Sleeptime:", 216, 120, 53, 17)
$Input2 = GUICtrlCreateInput("3", 216, 144, 57, 21)
Opt("TrayIconHide", 1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
pot()
Case $Button2
Case $Button3
MsgBox(0, "Sro Autopotter", "Sro Autopotter made by born2die" & @CR & "Version 0.8" & @CR & "Copyright 2008")
Case $Button4
Exit
EndSwitch
WEnd
Func pot()
$sro_name = GUICtrlGetState($Input1)
GetHealth()
GetFood()
if $health == $food Then
MsgBox(16, "Error!", "Health and Food have the same Number, that doesn't work!")
Exit
EndIf
$sleep = GUICtrlGetState($Input2) * 1000
While 1
If WinWaitActive($sro_name) Then
If (GUICtrlGetState($Checkbox1) == $GUI_CHECKED) Then
If PixelGetColor(152, 87) <> 0xDA4348 Then Send($health) ;prüfen ob das Leben unter ca 50% ist
EndIf
If (GUICtrlGetState($Checkbox2) == $GUI_CHECKED) Then
If PixelGetColor(152, 93) <> 0xF7DA4E Then Send($food) ;prüfen ob Hunger unter ca 50% ist
EndIf
EndIf
Sleep($sleep)
WEnd
EndFunc
Func GetHealth()
If GUICtrlGetState($Radio1) == $GUI_CHECKED Then $health = 1
If GUICtrlGetState($Radio2) == $GUI_CHECKED Then $health = 2
If GUICtrlGetState($Radio3) == $GUI_CHECKED Then $health = 3
If GUICtrlGetState($Radio4) == $GUI_CHECKED Then $health = 4
If GUICtrlGetState($Radio5) == $GUI_CHECKED Then $health = 5
If GUICtrlGetState($Radio6) == $GUI_CHECKED Then $health = 6
If GUICtrlGetState($Radio7) == $GUI_CHECKED Then $health = 7
If GUICtrlGetState($Radio8) == $GUI_CHECKED Then $health = 8
If GUICtrlGetState($Radio9) == $GUI_CHECKED Then $health = 9
If GUICtrlGetState($Radio10) == $GUI_CHECKED Then $health = 0
EndFunc
Func GetFood()
If GUICtrlGetState($Radio11) == $GUI_CHECKED Then $health = 1
If GUICtrlGetState($Radio12) == $GUI_CHECKED Then $health = 2
If GUICtrlGetState($Radio13) == $GUI_CHECKED Then $health = 3
If GUICtrlGetState($Radio14) == $GUI_CHECKED Then $health = 4
If GUICtrlGetState($Radio15) == $GUI_CHECKED Then $health = 5
If GUICtrlGetState($Radio16) == $GUI_CHECKED Then $health = 6
If GUICtrlGetState($Radio17) == $GUI_CHECKED Then $health = 7
If GUICtrlGetState($Radio18) == $GUI_CHECKED Then $health = 8
If GUICtrlGetState($Radio19) == $GUI_CHECKED Then $health = 9
If GUICtrlGetState($Radio20) == $GUI_CHECKED Then $health = 0
EndFunc
Danke Schonmal
mfg
born2die
</GUIConstants.au3>