Mouse memory addresses

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#41 Post by Administrator » Mon Jun 28, 2010 6:44 pm

Just committed revision 465. You can now harvest while minimized with this version. It needs more testing to make sure everything is working as intended.

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

Re: Mouse memory addresses

#42 Post by rock5 » Mon Jun 28, 2010 8:10 pm

Administrator wrote:Just committed revision 465. You can now harvest while minimized with this version. It needs more testing to make sure everything is working as intended.
Excellent job of bringing everything together. You even included VoidMains harvesting flag.

I haven't done any harvesting for ages but I think I'll have to give this a try.

I noticed _id isn't used anymore. It can only harvest regular nodes right?

It would be good if there was some sort of logic that says

Code: Select all

if _id is specified then
    find first id match and go to it
else 
    find nearest harvest node and go to it
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#43 Post by Administrator » Mon Jun 28, 2010 10:37 pm

For now, no. It can be added pretty easily. The code I put up was mostly just to test how well the system works. So far, I'd say it works much better than the old harvesting system.

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

Re: Mouse memory addresses

#44 Post by rock5 » Tue Jun 29, 2010 12:03 am

Administrator wrote:For now, no. It can be added pretty easily. The code I put up was mostly just to test how well the system works. So far, I'd say it works much better than the old harvesting system.
It's missing nodes. Sometimes when there are 2 nearby it only harvests 1 and doesn't harvest the other until it comes around again. 1 particular node never got harvested. The bot would reach the waypoint just past it, say "No nearby harvestables found" then move on. I was hoping to narrow down the problem before the maintenance but I lost my internet connection. I just got it back.

What I can say so far is the name, id and type were correct but when I printed out the object list it wasn't there. I suspect it has something to do with the address range. I also noticed other nodes in the distance which means they should be in the table but they don't get harvested.
  • 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

#45 Post by VoidMain » Tue Jun 29, 2010 12:18 am

rock5 wrote:
Administrator wrote:For now, no. It can be added pretty easily. The code I put up was mostly just to test how well the system works. So far, I'd say it works much better than the old harvesting system.
It's missing nodes. Sometimes when there are 2 nearby it only harvests 1 and doesn't harvest the other until it comes around again. 1 particular node never got harvested. The bot would reach the waypoint just past it, say "No nearby harvestables found" then move on. I was hoping to narrow down the problem before the maintenance but I lost my internet connection. I just got it back.

What I can say so far is the name, id and type were correct but when I printed out the object list it wasn't there. I suspect it has something to do with the address range. I also noticed other nodes in the distance which means they should be in the table but they don't get harvested.
I know why that happens, both issues:
It misses 2nd node because you need to add another waypoint even with the same coordinates to ake the bot check for a 2nd harvestable in the same place.

And for the 2nd problem, it is a bit more complicated but is also easy to fix, tho table of surrounding objects is not of a fixed size i counted more than 500 objects in some situations, for our particular case that shouldn't be an issue because the table is sorted by distance to the player, not only by distance i think is sorted by angle of sight too...
Where the problem arises is when you come running to a node, sometimes the table doesn't get updated in time, meaning that we're reading and old copy, we just miss the new one for, i don't know, maybe 50 miliseconds but thats enough for us not seeing that particular node wich in fact is at the bottom of the table (i think this has something to do with facing direction but not entirely sure), so i solved it making the bot scan a second time when it doesn't find a node, reading memory is cheap and fast and i didn't even notice that the bot scans twice empty nodes, i'm sure there is a better solution but this works so far (i got 1800+ Barsas today in 6 hours harvest) ^^

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

Re: Mouse memory addresses

#46 Post by Administrator » Tue Jun 29, 2010 4:40 am

I've also hard-coded a distance limit of 120 units. This is just to prevent it from trying to run up a cliff in the distance to reach a node at the top when the closer node that you actually want is missing (somebody already harvested it, perhaps?). That could have something to do with it.

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

Re: Mouse memory addresses

#47 Post by rock5 » Tue Jun 29, 2010 5:01 am

Administrator wrote:I've also hard-coded a distance limit of 120 units. This is just to prevent it from trying to run up a cliff in the distance to reach a node at the top when the closer node that you actually want is missing (somebody already harvested it, perhaps?). That could have something to do with it.
I noticed the 120 limit. It would be nice if that could be an option that could be set by the user.

I've made some observations.

1. When listing the objects in the object list I found that they are in fact sorted by address. Objects at the bottom of the list that are out of order are actually old items.
2. All current items are always at the top of the list. There are no empty spots.
3. Items can move in the list without you moving due to lower addressed items entering the list.
4. With this in mind I looked for an address where, the number of items in the list, is stored. I found 5 pointers that that hold the number of objects in the list. 2 of them were static 9F4FD8 and 9F4FE0. So you could theoretically use that to read the correct number of objects from memory.
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#48 Post by Administrator » Tue Jun 29, 2010 6:49 pm

