Gammon Forum
Entire forum
MUSHclient
Bug reports
Greater and lesser operator
Greater and lesser operator
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Indoum
Sweden (17 posts) bio
|
Date
| Mon 17 Apr 2006 05:23 PM (UTC) |
Message
| When doing this alias,
<alias enabled="y" keep_evaluating="y" match="^!(?:symptom|cured) (\w+)" regexp="y" send_to="12">
<send>if not aff['%1'] and affunknown < 1 then Execute("_illusion symptom/cure without the affliction or unknown registered") end</send>
</alias>
I get this error (line 1134 is the <send></send> one),
Line 1134: Element name must start with letter or underscore, but starts with " " (problem in this file)
It seems to be because of the "affunknown < 1" comparison. When I try to recreate the alias using MUSHclient's builtin editor, it's replaced with "affunknown < 1", which doesn't work well with LUA. | top |
|
Posted by
| Nick Gammon
Australia (22,973 posts) bio
Forum Administrator |
Date
| Reply #1 on Mon 17 Apr 2006 09:59 PM (UTC) |
Message
| This is not a bug, you are getting confused between the way aliases are represented when you copy and paste in XML format, and how they are stored internally.
Fixing it up so you can paste it:
<aliases>
<alias
match="^!(?:symptom|cured) (\w+)"
enabled="y"
regexp="y"
send_to="12"
keep_evaluating="y"
>
<send>if not aff['%1'] and affunknown < 1 then
Execute("_illusion symptom/cure without the affliction or unknown registered")
end</send>
</alias>
</aliases>
In the above example the "<" is indeed converted to "<", however when you paste that into the alias screen the "<" becomes "<" again, which is what Lua expects.
I wouldn't be making aliases manually in the text editor myself, just use the GUI screens to do it, then you don't have to worry about the "<" symbols. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Indoum
Sweden (17 posts) bio
|
Date
| Reply #2 on Mon 17 Apr 2006 10:55 PM (UTC) Amended on Mon 17 Apr 2006 10:56 PM (UTC) by Indoum
|
Message
| I write all my LUA/XML code in an editor called EditPlus2, far more efficient that way. The builtin editor is iffy and I'm easily lost when searching through thousands of triggers.
Does MUSHclient store the script with < or <? If the first, then I could just enter < in my plugin and MUSHclient would convert it at loadtime, just like with the worldfile?
EDIT: I went ahead and tested it myself, works like a charm. | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
9,683 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.