Gammon Forum
Entire forum
MUSHclient
General
multiline trigger variables
multiline trigger variables
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Aznvt33
(18 posts) bio
|
Date
| Sun 03 Dec 2006 01:07 PM (UTC) |
Message
| I'm trying to modify Nick Gammon's health bar plugin to include an XP gauge in the info bar. I'm having a problem with the variables in the multiline trigger, however.
This is the trigger:
<trigger
enabled="y"
group="Multi Line"
lines_to_match="3"
keep_evaluating="y"
match="You are level (.*?) and (.*?)\% of the way to the next level\.\nHealth\: (.*?)\/(.*?) Mana\: (.*?)\/(.*?)\nEndurance\: (.*?)\/(.*?)
Willpower\: (.*?)\/(.*?)\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.setvariable "HealthMax", %4
world.setvariable "ManaMax", %6
world.setvariable "EnduranceMax", %8
world.setvariable "WillpowerMax", %10
world.setvariable "TNL", %2</send>
</trigger>
The problem is that Willpower variable is supposed to be the 10th (last) wildcard in that multiline trigger, but instead of setting the 10th wildcard, it sets the 1st wildcard and puts a 0 at the end.
For example, instead of the Willpower variable being an integer, it picks up something like "61 (Impregnable)0" (the string in the first wildcard).
Any ideas? | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #1 on Sun 03 Dec 2006 07:22 PM (UTC) |
Message
| You need:
world.setvariable "WillpowerMax", %<10>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Aznvt33
(18 posts) bio
|
Date
| Reply #2 on Sun 03 Dec 2006 07:53 PM (UTC) |
Message
| I'm getting an error:
Line 116: Element name must start with letter or underscore, but starts with "1" (problem in this file)
Line 116 is: world.setvariable "WillpowerMax", %<10> | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #3 on Mon 04 Dec 2006 07:16 AM (UTC) |
Message
| Plugins are stored in XML, I was giving the "raw" code. You need to do this inside a plugin:
world.setvariable "WillpowerMax", %<10>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
10,964 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.