Player class check
Player class check
Hi guyz, need help with two things:
1.) Code for checking if you're currently on your secondary class or tertiary class.
2.) Code for checking if you are currently playing a mage class.
Thanks.
1.) Code for checking if you're currently on your secondary class or tertiary class.
2.) Code for checking if you are currently playing a mage class.
Thanks.
Re: Player class check
Hm... What makes a particular class your primary, secondary or tertiary class? If your primary class has the highest level then you can check the class levels. The values to check arekenzu38 wrote:1.) Code for checking if you're currently on your secondary class or tertiary class.
Code: Select all
player.Level -- It's not a typo. There is no '1'.
player.Level2
player.Level3To check what exactly the classes are you would checkkenzu38 wrote:2.) Code for checking if you are currently playing a mage class.
Code: Select all
player.Class1
player.Class2
player.Class3Code: Select all
if player.Class1 == CLASS_MAGE then
etc.- 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: Player class check
I see, yea it would be hard to distinguish between them. Yes, I see, I could just check levels, good thing all my chars have their primary classes are at way higher levels than their secondary. Or else checking levels wouldn't work.rock5 wrote:Hm... What makes a particular class your primary, secondary or tertiary class? If your primary class has the highest level then you can check the class levels.
It sure does. Thanks a lot!rock5 wrote:Code: Select all
if player.Class1 == CLASS_MAGE then etc.
I hope that helps.
Re: Player class check
Ok so, I got the class check to work but I'm having problems with checking for levels. How exactly should I code it?
I have this right now:
It always errors. Can someone point out what I am doing wrong? Thanks.
I have this right now:
Code: Select all
if player.Level < player.Level2 or player.Level < player.Level3 then
-- Wait for user to change class
cprintf(cli.yellow,"You are not playing your highest level class, are you sure you want to continue\n")
player:sleep()
end Re: Player class check
If you are reporting an error you should include it to help us figure out what's wrong, otherwise we would have to guess. 
So I'll guess, you got an "invalid token" error. This is because you used the code in an xml file and it assumed the < is a beginning of a 'token', ie. <waypoint, <onload etc. You can use '>' so just switch them around.
So I'll guess, you got an "invalid token" error. This is because you used the code in an xml file and it assumed the < is a beginning of a 'token', ie. <waypoint, <onload etc. You can use '>' so just switch them around.
Code: Select all
if player.Level2 > player.Level or player.Level3 < player.Level then- 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: Player class check
Lol well, I had a hunch it was just some elementary syntax mistake that a newbie can easily overlook and an experienced coder would spot right away so I didn't bother posting what the error was.
But yes, you were right on the mark, it was an invalid token error. And I guess I was right on the mark that it was a basic mistake haha.
But yes, I admit it's not a good habit to post questions without the error messages so I'll try to keep this in mind next time.
Anyway, the check works fine now. Thanks a lot.
Though, I got a new code I need checked. Will this line work?
It's because I want my code to be universal for all my mage chars with different subclasses. So I'm thinking of doing it like the above. So is it valid?
Thanks.
Edit: Ok, tried the above code just now and it didn't work, it only changed to Mage primary with no subclass.
Also tried this code:
Same thing, only changed to Mage with no subclass. So can anyone tell me how to do this properly? Thanks.
But yes, you were right on the mark, it was an invalid token error. And I guess I was right on the mark that it was a basic mistake haha.
But yes, I admit it's not a good habit to post questions without the error messages so I'll try to keep this in mind next time.
Anyway, the check works fine now. Thanks a lot.
Though, I got a new code I need checked. Will this line work?
Code: Select all
sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..", EXCHANGECLASS_SUBCLASS)");Thanks.
Edit: Ok, tried the above code just now and it didn't work, it only changed to Mage primary with no subclass.
Also tried this code:
Code: Select all
local class1 = player.Class1
sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..","..class1..")");Re: Player class check
Assuming the current main class is not Mage then I think what you want to do is move the main class into the sub class.kenzu38 wrote:sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..", EXCHANGECLASS_SUBCLASS)");
Code: Select all
sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..", EXCHANGECLASS_MAINCLASS)");You are forgetting the + 1.kenzu38 wrote: local class1 = player.Class1
sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..","..class1..")");
Code: Select all
local class1 = player.Class1
sendMacro("ExchangeClass("..(CLASS_MAGE + 1)..","..(class1+1)..")");- 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: Player class check
Hehe yea, figured the first one out earlier when I was testing. Just changed to MAINCLASS and the code worked. Though, I was really puzzled by the second one until you reminded me of the +1.
Anyway, both codes working fine now. As always, thanks a lot, rock!
Anyway, both codes working fine now. As always, thanks a lot, rock!