Bot Problem [LoL]

11/23/2012 19:27 Regwin32#1
Hallo, ich habe mit Autoit angefangen, nun bin ich dabei einen League of Legends Levelbot zuschreiben. Eigentlich läuft alles aber nur Stockend und zu ungenau.
Ich habe nur das Problem wenn ich das Match dann gewonnen habe, dass der BOT nicht auf "Weiter" klickt. Ich habe ImageSearch ausprobiert
Code:
$Weiter = _ImageSearch("Weiter.bmp",1,$x,$y,100)
Do 
MouseClick("left",cord,cord) ;Busch Koordinaten
Until $Weiter = 1
If $Weiter = 1 Then
MouseClick("left",$x,$y,1,10)
EndIf
Doch nun macht er erst nur die Bewegung zum "Busch" doch wenn das "Weiter" Image erscheint hört er nicht auf.
Image :
Darauf habe ich es mit If versucht
Code:
If $Weiter = 0 Then
MouseClick("left",cord,cord) ;Busch Koordinaten
Else MouseClick("left",$x,$y,1,10)
EndIf
Und nur MouseClicks sind zu ungenau, manchmal ist das Match nach 11 minuten manchmal nach 23 beendet.
11/24/2012 00:34 logical691#2
I find it odd that your unable to code something that you have already coded once in your Darkorbit bot :/

Code:
Global $x = 0
Global $y = 0

$b = _ImageSearch("a.bmp", 1, $x, $y, 100)
If $b = False Then
	While 1
		sleep(300)
		$b = _ImageSearch("a.bmp", 1, $x, $y, 100)
		If $b = True Then
			MouseMove($x, $y)
		EndIf
	WEnd
EndIf
11/24/2012 11:19 Regwin32#3
Quote:
Originally Posted by logical691 View Post
I find it odd that your unable to code something that you have already coded once in your Darkorbit bot :/

Code:
Global $x = 0
Global $y = 0

$b = _ImageSearch("a.bmp", 1, $x, $y, 100)
If $b = False Then
	While 1
		sleep(300)
		$b = _ImageSearch("a.bmp", 1, $x, $y, 100)
		If $b = True Then
			MouseMove($x, $y)
		EndIf
	WEnd
EndIf
My Friend help me alot with the bot ;). I gonna try this Script thanks
11/24/2012 11:48 logical691#4
Nps, i use it in some browser games so i know it works.
11/29/2012 09:29 fear-x#5
Quote:
Originally Posted by Regwin32 View Post
My Friend help me alot with the bot ;). I gonna try this Script thanks
then why not use the examples or .. ask him ?
12/02/2012 20:45 BlueBasHeR#6
Hatte das gleiche Problem versuch mal das Bild größer zu machen oder dein Game ändert die Farbe :D z.b. nach 2 sec wird WEITER Gelb dann Weis dann so weiter
aber dann würde der doch klicken? haha :D ne ka
vg :)
12/03/2012 08:56 logical691#7
Here is an example using Do, Until as you can see i added a timer so after so many seconds it quits, i got this idea after using similar code for a pixel search.

Code:
$tstart = TimerInit()
$timerout = 30 ;seconds
Do
$img = _ImageSearchArea("test.png", 1, 0, 0, @DesktopHeight, @DesktopWidth, $x, $y, 100)
If TimerDiff($tstart) > $timeout * 1000 Then
MsgBox(0, "", "Image was not found within timeout period (" & $timeout & " seconds)")
Exit
EndIf
Until $img = True
MouseMove($x, $y)