Re: Detect cursor change?
Posted: Wed Jun 10, 2009 5:31 am
pixelSearch().
no way you have on every direction other colors thats why im using Cursor move with Cursor code detect.xxsinz wrote:Yes their is, but I have found it not to work so well, hence why I am using Autoit. If you can get a scan bot (scanning for the nodes) working in Lua, I would like to see the code.
I'm thinking on a solution with mouse over and an ingame tooltip. The tooltip is attached to the mouse position or could be fixed on the screen. And you could detect specific letters in the tooltip by pixel color or even create an own ingame addon who displays an big red point at an specific window position.kumpel100 wrote: no way you have on every direction other colors thats why im using Cursor move with Cursor code detect.
Code: Select all
local mousePawn = CPawn(memoryReadIntPtr(getProc(), staticcharbase_address, mousePtr_offset));
if( mousePawn.Address ) then
printf("Mouse over node name: %s [0x%X]\n", mousePawn.Name, mousePawn.Address);
end
Enjoy. I will be interested in seeing what you guys do with this.Mouse over node name: Zinc Ore [0x2E05F500]
mousemove, for any kind of detection your RoM must be infront if you using PixelSearch.d003232 wrote:I'm thinking on a solution with mouse over and an ingame tooltip. The tooltip is attached to the mouse position or could be fixed on the screen. And you could detect specific letters in the tooltip by pixel color or even create an own ingame addon who displays an big red point at an specific window position.kumpel100 wrote: no way you have on every direction other colors thats why im using Cursor move with Cursor code detect.
If you 'detect' the red point you could use lua to harvest.
But could you still run two or more RoM windows if you use MouseMove in lua?
PixelSearch is the worest/Slowest way we can go but atm the only way we get something to work, ok i just use PixelSearch to check if my Harvest Process starts so i see if i have a resource or a Mob, my main routine checks for CursorChange:Chaosis wrote:I know that this may be advanced, and too slow for lua... But you could put all the pixels on the screen into an array (800x600 res might be good). You could even do just every 5 pixels or whatever. Then search for the area with the most grey color and click there to mine tin ore. A "hotspot" clicking function could be useful.
Code: Select all
CursorCheck:
{
VarSetCapacity(ci, 20, 0)
ci := Chr(20)
ErrorLevel := DllCall("GetCursorInfo", "uint", &ci)
ErrorLevel := mod(ErrorLevel + 1, 2)
Rechts_Cursor := *(&ci+8)+(*(&ci+9) << 8)+(*(&ci+10) << 16)+(*(&ci+11) << 24)
;return h_cursor
}
return
Code: Select all
XStart := ((A_ScreenWidth/2)-220) ; Start Pos x + =Mehr Breit - =Weniger Breit
yStart := ((A_ScreenHeight/2)-90) ; Start Pos y wert klein = sucht nieder
XMax := ((A_ScreenWidth/2)+20) ; max ScannWeite
Ymax := ((A_ScreenHeight/2)+80) ; max ScannHöhe
S= 20 ; ScannSchrittweite
Z= 35 ; Zeilenvorschub
start1:
mouseMove, 50, 50
Gosub Begin_Cursor_Check
mouseMove, xstart, ystart
goSub, Z1
goto start1
Z1:
loop
{
IfWinNotActive, Runes of Magic, , WinActivate, Runes of Magic,
coordMode, Mouse, Screen
mouseMove, x +S , y
mouseGetPos, x, y
if x > %xmax%
{
mouseMove, x, y+Z
mouseGetPos, x, y
GoSub, Z2
}
if y > %Ymax%
{
x=%xStart%
y=%yStart%
goto Z1
}
gosub CursorCheckvonLinks
Gosub AbgleichvonLinks
}
Z2:
loop
{
IfWinNotActive, Runes of Magic, , WinActivate, Runes of Magic,
mouseMove x -S , y
mouseGetPos, x, y
if x < %xmin%
{
mouseMove, x, y+Z
mouseGetPos, x, y
Return
}
if y > %ymax%
{
x=%xStart%
y=%yStart%
ToolTip, FERTIG, 840, 460
sleep 1000
ToolTip
exitapp
}
gosub CursorCheckvonRechts
Gosub AbgleichvonRechts
}
Code: Select all
XStart := ((A_ScreenWidth/2)-220) ; Start Pos x + =Mehr Breit - =Weniger Breit
yStart := ((A_ScreenHeight/2)-90) ; Start Pos y wert klein = sucht nieder
XMax := ((A_ScreenWidth/2)+20) ; max ScannWeite
Ymax := ((A_ScreenHeight/2)+80) ; max ScannHöhe