Mouse memory addresses

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Mouse memory addresses

#1 Post by rock5 » Tue Jun 15, 2010 1:24 am

I noticed that, even when the Rom client window isn't active, moving the mouse over it still causes tooltips to appear. So it still has mouse coordinates when not active. I'm thinking it must be theoretically possible to find the ingame memory addresses for the mouse coordinates. So I've been messing around with the memory address software trying to find them.

I think I'm getting close but it's hard to test changing the values when the real mouse movement causes the value to change.

As I have no experience with memory addresses, I was wondering if you could write a simple program that just changes the 2 addresses and clicks the mouse button or tries to read the tooltip or whatever the bot does when scanning.

If you supply the code I can try the addresses I'm finding and see if they work. Hopefully it's not too big a job for someone with lots of memory address experience.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#2 Post by Administrator » Tue Jun 15, 2010 9:56 am

The problem isn't finding the mouse location addresses (I've found those before), but rather inducing a fake mouse click. mouseLClick() doesn't work for RoM. I had a little luck doing that with memory manipulation again, but it was very unpredictable. Sometimes it would work, sometimes it wouldn't.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Mouse memory addresses

#3 Post by rock5 » Tue Jun 15, 2010 10:00 am

Administrator wrote:The problem isn't finding the mouse location addresses (I've found those before), but rather inducing a fake mouse click. mouseLClick() doesn't work for RoM. I had a little luck doing that with memory manipulation again, but it was very unpredictable. Sometimes it would work, sometimes it wouldn't.
I suspected it might have been harder than I thought. No harm asking.

I guess it's frustrating because mmodrifter can do it. It can harvest even with the client minimized.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Mouse memory addresses

#4 Post by 3cmSailorfuku » Tue Jun 15, 2010 5:40 pm

rock5 wrote:
Administrator wrote:The problem isn't finding the mouse location addresses (I've found those before), but rather inducing a fake mouse click. mouseLClick() doesn't work for RoM. I had a little luck doing that with memory manipulation again, but it was very unpredictable. Sometimes it would work, sometimes it wouldn't.
I suspected it might have been harder than I thought. No harm asking.

I guess it's frustrating because mmodrifter can do it. It can harvest even with the client minimized.
If you have a copy of MMODrifter running you -could- try finding out which memory location it's reading or writing.

But I honestly can't remember the name of the program anymore, it was probably Spiro who created it way before MHS. I'm sure Elverion knows it too, but I doubt it works on Windows 7 as it gave me trouble already on Windows Vista.
It could list up which program manipulates or reads which data on your targeted process, and include the adress itself and the value.

But it would be questionable if Elverion would allow you to incoporate such thing into an official release if you are just milking MMODrifter, It's mainly for the fun and collaboration with others - right?

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Mouse memory addresses

#5 Post by KillerTHC » Tue Jun 15, 2010 7:58 pm

3cmSailorfuku wrote:But it would be questionable if Elverion would allow you to incoporate such thing into an official release if you are just milking MMODrifter, It's mainly for the fun and collaboration with others - right?
It might fly with him/her if you look at it from the perspective that MMODrifter is collaborating with us and that the more mats we get the more fun lol :P You never know.

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#6 Post by Administrator » Wed Jun 16, 2010 2:09 pm

KillerTHC wrote:It might fly with him/her if you look at it from the perspective that MMODrifter is collaborating with us and that the more mats we get the more fun lol :P You never know.
What do you mean "MMODrifter is collaborating with us"?


Really, the problem here is that to induce a faked mouse click, the client would need to be modified (even if only while in memory). That's something I try to stray away from. If we can find a way to do so without modifying the client, I'm all for it.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Mouse memory addresses

#7 Post by swietlowka » Thu Jun 17, 2010 3:54 am

showWindow(getWin(), sw.show); doesn't this in front of each harvest somehow solves part of the problem?

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Mouse memory addresses

#8 Post by 3cmSailorfuku » Thu Jun 17, 2010 8:58 am

swietlowka wrote:showWindow(getWin(), sw.show); doesn't this in front of each harvest somehow solves part of the problem?
That doesn't solve the issue.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Mouse memory addresses

#9 Post by swietlowka » Thu Jun 17, 2010 9:06 am

thats a little weird since this function is suppose to make the window of rom active, personally haven't checked it it was just a thought

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Mouse memory addresses

#10 Post by rock5 » Thu Jun 17, 2010 9:12 am

swietlowka wrote:thats a little weird since this function is suppose to make the window of rom active, personally haven't checked it it was just a thought
I've never used it either but I've heard it only works if the micromacro window is the active window itself, which defeats the purpose.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#11 Post by Administrator » Thu Jun 17, 2010 12:41 pm

Yes, showWindow() only works in some cases. Blame Windows for this. Apparently, it's a "feature." It only works when the window or process was opened by the process calling showWindow (ie. MicroMacro in this case) or the window calling showWindow currently has focus (ie. the MicroMacro console is on top).

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Mouse memory addresses

#12 Post by rock5 » Thu Jun 17, 2010 1:13 pm

While playing with memory addresses I tried changing a memory address to target an npc then issuing a UseSkill(1,1) to start a dialog. It worked. Did you ever try something like this instead of using tab for targeting or is this too much like changing the client for you?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#13 Post by Administrator » Fri Jun 18, 2010 12:02 pm

