-
Tarsi
- Posts: 5
- Joined: Wed Nov 18, 2009 11:28 am
#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
-
Administrator
- Site Admin
- Posts: 5333
- Joined: Sat Jan 05, 2008 4:21 pm
#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 '<' instead.
-
Tarsi
- Posts: 5
- Joined: Wed Nov 18, 2009 11:28 am
#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
#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") < 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
-
Administrator
- Site Admin
- Posts: 5333
- Joined: Sat Jan 05, 2008 4:21 pm
#5
Post
by Administrator » Fri Nov 20, 2009 5:02 pm
My mistake. It should be "<" and not just "<". Let me know if this works.
-
Tarsi
- Posts: 5
- Joined: Wed Nov 18, 2009 11:28 am
#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
#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
Who is online
Users browsing this forum: No registered users and 0 guests