PROBLEM

07/04/2009 22:01 lucabest#1
Hallo leute,
wieso funzt mien Script net?

Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 113, 95, 193, 125)
$Checkbox1 = GUICtrlCreateCheckbox("AutoAttack", 8, 8, 81, 17)
$Checkbox2 = GUICtrlCreateCheckbox("AutoPotten", 8, 24, 81, 17)
$Checkbox3 = GUICtrlCreateCheckbox("PickUp", 8, 40, 73, 17)
$Button1 = GUICtrlCreateButton("Start", 16, 64, 81, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
			Case $Checkbox1
			Case $Checkbox2
			Case $Checkbox3
			Case $Button1
				start ()
	EndSwitch
WEnd

Func start ()
	WinActivate("METIN2")
	If $Checkbox1=1 Then
		While(1)
			Send("{Space}")
		WEnd
	EndIf
	If $Checkbox2=1 Then
		While(1)
			Send("{1}")
			Sleep(100)
		WEnd
	EndIf
	If $Checkbox3=1 Then
		While(1)
			Send("{y}")
			Sleep(133)
		WEnd
	EndIf
EndFunc
07/04/2009 22:17 Syc0n#2
Quote:
Originally Posted by lucabest View Post
Hallo leute,
wieso funzt mien Script net?
Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 113, 95, 193, 125)
$Checkbox1 = GUICtrlCreateCheckbox("AutoAttack", 8, 8, 81, 17)
$Checkbox2 = GUICtrlCreateCheckbox("AutoPotten", 8, 24, 81, 17)
$Checkbox3 = GUICtrlCreateCheckbox("PickUp", 8, 40, 73, 17)
$Button1 = GUICtrlCreateButton("Start", 16, 64, 81, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			start ()
	EndSwitch
WEnd

Func start ()
	WinActivate("METIN2")
	If Guictrlread($Checkbox1) = 1 Then
		While 1
			Send("{Space}")
		WEnd
	EndIf
	If Guictrlread($Checkbox2) = 1 Then
		While 1
			Send("{1}")
			Sleep(100)
		WEnd
	EndIf
	If Guictrlread($Checkbox3) = 1 Then
		While 1
			Send("{y}")
			Sleep(133)
		WEnd
	EndIf
EndFunc
Hab das Script mal verbessert:
1. Case $Checkbox1 ist überflüssig
2. Du hast Guictrlread vergessen, sonst liest er die Checkboxen nicht aus

Ich geb dir noch nen Tipp:

Code:
While 1
	Send("{Space}")
WEnd
Würd da noch nen Sleep einfügen.