Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Trigger problem

Trigger problem

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


Posted by Dabura   (11 posts)  Bio
Date Mon 14 Feb 2005 09:39 PM (UTC)
Message
I was playing Achaea the other day, and I have a trigger to set my health and mana to variables. The match is:
^(.*?)h\, (.*?)m

and then it sends world.setvariable "health", %1, world.setvariable "mana", %2.
For some reason, when I was playing, I got an error from it trying to send
world.setvariable "health", in tight red leather. Lying in a gelatinous mass of dead flesh, the small fishboy has been filleted.
to script. Any ideas why it would match that?
All I did to get that match, by the way, was Convert to regexp, and then I deleted the anchor at the end because my prompt doesn't end there.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Mon 14 Feb 2005 09:45 PM (UTC)

Amended on Mon 14 Feb 2005 09:46 PM (UTC) by Flannel

Message
You probably got that because your prompt got tacked onto the end of a line, so the whole first variable is that line.

You can fix it by making it match on only digits:
(\d+)h\, (\d+)m
and that also removes the start of line anchor, which you probably want to do (so when this happens again, and your prompt is after some stuff, you still match) or you can leave it, and just not have it update in those cases.

And you should quote your variables as well:
world.setvariable "health", "%1"
that was ultimately the source of your problem, since otherwise it wouldnt have yelled at you, just set the variable to a string.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Dabura   (11 posts)  Bio
Date Reply #2 on Mon 14 Feb 2005 09:50 PM (UTC)
Message
Thanks.
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,399 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.