Permanent mount

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Permanent mount

#1 Post by ZZZZZ » Mon Jul 14, 2014 9:59 pm

Hey, just wondering, how would I check if I have a permanent mount or not? I'm after a function to check for a perm mount before running AT, and if the character doesn't have 1, then collect the mount pieces, otherwise skip them.

At the moment im just maintaining a list of names that do not have 1, but would really like a neater way of doing it.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Permanent mount

#2 Post by lisa » Mon Jul 14, 2014 11:06 pm

* has a peak at player:mount() *

Code: Select all

	-- Find mount
	if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 then
		-- There is a mount in the partner bag.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Permanent mount

#3 Post by ZZZZZ » Mon Jul 14, 2014 11:23 pm

Not all char's have mounts in that bag though, I use other players accounts at times and not all of them put perm mounts in the mount bag...

Though I guess there isn't really any other way to check, I tried a little function to read the tooltip but I fail at doing that lol. oh well.

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

Re: Permanent mount

#4 Post by rock5 » Tue Jul 15, 2014 12:29 am

I don't know about permanent mounts but you can check if you have a mount, using the way the bot does it, eg.

Code: Select all

if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 or inventory:getMount() then
    -- player has a mount.
You should be able to get whether it's permanent from memory. I'll have a look.

Ok, looks like an offset of 0x70 from the base address is 1 if the item expires and 0x74 is how many seconds it lasts.

I'll write a little function that answers your particular need.

Code: Select all

function noPermanentMount()
    if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 then
        return false
    else
        local mount = inventory:getMount()
        if mount and memoryReadInt(getProc(), mount.BaseItemAddress +0x70) == 0 then
            return false
        end
    end
    return true
end
Just add this to your waypoint files onload or make a userfunction file with it. Then in your waypoints you can do

Code: Select all

if noPermanentMount() then
    -- Do whatever you do to make it get the mount pieces
end
Note: This assumes you only have 1 mount. Why would you have a temporary one if you have a permanent?
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Permanent mount

#5 Post by ZZZZZ » Tue Jul 15, 2014 12:32 am

Awesome! Thanks once again R5, just what I was after :)

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

Re: Permanent mount

#6 Post by rock5 » Tue Jul 15, 2014 12:36 am

Maybe I'll add some expiry info to the item class. I'm pretty sure those offsets apply to all items that expire.
  • 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: No registered users and 2 guests