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
➜ General
➜ Triggers
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Zotiel
(14 posts) Bio
|
Date
| Sun 12 Oct 2003 01:40 PM (UTC) |
Message
| This'll likely make me sound like an idiot, but I can't get a trigger to work.
I'm used to running GMud as my client, been using it for YEARS, but I want to upgrade and ZMud just irks me to no end...MUSHClient came highly recomended, so I'm giving it a shot.
How do I make a trigger function if the triggering line has a number in it?
as in I want to tigger off of the line:
* gives you 5 gold.
It works in the TEST window, but I can't make it work in the playing window, even if I try channels, (IMM) echos, or what have you.
Or better yet, anyone have existing trigggers to make a BOT shopkeeper that can sell EQ and/or spellups? | Top |
|
Posted by
| finnish
Russia (18 posts) Bio
|
Date
| Reply #1 on Sun 12 Oct 2003 02:11 PM (UTC) |
Message
| (\w+) gives you (\d+) gold |
she never loved me why should anyone | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #2 on Sun 12 Oct 2003 04:37 PM (UTC) |
Message
| It's weird, "* gives you 5 gold." should work. Make sure you haven't checked "regular expression" perhaps? |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Zotiel
(14 posts) Bio
|
Date
| Reply #3 on Sun 12 Oct 2003 05:09 PM (UTC) Amended on Sun 12 Oct 2003 05:11 PM (UTC) by Zotiel
|
Message
| Tried: (\w+) gives you (\d+) gold
works, but it also works for any amount of gold given...I need it just fer 5 gold
Tried: (\w+) gives you 5 gold
that works fine...any clue why I can't have a trigger work with a number in it?
Never mind...thought I'd play around a bit...now I can't trigger off of a partial string...this seems more difficult then it needs to be...I'm switching back to gmud...I'll accent my triggers with mprogs as this does not seem to working....like every other trigger will not work...
I've set up timers, I've gotten simple aliases & macros to work...triggers on the otherhand don't wanna seem to work at all. Maybe I'll try to re-download it...maybe this one is corrupt...if everyone has these problems I can't see how it was recommended for me.
In case I can get this to work I've got two more questions...
1) Can I turn the blinking box off? (The one on the start bar, that blinks every time anything happens...it's bugging the ever living hell outta me!)
[Figured this one out...no need to answer]
2) Can I make it so I can clear the input box when I hit the down arrow? (Instead of it asking me if I wanna replace it with "")
Beyond those two things & the problems I'm having with triggers I actally really like the client...better then any of the Linux nes I've tried, and WAY better then Zmud (The name of ZMud even bothers me *smirk*)
| Top |
|
Posted by
| Shadowfyr
USA (1,790 posts) Bio
|
Date
| Reply #4 on Sun 12 Oct 2003 07:22 PM (UTC) |
Message
| Hmm. Very odd.. You original trigger 'should' have worked. This of course depends on if you had regular expression checked. Many clients use regular expressions by default, but then don't impliment them correctly. If that is the case in GMud then '* gives you 5 gold.' would fail in Mushclient's 'correct' implimentation because both * and . have special meaning. As a result the trigger would need to either have the regular expression setting turned off, or changing to '.* gives you 5 gold\.', which fixes the two special characters.
Basically triggers and aliases have two modes in Mushclient. The 'normal' mode treats * as the only special character, but it cannot match single words or other special conditions, just specific text + * (anything). The other mode impliments the somewhat complex, but very versitile Perl regular expression system that is described in the help. It sounds like you had the wrong setting turned on in your trigger.
As for the down arrow issue.. You can turn off the method to let you scroll through the history, but only the Esc key can clear the input box. The arrow keys have several optional functions, but that is not one of them. Frankly, considering the number of times I have fumbled a multiline input and had the client ask me if I wanted to replace it, I am glad it doesn't work that way myself. ;) lol | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sun 12 Oct 2003 10:21 PM (UTC) |
Message
|
Quote:
How do I make a trigger function if the triggering line has a number in it?
as in I want to tigger off of the line:
* gives you 5 gold.
That should work perfectly (with regular expressions *not* checked) however maybe there is a trailing space. You might want to try:
* gives you 5 gold.*
Quote:
Can I make it so I can clear the input box when I hit the down arrow? (Instead of it asking me if I wanna replace it with "")
Go to Configuration -> Commands -> Keyboard preferences and uncheck "Confirm before replacing typing".
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #6 on Mon 13 Oct 2003 07:32 AM (UTC) |
Message
| Yes, down arrow will clear the check box, if you don't check "arrow keys wrap history", i think... |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Zotiel
(14 posts) Bio
|
Date
| Reply #7 on Mon 13 Oct 2003 08:37 AM (UTC) |
Message
| Go to Configuration -> Commands -> Keyboard preferences and uncheck "Confirm before replacing typing".
GAH & GRR
I checked all the way up to the commands part...too many boxes too many buttons...I over looked it at first , but got it now thanks to you.
------------------
As fer the triggers, yeah, seemed to be trailing spaces...adding the * at the end worked. just STRANGE...the lines I had with numbers also just happened to be the ones with trailing spaces....got two others I tried to work as well.
Thanks!
-Zot | 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.
20,909 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top