Page 1 of 1
PixelSearch and VG... with AutoIt3 problems !!
Posted: February 18th, 2007, 10:44 am
by kumpel100
ok i working on a farmbot with AutoIt3 not my first but my first in VG.
i use on all other games i played this little skript to get the X Y mouse Pos with the ColorId:
Code: Register to unlock hidden link
SetKeyDelay 100,50
sc_id = -1
f9::
;ID holen
WinGet, sc_id, ID, A
MsgBox, F9=ID F2=Start F2=Pause %sc_id%
Return
f2::
MouseGetPos, xpos, ypos
PixelGetColor, color, %xpos%, %ypos%
MsgBox, The color at the current C=%color% X=%xpos% Y=%ypos%
return
so then i was using this part to find the right color on my position:
Code: Register to unlock hidden link
WinWait, Vanguard: Saga of Heroes,
IfWinNotActive, Vanguard: Saga of Heroes, , WinActivate, Vanguard: Saga of Heroes,
WinWaitActive, Vanguard: Saga of Heroes
f1::
CoordMode, Pixel, Screen
Pixelsearch, PX,PY,534,534,823,823,0x1F1F1F,3,Fast
if ErrorLevel = 0
msgbox, find color!
else
msgbox, didnt find !
sleep, 2000
it works Terrible in VG im not sure why.
any tips to make the work on pixelsearch more succefull in VG?
ty.
Posted: February 19th, 2007, 8:19 am
by tault_stigma
Im having trouble understanding exactly what problem you are experiencing, but pixel searching in vanguard with autoit3 workes very nicely. Finding a single pixel takes less than a milisecond, and even doing a CRC checksum for a 10x10 pixel area is 2-3ms at most on a fast machine.
So, unless you are scanning the ENTIRE screeen for pixels, and doing so faster than once every second, I can't see how it would run badly. If you scanning the whole screen your also doing something wrong BTW =P
-Stigma
Posted: February 19th, 2007, 11:32 am
by kumpel100
tault_stigma wrote:Im having trouble understanding exactly what problem you are experiencing, but pixel searching in vanguard with autoit3 workes very nicely. Finding a single pixel takes less than a milisecond, and even doing a CRC checksum for a 10x10 pixel area is 2-3ms at most on a fast machine.
So, unless you are scanning the ENTIRE screeen for pixels, and doing so faster than once every second, I can't see how it would run badly. If you scanning the whole screen your also doing something wrong BTW =P
-Stigma
i didnt scan the whole screen i scan one pixel and it seems the pixel changes sometimes the color btw it miss to many.
Posted: February 20th, 2007, 8:30 pm
by tault_stigma
ok, help me understand exactly WHAT you are scanning pixels for, and I will help you design it so it does what you need it to do.
There is nothing in vanguard that *needs* you to scan the whole screen. besides, scaning the whole screen will take so much time that the image will have refreshed before it finishes anyway, thereby invalidating the data.
SO far I'm having some trouble understanding what exactly you are tryingto acomplish, but if you are looking to just find the color value for a spesific pixel under your mouse cursor, like for example a pixel in your healthbar, then use the "autoit window info". it will have been installed allready from when you installed autoit.
Run autoit window info, then focus on the vanguard window and simply hover the mouse over the pixel you need. the autoit window info will show you the exact color value and position of the pixel under your mouse... then you can use that to script whatever condition you need.
-Stigma
Posted: February 21st, 2007, 5:34 am
by kumpel100
most time work with autohotkey, autoit3 seems better.
thx for the info-
Posted: February 24th, 2007, 9:59 pm
by ophidian
This doesn't look like AutoIt3 to me..
Normally the syntax for AutoIt3 would look like
Code: Register to unlock hidden link
$coord = PixelSearch( TopLeftX,TopLeftY, BottomRightx,BottomRightY, 0xFEDA41, 25 )
If Not @error Then
$pixelfound = True
EndIf
To explain briefly, the 0xFEDA41 is the hex color you're looking for. The 25 in the part after the color is the variation you're allowing. So if the pixel isn't EXACTLY the right color but close because of reflection changes/such then you use that.
If you aren't developing AutoIt3 scripts in SciTE then ... I suggest you get it and do so. You can highlight a function and press F1 and get all of the specifics for it. SciTE for AutoIt3 is the absolute nicest development environment for Au3 scripts.
I dun have VG so I can't help you specifically..
Ophidian