Problem mit AutoIt bot

06/23/2013 00:45 RF1T2#1
hallo :)

Ich versuche zurzeit einen Bot mit AutoIt zu machen stoße aber
immer auf ein bestimmtes Problem und weiss nich wie ich es beheben kann:

Code:
#include <GUIConstantsEx.au3>

GUICreate("jdsf", 250, 100)
GUICtrlCreateLabel("[F1] - Start", 8, 8)
GUICtrlCreateLabel("[ESC] - Ende", 8, 48)
GUISetState(@SW_SHOW)

HotKeySet("{F1}", "Start")
HotKeySet("{ESC}", "Ende")

While 1
	Sleep(500)
WEnd

Func Ende()
	Exit
EndFunc

Func Start()
While 1
	$PixelPosMapMark0 = PixelSearch(742 ,116 ,896 ,172 ,0x0710CF , 0)
	$PixelPosMapMark1 = PixelSearch(728 ,123 ,791 ,280 ,0x0710CF , 0)
	$PixelPosMapMark2 = PixelSearch(854 ,130 ,899 ,283 ,0x0710CF , 0)
	$PixelPosMapMark3 = PixelSearch(741 ,234 ,885 ,290 ,0x0710CF , 0)

;	$PixelPosPortalAusgang0 = PixelSearch(0 ,0 ,@DesktopWidth, @DesktopHeight, 0x95936A, 0)

	$PixelPosPortalEingang0 = PixelSearch(0 ,0 ,@DesktopWidth, @DesktopHeight, 0x7CB7EF, 0)

;	$PixelPosEdgevilleBanker0 = PixelSearch(0 ,0 ,@DesktopWidth, @DesktopHeight, 0x42395A, 0)



	Select
	Case	IsArray($PixelPosMapMark0)
			MouseClick("left", $PixelPosMapMark0[0], $PixelPosMapMark0[1], 1, 0)
			Sleep(5000)
	Case	IsArray($PixelPosMapMark1)
			MouseClick("left", $PixelPosMapMark1[0], $PixelPosMapMark1[1], 1, 0)
			Sleep(5000)
	Case	IsArray($PixelPosMapMark2)
			MouseClick("left", $PixelPosMapMark2[0], $PixelPosMapMark2[1], 1, 0)
			Sleep(5000)
	Case	IsArray($PixelPosMapMark3)
			MouseClick("left", $PixelPosMapMark3[0], $PixelPosMapMark3[1], 1, 0)
			Sleep(5000)


	Case	IsArray($PixelPosPortalEingang0)	 ;dieser case wird nicht ausgeführt 
			MouseClick("left", $PixelPosPortalEingang0[0], $PixelPosPortalEingang0[1], 1, 0)
			Sleep(5000)
			Return 1

	EndSelect

WEnd
EndFunc

Func Start2()
;code
;code
;code
;code
EndFunc

Eigentlich soll nachdem der fünfte case ausgeführt wurde Func start2 straten.
Aber der Bot kommt nicht dazu auf $pixelposportaleingang zu klicken sondern macht
immer mit $pixelposmapmark0 bis 3 weiter egal ob er sie findet.

Wisst ihr warum?
06/23/2013 09:33 FacePalmMan#2
mögliche fehler: falsche pixelfarbe oder spiel benutzt schatten
lösung: nochmal die richtige pixelfarbe suchen oder toleranz wert erhöhen
06/23/2013 16:34 RF1T2#3
Was ich aber auch gerne wissen würde (auf dieses Problem bezogen), ist ob man bei pixelsearch in dem Feld in dem gesucht wird einen Bereich in der Mitte angeben kann in dem nicht gesucht wird.