Triggers

Posted by Zotiel on Sun 12 Oct 2003 01:40 PM — 8 posts, 29,186 views.

#0
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?
Russia #1
(\w+) gives you (\d+) gold
Greece #2
It's weird, "* gives you 5 gold." should work. Make sure you haven't checked "regular expression" perhaps?
#3
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*)



Amended on Sun 12 Oct 2003 05:11 PM by Zotiel
USA #4
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
Australia Forum Administrator #5
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".
Greece #6
Yes, down arrow will clear the check box, if you don't check "arrow keys wrap history", i think...
#7
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