Optimierung meines Farmbots

06/10/2019 15:51 gtayakashi#1
Hallo Leute,

Bevor ihr mich anspuckt, es ist mir klar das die Funktion "Pixel Search" sowas von 2009 ist, jedoch bekomme ich das mit der Funktion "ImageSearch" nicht gebacken. Ich habe mit AutoIT keinerlei Erfahrung und kenne auch niemanden, der mir da helfen könnte. Deshalb suche ich hiermit jemanden, der sich damit auskennt.


Der Bot funktioniert schon, jedoch halt nicht "perfekt"

Ich lasse die Funktion "PixelSearch" schon andersrum dienen, damit der Bot nicht so weit läuft, und ich nicht weiß, wie ich ab dem Mittelpunkt meines Flyff Fensters suchen kann, und er dann nach aussen bis zum Ende entlang scannt. Thema Pakete & Offsets, bin ich erstmal raus, weil mein Kollege sich da schon schlau macht, und er noch einige Zeit dafür brauchen wird, da er nicht aus der "Flyff" Scene kommt.

Der eingetragene Farbcode im Source ist der für nen Mob auf dem Flyff Server


CODE:

Quote:
#include <GUIConstants.au3>
;GUI erstellen
GUICreate("Teamspeak 3 Musikbot" ,200,150 )
GUICtrlCreateLabel ("Mobs:", 1, 30, 50)
GUICtrlCreateLabel ("Failed:", 1, 50, 50)

;Variablenkram
$Mobs = GUICtrlCreateLabel ("0", 50, 30, 50)
$non = GUICtrlCreateLabel ("0", 50, 50, 50)
$info = GUICtrlCreateLabel ("Normal State", 1, 70, 1000)
GUISetState (@SW_SHOW)
sleep(3000)

;Hotkeys festlegen
HotKeySet("{f2}","_Pause")
HotKeySet("{f3}","_Display")
;PixelBot
While 1

Send("{RIGHT 7}")
sleep(500)
;$Variable = PixelSearch(1112,729,282,243, 0x82525D,2)
$Variable = PixelSearch(22,52,1297,1025, 0x82525D,2)
GUICtrlSetData($Info, "Lege los.")
If IsArray ($Variable) = True Then
MouseMove ($variable [0], $Variable [1],1)
MouseClick("Left")
MouseClick("Left")
sleep(1000)
GUICtrlSetData($Mobs, GUICtrlRead($Mobs) + 1)
GUICtrlSetData($Info, "Warte")
Else

GUICtrlSetData($non, GUICtrlRead($non) + 1)

GUICtrlSetData($Info, "Mob wurde nicht gefunden")
EndIf

WEnd
; functions
Func _Exit ()
Exit
EndFunc

Func _Pause ()
GUICtrlSetData($Info, "Pausiert")
Sleep(10000)
GUICtrlSetData($Info, "Bereit")
EndFunc

Func _Display ()
$Mon = GUICtrlRead($Mobs)
$fail = GUICtrlRead($non)
MsgBox(4096, "DATA", "You killed: " & $Mon &" Monsters ," & "Pixelseach failed: " & $fail & " times", 2)
EndFunc

Wäre lieb, wenn mir jemand hier helfen könnte.


Lieben Gruß
06/10/2019 20:48 cookie69#2
You can:
- get the game window size -> width=x, height = y
-> the center is at (x/2, y/2)
- calculate the factor between x and y. y/x ->0.8 for example
- do a loop that increases the size of the rectangle at each iteration (using the factor to know how to compute x1 and y1, x2 and y2
->the top-left side of the rectangle will have x1 and y1 reduced
-> the bottom -right of the rectange will have x2 and y2 increased
[Only registered and activated users can see links. Click Here To Register...]
06/11/2019 18:06 Feellblis#3
Radius for a pixelbot :

make a dummy and invite to your party, position dummy at the center of your farming spot. Always pixelsearch the navigator to see if your dummy toon (blue dot) is outside the navigator. If it is not found on the navigator, you are outside the spot. Make sure to equip dummy with fashion that contrasts the scenery. Pixel search and click on your dummy until bllue dot is at the center of the minimapp just like what you do on monster.

Another:

Pressing '9' or typing '/position' command generates position.txt . Make a script that reads it every 200millisecond to determine your location and move accordingly to get to the center.

Use wasd, jump ocassionally to make automation movement less linear. When white dot appears on minimap, another toon is near. Use beep command to alert or just pause the script.

Autoselling to NPC can be easily done with autoit pixelsearch but challenging with memorybot.