Fixed a number of issues with harvesting in r466:
Fixed: CObjectTableList now uses actual list size from client (rather than
guessing)
Fixed: CPlayer:harvest() now harvests all nearby nodes
Fixed: CPlayer:harvest() now ignores non-harvestable nodes (usable objects)
Changed: Harvest distance moved to profile options (HARVEST_DISTANCE)

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

Re: Mouse memory addresses

#49 Post by rock5 » Tue Jun 29, 2010 11:57 pm

Administrator wrote:Fixed a number of issues with harvesting in r466:
Fixed: CObjectTableList now uses actual list size from client (rather than
guessing)
Fixed: CPlayer:harvest() now harvests all nearby nodes
Fixed: CPlayer:harvest() now ignores non-harvestable nodes (usable objects)
Changed: Harvest distance moved to profile options (HARVEST_DISTANCE)
Great! That's pretty much everything we were talking about. Good job.

Now all I'm waiting for is the ability to open specific objects so I can make my scripts, that use mailboxes, work again.

Then I guess what's next is using memory addresses to target mobs and making the most of all the advantages that gives you. Then you could implement a type="HARVEST" waypoint type using the 1 scan of memory to decide if to attack a mob or harvest a node.

This all started when I compared rombot to mmodrifter. 1 great feature of mmodrifter has is it's radar. It's a shame that micromacro doesn't have any graphical abilities or we could have done one as well. Anyone got any ideas how we could make a radar?
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#50 Post by Administrator » Wed Jun 30, 2010 12:35 am

MicroMacro could, actually, make use of GUI elements. There was an experimental version that used FLTK (Fast Light Tool Kit) for a GUI, but I didn't care for it much.

You can check on luaforge.net for a GUI plugin and try that. There's been a problem with their site conflicting with my IP range (due to recent changes in which ranges are 'open'), which had disallowed me from viewing it normally for the last 6 months or so. Sure, I could have gotten around that, but it was very slow; which is not exactly useful when you need a lot of documentation. Looks like they finally fixed that problem, though.

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

Re: Mouse memory addresses

#51 Post by rock5 » Wed Jun 30, 2010 1:07 am

Administrator wrote:MicroMacro could, actually, make use of GUI elements. There was an experimental version that used FLTK (Fast Light Tool Kit) for a GUI, but I didn't care for it much.

You can check on luaforge.net for a GUI plugin and try that. There's been a problem with their site conflicting with my IP range (due to recent changes in which ranges are 'open'), which had disallowed me from viewing it normally for the last 6 months or so. Sure, I could have gotten around that, but it was very slow; which is not exactly useful when you need a lot of documentation. Looks like they finally fixed that problem, though.
I don't think I'm advanced enough to know what to do with a plug-in if I had one. I had a look at that site. It's really hard to figure out how to navigate it. I'm not sure I know what I'm looking for anyway. What capabilities are we looking for in a plug-in anyway?
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse memory addresses

#52 Post by Administrator » Wed Jun 30, 2010 2:22 am

Pretty much looking for Lua bindings to a respectable graphical toolkit such as FLTK, wxWidgets, or Qt.

FLTK emulates the GUI, so I don't like it very much (I'd much rather it use native API). It is, however, fast and small. Those are major pluses, of course.

wxWidgets does use the native API and contains so much more. It's nice, but a bit large.

And, well, I don't have any real experience with Qt. I've used Qt-based applications, but never programmed my own.

We're really getting off-topic now.

smokyru
Posts: 31
Joined: Fri Dec 18, 2009 9:02 am

Re: Mouse memory addresses

#53 Post by smokyru » Thu Jul 01, 2010 8:29 pm

Hey guys!

As you made the harvest function to ignore non-resources items, i'm now unable to use bot to target those things;

So i went back to the previous release, and here i use "harvest" in order to collect those non-resources.

My problem is: when there are many items surrounding my char, he will target 1st, and "try to harvest it"; but if it's not clickable, he will just stay here and not process to the stuff i want him to. So the question is: is there a way for me to tell him to ignore some items? (it even targets NPC)

Not sure i made my point clear enough, just tell me =)

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

Re: Mouse memory addresses

#54 Post by rock5 » Thu Jul 01, 2010 9:56 pm

smokyru, I'm not sure how Administrator wants to eventually implement harvesting other objects but until he does you can try changing line 37 of player.lua of the latest revision to:

Code: Select all

				if( obj.Type == PT_NODE and obj.Address ~= ignore and database.nodes[obj.Id] ) or (obj.Id == _id and obj.Address ~= ignore) then
That's all you need to open things like mailboxes and bulletin boards. If you are harvesting items that take time to harvest like quest collect items then you might need to change the wait time on line 106:

Code: Select all

			if( deltaTime(getTime(), timeStart) > 3000 ) then
