Repair question?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
deathdealer1252
Posts: 68
Joined: Sat Nov 06, 2010 3:14 pm

Repair question?

#1 Post by deathdealer1252 »

Code: Select all

local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if( dura > 99 ) then
	player.free_flag1 = true;
end
That means if durability is greater than 99, it will set the flag to true and load the repair path. Now I tried using dura < 50, but I got a error, so how would I do less than 50?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repair question?

#2 Post by rock5 »

There are a number of ways but I find this the easiest.

Code: Select all

if( 55 > dura ) 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
deathdealer1252
Posts: 68
Joined: Sat Nov 06, 2010 3:14 pm

Re: Repair question?

#3 Post by deathdealer1252 »

Yeah, was thinking of doing it that way, guess just do not understand why you can not use <, but that means the same exact thing correct?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Repair question?

#4 Post by rock5 »

deathdealer1252 wrote:Yeah, was thinking of doing it that way, guess just do not understand why you can not use <, but that means the same exact thing correct?
Yes the same thing.
'a < b' is the same as 'b > a'
'a <= b' is the same as 'b >= a'

Like the error says, it thinks it's the start of a xml tag so it errors. There are 2 other solutions that I know of. One involves replacing the '<' with some special code that means the same thing but I can never remember it. The other is to enclose the lua in CDATA tags like the examples at the bottom of the default.xml profile. I find my solution the easiest. Just remember, when you want to use '<' in an xml file, just flip it round.
  • 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
deathdealer1252
Posts: 68
Joined: Sat Nov 06, 2010 3:14 pm

Re: Repair question?

#5 Post by deathdealer1252 »

That makes sense, did not think of it as a XML when I was trying to figure it out, but that makes perfect sense! Your solution is the easiest to me, but if I where to enclose it in CDATA tags, I could use less than, without a problem?
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: Repair question?

#6 Post by Administrator »

deathdealer1252 wrote:That makes sense, did not think of it as a XML when I was trying to figure it out, but that makes perfect sense! Your solution is the easiest to me, but if I where to enclose it in CDATA tags, I could use less than, without a problem?
Yes.
deathdealer1252
Posts: 68
Joined: Sat Nov 06, 2010 3:14 pm

Re: Repair question?

#7 Post by deathdealer1252 »

Thank you both for the help, back to finishing up the profile / waypoints. On a side note, the cpawn error, that is caused by running to many clients correct?
Post Reply