Switching memory addresses does work, yes. And that's fine by me. The problem is gathering the addresses to all of the pawns. This, to the best of my knowledge, requires you to create a codecave to trap the addresses of all pawns as they are run through the game engine, which is modifying the client.

VoidMain
Posts: 187
Joined: Wed Apr 21, 2010 12:21 pm

Re: Mouse memory addresses

#14 Post by VoidMain » Mon Jun 21, 2010 12:38 pm

What if we use _G["MinimapFrame_Icon"..id]? i had little to no luck making it work tho but i think is doable, ate least for finding positions of harvestable nodes, that is the way yGather finds those, however i made a function to test it and i can´t get the value from the game, i mea: The macro executes the code but the second macro doesn't get the value, its weird because if i go to game window and click on the macro the values are written just fine...

This is what i'm executing:

local _vis,_txt = RoMScript("_G[\"MinimapFrame_Icon".. id .. "\"]:IsVisible(),".."GetMinimapIconText("..id.."),");

Any ideas?

VoidMain
Posts: 187
Joined: Wed Apr 21, 2010 12:21 pm

Re: Mouse memory addresses

#15 Post by VoidMain » Wed Jun 23, 2010 5:14 pm

Well i found something interesting for targeting harvestable nodes...

We don't really need to "fake" a mouseclick, we just need to fake mouse movement and then, if we found a harvestable node we set it to player target, like this:
memoryWriteInt(getProc(), player.Address + addresses.pawnTargetPtr_offset, mousePawn.Address);

And then we can send this:
RoMScript("UseSkill(1,1);");

And it works!!! Works fine so far, the only problem is that i can't fin mouse coordinates yet... So if anyone has a clue about mouse coordinates in game memory, please letme know...

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#16 Post by Administrator » Wed Jun 23, 2010 7:51 pm

Targeting and attacking does work much better than clicking. Good find there. However, there's a few issues with finding the node. I've been screwing around with it for a few hours, and can't find any reliable way of making it work. The scanning just won't work well by manipulating the mouse coordinates in memory. It works great if the game has focus, but once it's in the background, it stops functioning most of the time. If another window is covering the RoM window, it breaks and fails to find the node about 90% of the time. If the RoM window is minimized, it is completely unable to ever find the node.

If you've got any ideas on how to get around this, I'd like to hear them.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Mouse memory addresses

#17 Post by rock5 » Thu Jun 24, 2010 12:07 am

Administrator wrote:Targeting and attacking does work much better than clicking. Good find there. However, there's a few issues with finding the node. I've been screwing around with it for a few hours, and can't find any reliable way of making it work. The scanning just won't work well by manipulating the mouse coordinates in memory. It works great if the game has focus, but once it's in the background, it stops functioning most of the time. If another window is covering the RoM window, it breaks and fails to find the node about 90% of the time. If the RoM window is minimized, it is completely unable to ever find the node.

If you've got any ideas on how to get around this, I'd like to hear them.
Forget node scanning, how about implementing the "target and attacking" for things like mailboxes and bulletin boards? They don't need to be scanned 'cos you can get the id when you create the waypoint file? Then maybe finally the only thing left that will need mouse clicks is harvesting.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#18 Post by Administrator » Thu Jun 24, 2010 1:15 am

You can get the ID, yes, but not the pointer to it's instance in memory (which will change every time you see it). That won't work, unfortunately.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Mouse memory addresses

#19 Post by rock5 » Thu Jun 24, 2010 5:29 am

Administrator wrote:You can get the ID, yes, but not the pointer to it's instance in memory (which will change every time you see it). That won't work, unfortunately.
Wouldn't there need to be some sort of table in memory that contains all the object in range? If you could figure out where that is you could search it for the object your looking for.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

VoidMain
Posts: 187
Joined: Wed Apr 21, 2010 12:21 pm

Re: Mouse memory addresses

#20 Post by VoidMain » Thu Jun 24, 2010 11:53 am

rock5 wrote:
Administrator wrote:You can get the ID, yes, but not the pointer to it's instance in memory (which will change every time you see it). That won't work, unfortunately.
Wouldn't there need to be some sort of table in memory that contains all the object in range? If you could figure out where that is you could search it for the object your looking for.
Yes, indeed there is a table of surrounding objects i'm guessing there is more than one (one for attackable and other for "friendly" NPCs minimum) but for the sake of simplicity we could just scan the minimap icons, both, NPCs (mailboxes, merchants, etc.) and harvestables apear on minimap and there is a function in RoM to access it via Lua, i managed to find a part of that table in memory but couldn't get the pointer to it, just some resources here and there...

On the other hand, regarding mouse movement, i believe that the problem is RoM hooking the mouse so it "knows" when to react to mouse movement and clicks because its asking to the OS if he is on foreground...

I'll continue to search for the table of surrounding objects, from what i saw last night there is a table, some parts where easy to find i was searching for thext matching some node i had on sight, when found (like 6 results or so) i can walk away from my position and i saw the text changing to other node that appeared, but i was unable to find the pointer to that table i'll need to dig a bit deeper into it...

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 49 guests