Just increase the 3000 until it correctly harvests.

Note: this is just a quick fix as I expect Administrator probably already has planned how he wants to implement it himself.
  • 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

smokyru
Posts: 31
Joined: Fri Dec 18, 2009 9:02 am

Re: Mouse memory addresses

#55 Post by smokyru » Fri Jul 02, 2010 8:00 am

Hey! Thanks for the tip.

That would have maybe worked with 466, but with the very latest doesnt work either; am rolling back to 465, will see later :o With precise waypoints, i can make it detect the item i need before any other; only way i found at that moment.

I'll still be using the deltatime increase tho, thanks for that!

Edit: the waypoints work, but the game crashes all the time after 20min or so. I wonder if it is because of the instanced area, or something else...

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

Re: Mouse memory addresses

#56 Post by rock5 » Fri Jul 02, 2010 9:09 am

smokyru wrote:Hey! Thanks for the tip.

That would have maybe worked with 466, but with the very latest doesnt work either; am rolling back to 465, will see later :o With precise waypoints, i can make it detect the item i need before any other; only way i found at that moment.

I'll still be using the deltatime increase tho, thanks for that!

Edit: the waypoints work, but the game crashes all the time after 20min or so. I wonder if it is because of the instanced area, or something else...
Well 467 is supposed to fix the problem and allow you to open by id. Doesn't it work?
  • 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

smokyru
Posts: 31
Joined: Fri Dec 18, 2009 9:02 am

Re: Mouse memory addresses

#57 Post by smokyru » Fri Jul 02, 2010 1:11 pm

I guess it does; but how do i use it?

CPlayer:harvest(<ID here?>)

and if it's how it's done, how do i get the ID ? Or is the name of the item enough?
I'm going to try with the name, but i guess it won't work.

(and, btw, if you can tell me the difference between CPlayer:harvest()and player:harvest() please!)


Edit: CPlayer:harvest() does not work, both if i let () empty or filled with name.

SVN 467 and rom/update done ofc:

"player.lua:1755 compare nil with number"

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

Re: Mouse memory addresses

#58 Post by rock5 » Fri Jul 02, 2010 1:44 pm

smokyru wrote:I guess it does; but how do i use it?

CPlayer:harvest(<ID here?>)

and if it's how it's done, how do i get the ID ? Or is the name of the item enough?
I'm going to try with the name, but i guess it won't work.
Use the program I added to the bot, "rom/getid.lua".

With that script running point at any object in the game and the script will display the id, name and distance of the object. Also if you are harvesting anything that takes longer than 3 seconds just add a yrest after it. You don't need to change player.lua. eg. if you want to harvest something that takes 4.5 seconds then;
player:harvest(<ID here>); yrest(1500)

Here is some info about classes that might help you in the future:
CPlayer is the class or template for the player object. The player object is actually called "player". Player functions and variables are accessed using the player object eg. player:sleep(), player:harvest(id), player.Hp, player.Level, etc. Same with inventory. CInventory is the class, "inventory" is the actual object using the CInventory class as a template.
  • 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

smokyru
Posts: 31
Joined: Fri Dec 18, 2009 9:02 am

Re: Mouse memory addresses

#59 Post by smokyru » Fri Jul 02, 2010 2:16 pm

Okay, didn't see getid.lua - very nice stuff. And thanks for the explanation of classes =)

Edit 1:Just tried, here is the situation:

There are three times the same item close each to another, and when using the player:harvest(id), it keeps saying "We found XX and will harvest it". Every half a second, the game says "you dit not gain any items" and stop gathering.

My guess would be that it detects the 3 items with the same id, and it keeps "clicking" one after another, cancelling the previous casting time, even if i used yrest(3000).

Do not have any ideas on how to deal with that...

Edit 2: Confirmed, when i use one waypoint with 2 same items not too far from each other, the char run from on to another.

Edit 3: okay, i tried some crap with player.lua (i'm really not into coding, never done before), only way i managed to make it work was to add yrest(5000) right after "RoMScript("UseSkill(1,1)") (line 93).

I'm pretty sure it's far from being the best way to deal with it, but i'll let it be until pro people sort it out :P


Edit 4: okay, here is one more problem: what i did worked well if the "harvestable" item disappear upon harvesting, but if it doesn't, the bot will keep on trying to harvest it, instead of doing it and go to the next waypoint. And i guess this problem is way out of my league :(

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

Re: Mouse memory addresses

#60 Post by rock5 » Wed Jul 07, 2010 5:56 am

** THIS THREAD IS OBSOLETE **
DO NOT USE ANY FILES OR SUGGESTIONS IN THIS THREAD.
THE FEATURES THIS THREAD ARE TRYING TO ACHIEVE ARE
NOW INCLUDED IN THE CURRENT SVN REVISION.
  • 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

Post Reply

Who is online

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