[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Greater and lesser operator
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Greater and lesser operator

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Indoum   Sweden  (17 posts)  [Biography] 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 &lt; 1", which doesn't work well with LUA.
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] 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 &lt; 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 "&lt;", however when you paste that into the alias screen the "&lt;" 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
[Go to top] top

Posted by Indoum   Sweden  (17 posts)  [Biography] 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 &lt; or <? If the first, then I could just enter &lt; 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.
[Go to top] 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.


2,607 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] 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.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]