Detect cursor change?
Detect cursor change?
Anyone know of a way to detect if the actual cursor bitmap changes (not talking underneath the cursor). If anyone has a way of doing this in LUA / micromacro, or anything else that would be great.
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
You can usually find an integer that describes what the mouse cursor is in game. Usually, something like 0 = none, 1 = normal, 2 = mouse over enemy/attack icon, etc. Start with an unknown value search, and do something in game to change the mouse cursor, then search for changed value. When it hasn't changed, use unchanged value. Keep filtering till you find the address/pointer.
Re: Detect cursor change?
Alright, but do I need to be hover over the node or actual click it to do the next scan?
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
Just hover over it so that the mouse cursor changes, then scan for changed value.
Re: Detect cursor change?
Doing that now, but their over 100,000 values... no better way of doing this?
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
Nope. That's pretty much it. Remember to move the mouse to another node (to change the cursor) then back, and search unchanged value. This helps narrow down the results greatly. Sometimes, it can be a lengthy process.
Re: Detect cursor change?
Thanks, guess just have to try to narrow it down the best I can. I had a quick question, anyway to target a NPC and open the window with them through LUA?
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Detect cursor change?
Not easily, no. I guess the best way to do that would be to scan the area by moving the mouse and checking for cursor change, then send a mouse click.
Re: Detect cursor change?
Alright, ya for now I am just using a Pixel Scan in certain area, and if it hovers over the NPC, see the color of the NPC name, then it gets the Mouse X / Y coords and clicks, working pretty well for now. Final have a script that auto repairs, makes botting so much better.
Re: Detect cursor change?
try this:
i use this in my Harvest.exe to detect cursor changes...
is written to use it with autohotkey.
P.s is an example
Code: Select all
b::
start:
gosub CursorCheck
msgbox,,, CursorCode= %Cursor_h% ,2
goto start
CursorCheck:
{
VarSetCapacity(ci, 20, 0)
ci := Chr(20)
ErrorLevel := DllCall("GetCursorInfo", "uint", &ci)
ErrorLevel := mod(ErrorLevel + 1, 2)
Cursor_h := *(&ci+8)+(*(&ci+9) << 8)+(*(&ci+10) << 16)+(*(&ci+11) << 24)
}
return
q::
pause
n::
exitapp
is written to use it with autohotkey.
P.s is an example
Re: Detect cursor change?
So your actual able to get cursor information, that is weird, I can do it with Autoit, but the handler seems to change all the time, is this the case for you?
Re: Detect cursor change?
there is a trick how to handle the cursor changes.
1) Cursocode of random area
2) Cursocode when Cursor change (must be resource or a Mob.)
3) click the found area, get a new CursorCode and check for this code every click on the "Resource" if there no process must be a mob...
and yes i check 1 time for Blue Processbar to see its a Mob or a Resource.
P.s hard to explain for me in english.
1) Cursocode of random area
2) Cursocode when Cursor change (must be resource or a Mob.)
3) click the found area, get a new CursorCode and check for this code every click on the "Resource" if there no process must be a mob...
and yes i check 1 time for Blue Processbar to see its a Mob or a Resource.
P.s hard to explain for me in english.
Re: Detect cursor change?
It seems that anytime I get the Handle for the Cursor, then move the mouse anywhere, the Handle changes, so It would be clicking pretty much the entire screen everytime, unless is their a Range for the handles for Mobs / Nodes?
Re: Detect cursor change?
i use a big route of of waypoints every waypoint is a resource spot on every waypoint i reach i let move my mouse in a little square when cursor change there is a Mob or a Resource.xxsinz wrote:It seems that anytime I get the Handle for the Cursor, then move the mouse anywhere, the Handle changes, so It would be clicking pretty much the entire screen everytime, unless is their a Range for the handles for Mobs / Nodes?
this way i farm ~200 resources per hr is not much but its AFK ^^.
Re: Detect cursor change?
Oh, so you already know where the node is going to be. Cause I already built a way to detect a node and then run up to it / harvest it. The trouble I was having was actual finding the node, while I was botting. That is pretty crazy to set up a path that goes to every node like that, I am looking for more a way to be able to bot anywhere and harvest.
Thanks for the information!
Thanks for the information!
Re: Detect cursor change?
you can wrote in every waypoint your bot reach a look for nodes routine i use this:xxsinz wrote:Oh, so you already know where the node is going to be. Cause I already built a way to detect a node and then run up to it / harvest it. The trouble I was having was actual finding the node, while I was botting. That is pretty crazy to set up a path that goes to every node like that, I am looking for more a way to be able to bot anywhere and harvest.
Thanks for the information!
Code: Select all
</waypoint>
<waypoint x="-xxxx" z="-xxxx" >
yrest(100);
os.execute("\"C:/Harvest.exe\" arguments");
yrest(100);
while(true) do
local foundProc = findProcessByExe("Harvest.exe");
if( foundProc == 0 ) then
break; -- break out, we don't have any Harvest.exe running
end
yrest(100);
end
yrest(100);
</waypoint>
Re: Detect cursor change?
That is cool, but see if their is no nodes around all your waypoints, then your not going to have much luck. I can try to give it a try, see what happens, thanks again.
Re: Detect cursor change?
what i say around 200 nodes a hour...
i know there are much better ways to make a Harvest/Xp bot but for my useage is ok.
i know there are much better ways to make a Harvest/Xp bot but for my useage is ok.
Re: Detect cursor change?
Well to be honest, the only way I know how to do is some what using your method, already had something similar, just added the waypoint code, testing it now.
Re: Detect cursor change?
Is there a way/function to detect pixel change with lua / MicroMacro ?Administrator wrote:Not easily, no. I guess the best way to do that would be to scan the area by moving the mouse and checking for cursor change, then send a mouse click.
The RoM Bot Online Wiki needs your help!
Who is online
Users browsing this forum: Google [Bot] and 1 guest