Detect cursor change?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
pixelSearch().
Re: Detect cursor change?
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.
Re: Detect cursor change?
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.
ImageSearch didnt work too.
the best way would be find memory offsets and work with it.
Re: Detect cursor change?
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?
The RoM Bot Online Wiki needs your help!
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
Found it. staticcharbase_address + 0x584 points to the object that the mouse is hovering over. If the mouse is not over any type of pawn (harvestable node, enemy, etc.), then this will contain 0. From this, you can read the pawn's information and gather whether or not it is a harvestable node or not.
Here's an example of the usage:
Where mousePtr_offset is 0x584. This outputs (when hovering over something):
Here's an example of the usage:
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]
Re: Detect cursor change?
Very nice administrator, and no I did not have ever color of every node. What I did was install a Add On that made the tooltip for Nodes, turn to Purple text (this way it does not get confused with monsters, quest items, etc...) and then scan a certain area of the screen, by moving the mouse, every move of the mouse, it scans for that color in a certain range (the size of the tooltip, so it can scan fast), and once it finds the node, it clicks. After the first harvest, have to rescan again, to find the position of the node (cause the position changes easily), then click 5 times, then move to next waypoint.
I know its a horrible way to do it, but only way I could get it to work, but now with Administrators offsets, I will build something better.
I know its a horrible way to do it, but only way I could get it to work, but now with Administrators offsets, I will build something better.
Re: Detect cursor change?
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.
Re: Detect cursor change?
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?
Re: Detect cursor change?
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.
this Displays me the CursoCode in combinate with:
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
this code lets move my cursor over my screen in a cerain location.
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
}
with this it works on every Screen solution.
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
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests