AutoIt Coder Brauche hilfe

10/12/2009 19:23 Knower#1
Es ist ein Angelbot oder eher soll einer werden (für metin2) nur leider starte oder schließt er net wenn ich auf F11 bzw. F12 klicke warum?

Code:
opt ("MouseCoordMode",2)
opt ("PixelCoordMode",2)
Msgbox(0,"Angelbot","stellt metin2 auf Fesntermodus mit der Größe 1024x768 32bpp und Gamma wert 3")
while 2
	sleep(100)
WEnd
HotKeySet("{F11}","_Main")
HotKeySet("{F12}","_Exit2")
Func _Main()
	while 1
	_Koedersuche()
	_NimmKoeder($SlotNr)
	_AngelHinein()
	_BlasenWarten()
	_Rausziehen()
	sleep(2000)
WEnd

EndFunc
Global $Slot [8][2]
$Slot[1][0] = 442
$Slot[1][1] = 747
$Slot[2][0] = 474
$Slot[2][1] = 747
$Slot[3][0] = 506
$Slot[3][1] = 747
$Slot[4][0] = 538
$Slot[4][1] = 747
$Slot[5][0] = 584
$Slot[5][1] = 747
$Slot[6][0] = 616
$Slot[6][1] = 747
$Slot[7][0] = 648
$Slot[7][1] = 747
$Koeder = 0x8A736C
$FischBlase = 0xECE8EC
$KoederSlot = _Koedersuche()
$min = 1800
$max = 2300

Func _Koedersuche()
	For $i = 1 to UBound($Slot) -1
		If PixelGetColor($Slot[$i][0],$Slot[$i][1]) = $Koeder Then
			return $i
		EndIf
	Next
Return 0
	
EndFunc
Func _NimmKoeder($SlotNr)
	If $SlotNr > 4 Then
		$Taste = "F" & ($SlotNr -4)
		Elseif $SlotNr = 0
		Msgbox(0,"Angelbot","Keine Köder mehr!")
		Exit
	Else
		$taste = $SlotNr
	EndIf
	Send("{" & $Taste & " DOWN}")
	sleep(500)
	Send("{" & $Taste & " UP}")
EndFunc
Func _AngelHinein()
	Send ("{F4 DOWN}")
	sleep(500)
	Send ("{F4 UP}")	
EndFunc
Func _BlasenWarten()
	While 1
		$Coord = Pixelsearch(337,13,657,348,$FischBlase,10)
		If Not @error Then
			Exit Loop()
		EndIf
		Sleep(100)
	WEnd
EndFunc
Func _Rausziehen()
	$Wartezeit = Random($min,$max,1)
	sleep($Wartezeit)
	Send("{F4 DOWN}")
	sleep(500)
	Send("{F4 UP}")
EndFunc
Func _Exit2()
	Exit
EndFunc
10/12/2009 21:11 MoepMeep#2
Und warum nen pixelbot? Geht anders doch viel schöner...

btw, wir haben ne autoit section.
10/12/2009 21:44 ^darkwing#3
Code:
HotKeySet("{F11}","_Main")
HotKeySet("{F12}","_Exit2")
Der Teil gehört wohl eher in die Hauptschleife deines Programmes.