that toke me almost one day , the script need some tweak i dont have time to finish it . it really easy to make it a one button script you define the area to search with printscreen for the left top corner and pause for the right bottom .
with the auto it info you can take the color of the item you want to loot , there is a protection against looping on the same item too.
Read the comment into the script.
Code:
;Author cyberheter0
Opt("MouseCoordMode", 0) ; relative coord to the active windows
Opt("MouseClickDragDelay", 250) ; drag speed
If Not FileExists(@ScriptDir&"\Bcoord.ini") Then
IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","X","0")
IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","Y","0")
Sleep(500)
EndIf
Global $bpCoordSetX = IniRead(@ScriptDir&"\Bcoord.ini","Bcoord","X","0")
Global $bpCoordSetY = IniRead(@ScriptDir&"\Bcoord.ini","Bcoord","Y","0")
Global $pKP = 0
Global $aPKP = 0
Global $xyRB
Global $xyLT
Global $pSX
Global $pSY
Global $count
Global $zcount
Global $error
HotKeySet("{F1}","setBCoord") ;set the coordinate bag
HotKeySet("{PRINTSCREEN}","lTGetCoord") ;left top x, y
HotKeySet("{PAUSE}","rBGetCoord") ; right bottom x, y
HotKeySet("{END}","Terminate")
WinWaitActive("Darkfall Online")
while 1
if ($aPKP == 1) AND ($pKP == 1) then
$getRB= StringSplit($xyRB, '_', 2)
$getLT= StringSplit($xyLT, '_', 2)
$pColor = "0x757878_0xB6BCBC_0xB9C986_0x8B8F8F" ;separate each value by an underscore color value of item
$color= StringSplit($pColor, '_', 2)
;MsgBox(0, "X and Y are LT :", $color[0] & "," & $color[1])
;MsgBox(0, "X and Y are RB :", $getRB[0] & "," & $getRB[1])
$count = 0
Do
;MsgBox(0, "count ", $count & "," & $color[$count])
$zcount = 0
Do
$coord = PixelSearch( $getLT[0], $getLT[1], $getRB[0], $getRB[1], $color[$count], 30, 1) ;0x757878 ;0xB6BCBC 0xb9c986 $getLT[0]+303, $getLT[1]+225
If Not @error Then
;if (($coord[0] <> $pSX) And ($coord[1] <> $pSY)) Then
MouseClickDrag("left", $coord[0], $coord[1], $bpCoordSetX+Random(10,20,1), $bpCoordSetY+Random(10,20,1), 0)
MouseMove($getLT[0], $getLT[1], 0)
$pSX = $coord[0]
$pSY = $coord[1]
$zcount += 1
;MsgBox(0, "count ", $zcount)
$error = @error
if ($coord[0] == $pSX) And ($coord[1] == $pSY) And ($zcount ==1) Then
$error = 1
;MsgBox(0, "count ", "in the loop")
EndIf
;MsgBox(0, "Coord check", $coord[0] & "," & $coord[1])
EndIf
;if @error Then
;MsgBox(0, "Attention", "ERROR")
;EndIf
Until $error = 1
$count += 1
;MsgBox(0, "Attention", "passe le controle d'Erreur")
Until $count = UBound($color)
MsgBox(0, "Attention", "STOP")
$pKP = 0
$aPKP = 0
EndIf
WEnd
Func setBCoord()
$getPos = MouseGetPos()
IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","X", $getPos[0])
IniWrite(@ScriptDir&"\Bcoord.ini","Bcoord","Y", $getPos[1])
$bpCoordSetX = $getPos[0]
$bpCoordSetY = $getPos[1]
EndFunc
Func rBGetCoord()
Sleep(100)
ToolTip("the right bottom coord", 0, 0)
Sleep(200)
ToolTip("")
$posRB = MouseGetPos()
$xyRB = $posRB[0] & "_" & $posRB[1]
$pKP = 1
return $xyRB
EndFunc
Func lTGetCoord()
Sleep(100)
ToolTip("the left top coord", 0, 0)
Sleep(200)
$posLT = MouseGetPos()
$xyLT = $posLT[0] & "_" & $posLT[1]
$aPKP = 1
return $xyLT
EndFunc
Func Terminate()
Sleep(100)
ToolTip("script terminated", 0, 0)
Sleep(200)
Exit 0
EndFunc
AutoIt PixelSearch 08/20/2010 - AutoIt - 18 Replies Hallo,
kann mir jemand erklären, wie PixelSearch funktioniert?
Ich hab zwar schon auf mehrere Seiten was dazu gesehen...
Funktion PixelSearch
... aber ich versteh das immer noch nicht.
Ich hab den RGB Wert 210,133,85 und möchte, dass wenn ich die Taste UP drücke, dass sich die Maus an diese Stelle bewegt.
Aber 1. hab ich keine Ahnung wie ich diesen RGB einfügen soll und 2. bewegt sich dann die Maus alleine an diese Stelle?
[AutoIt] PixelSearch Tut 06/22/2010 - AutoIt - 8 Replies Hallo,
Mir ist aufgefallen dass die meisten nicht wissen wie man bestimmte Objekt mit Autoit sucht
Die "Grundgedanken":
Wenn ein Pixel mit einer bestimmten Eigenschaft(z:B Pixelfarbe) in einen betimmten Bereich auftaucht dann bewegt der Bot sich da hin :D
So gehts:
Hier erstmal die Variable mit der der Pixel festgelegt wird.
[AutoIt] Pixelsearch 02/03/2009 - General Coding - 3 Replies Hallo Leute,
Ich hab mir vor kurzem ein Angelbot mit einer Pixelsearchfunktion gemacht,
nur das Problem ist, dass ich nicht weis was ich schreiben soll nachdem er den Pixelsearch nach dem Pixel gemacht hat. Also dass er dann die Angel rauszieht:
...
While (1)
$Fischblase = PixelSearch(518, 198, 520, 200, 0xFCF8FB)
If ??? Then
sleep ( 2500 )
Send ( "{F4 down}" , 0 )
autoit Pixelsearch? 10/24/2008 - Guild Wars - 7 Replies Hy ich versuche mir auch einmal nen Bot zu machen, bin aber eher ein Anfänger. Deswegen brauche ich ma Hilfe!!
Mir geht es jetzt darum dass der Bot rauslaufen soll bzw. dass er etwas schreibt sobald er eine bestimmte Farbe in einem feld erkennt! (das er was schreiben soll habe ich geschrieben um erstma nur das zu kappieren. Wenn ich das hinkriege das er dann halt eienen Pixel erkennt, weiß ich den rest selber^^)
das habe ich geschrieben:
sleep (2000)
send ("v")
send...