How to check amount of experience
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
How to check amount of experience
What code can I use to get my character to do something if he gets above x experience, (cumulative total or current level)? This is mid-level so player.Level and onLevelUp won't work.
- Administrator
- Site Admin
- Posts: 5333
- Joined: Sat Jan 05, 2008 4:21 pm
Re: How to check amount of experience
player.LastExp contains your total exp (if I remember correctly). It updates every 10 seconds, so is reasonably accurate.
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: How to check amount of experience
Awesome, thanks. Can I force an update with player:update() or anything else?
Re: How to check amount of experience
You can't really force an update but you could read the value directly yourself. This is the command
Code: Select all
experience = memoryReadRepeat("intptr", getProc(), addresses.charExp_address, 0)- 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
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: How to check amount of experience
Sweet... so I need to put;
in onLoad, then I can use statements like;
correct?
Or would it be better to do a function like;
Code: Select all
local experience = memoryReadRepeat("intptr", getProc(), addresses.charExp_address, 0)Code: Select all
if experience > 600000 then
__WPL:setForcedWaypointType("RUN")
endOr would it be better to do a function like;
Code: Select all
function getXP
return memoryReadRepeat("intptr", getProc(), addresses.charExp_address, 0)
endRe: How to check amount of experience
It would have to be a function. The first idea wouldn't work. Make sure you start it with
not
Then you could use
Code: Select all
function getXP()Code: Select all
function getXPCode: Select all
if getXP() > 600000 then
__WPL:setForcedWaypointType("RUN")
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
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: How to check amount of experience
Lol at forgot the parentheses.
Thanks so much!
-
Mushroomstamp
- Posts: 210
- Joined: Wed Oct 27, 2010 11:34 am
Re: How to check amount of experience
For anyone that doesn't know;
gives current level experience, not a cumulative total. I did not test player.LastExp.
Code: Select all
memoryReadRepeat("intptr", getProc(), addresses.charExp_address, 0)Re: How to check amount of experience
I just added player.XP and player.TP to the latest revision. They get updated when player:update() is run.
note: This revision also adds player.Class3 and player.Level3 values.
note: This revision also adds player.Class3 and player.Level3 values.
- 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: No registered users and 2 guests