Simple Item count problem

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Tarsi
Posts: 5
Joined: Wed Nov 18, 2009 11:28 am

Simple Item count problem

#1 Post by Tarsi » Wed Nov 18, 2009 11:41 am

Hi,

I'm trying to call a waypoint file based on an item count. Here my code:
<waypoints>
<!-- # 1 --><waypoint x="-547" z="-5968">
inventory:update();

if ( inventory:itemTotalCount("Phiriusmarke") < 90 ) then

load_paths("dailypfad.xml");

else
load_paths("arkanholen.xml");

end
</waypoint>
</waypoints>
Looks simple and straightforward to me . However the bot quits with an
Line: 5
Column: 49
Message: not well-formed (invalid token)
It's probably a simple thing but I can't find the solution. Could somebody help me out here?

RGDS

tarsi

User avatar
Administrator
Site Admin
Posts: 5333
Joined: Sat Jan 05, 2008 4:21 pm

Re: Simple Item count problem

#2 Post by Administrator » Wed Nov 18, 2009 4:30 pm

Don't use '<' within a tag; it confuses the parser (it can't tell between you using it in code, and using it to create a new tag). Use '&lt' instead.

Tarsi
Posts: 5
Joined: Wed Nov 18, 2009 11:28 am

Re: Simple Item count problem

#3 Post by Tarsi » Wed Nov 18, 2009 6:24 pm

Ok, thanx, I will try that wicked sign of yours :)

By the way, I think somebody should have a look at the Wiki if this turns out to be the problem as I copied the string from teh tutorial examples :)

Will report effect tomorrow...

Thanx

tarsi

Tarsi
Posts: 5
Joined: Wed Nov 18, 2009 11:28 am

Re: Simple Item count problem

#4 Post by Tarsi » Fri Nov 20, 2009 4:56 am

Hi again,

hm, I still get the same failure message with
<waypoints>
<!-- # 1 --><waypoint x="-547" z="-5968">
inventory:update();

if ( inventory:itemTotalCount("Phiriusmarke") &lt 90 ) then

load_paths("dailypfad.xml");

else
load_paths("arkanholen.xml");

end
</waypoint>
</waypoints>
XML Parse Error
Line: 5
Column: 51
Message: not well-formed (invalid token)

Any other ideas?

Thx

Tarsi

User avatar
Administrator
Site Admin
Posts: 5333
Joined: Sat Jan 05, 2008 4:21 pm

Re: Simple Item count problem

#5 Post by Administrator » Fri Nov 20, 2009 5:02 pm

My mistake. It should be "<" and not just "&lt". Let me know if this works.

Tarsi
Posts: 5
Joined: Wed Nov 18, 2009 11:28 am

Re: Simple Item count problem

#6 Post by Tarsi » Mon Nov 23, 2009 1:48 pm

Hi,

thanx a lot, this now works. Another question came up though - how do I set a count for an item with a german Umlaut?
if ( inventory:itemTotalCount("Scharfe Bärenklaue") > 4 ) then
loadPaths("baerenabgeben.xml");
I tried with \132; instead of the ä but it didn't seem to have the desired effect. The bot accepted the code but didn't og into into the "then" part.

thx for the help...

Tarsi

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: Simple Item count problem

#7 Post by raff » Tue Nov 24, 2009 3:32 am

i dont know how to get umlauts working, but instead of itemnames, you can take the itemid. item ids can be found on this site:

www.runesdb.com <- but only for english itemnames
http://romdata.buffed.de <- for german itemnames

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest