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.
Permanent mount
Re: Permanent mount
* 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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Permanent mount
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.
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.
Re: Permanent mount
I don't know about permanent mounts but you can check if you have a mount, using the way the bot does it, eg.
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.Just add this to your waypoint files onload or make a userfunction file with it. Then in your waypoints you can do
Note: This assumes you only have 1 mount. Why would you have a temporary one if you have a permanent?
Code: Select all
if RoMScript("PartnerFrame_GetPartnerCount(2)") > 0 or inventory:getMount() then
-- player has a mount.
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
Code: Select all
if noPermanentMount() then
-- Do whatever you do to make it get the mount pieces
end
- 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
Re: Permanent mount
Awesome! Thanks once again R5, just what I was after 

Re: Permanent mount
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
Who is online
Users browsing this forum: Bing [Bot] and 3 guests