Need help with a simple trig.

Posted by Ljuvlig on Fri 11 Dec 2009 08:13 PM — 4 posts, 16,879 views.

#0
Hello.
I'm new to MUSHClient, so please bear with me. I just want a simple auto-login trigger.

Here is the XML of the trig:

<triggers>
<trigger
enabled="y"
group="Multi Line"
lines_to_match="1"
keep_evaluating="y"
match="Do you wish to use ANSI colors? (Y/n): "
regexp="y"
repeat="y"
send_to="2"
sequence="100"
>
<send>y
eesti
password
l
l
</send>
</trigger>
</triggers>


The line I am trying to fire off of is:

Do you wish to use ANSI colors? (Y/n):

Note that there is a space after the colon.

It won't fire; I don't know why. I'm used to zMUD, so it's pretty foreign to me. I look at the regular expression syntax documentation, and tried to tinker with it, but I couldn't get anything out of it. If you could be so kind, I'd love some help. Triggers are pretty crucial to my mudding experience.

I'm using version 4.43.

THanks a lot.

USA #1
Primarily, I think you don't want this trigger to be marked as a regular expression. Uncheck that box and I believe it will work. Triggers marked as non-regex will be matches verbatim for the most part, although any *'s in the match line will be matched up to a single word when it triggers, which you can access in the Send box using %1, %2, and so on. You also don't need it to repeat on the same line, although that won't prevent it from executing.

However, you also don't need to create an auto-login trigger at all. If you go to the Game -> Configure -> Connecting dialog, there's a big textbox there you can use for your on-connect events. You can stick your name and password into the top two boxes, and use %name% and %password% in the text area to have them inserted in. So for you, you'd put something like this:


y
%name%
%password%
l
l


These commands will be sent immediately after connecting, so if there are any other commands you need to put in before the ANSI-colors query, be sure to add them.
Amended on Fri 11 Dec 2009 08:25 PM by Twisol
Australia Forum Administrator #2
Template:faq=11
Please read the MUSHclient FAQ - point 11.


Why not just put a script in the "on connect" event? That question shows up shortly afterwards anyway. Which is pretty much what Twisol said. :)
Amended on Sat 12 Dec 2009 12:04 AM by Nick Gammon
Australia Forum Administrator #3
The link on the FAQ shows some general techniques. The basic problem is that a "question" prompt will not end with a newline, and thus triggers won't activate. A small plugin (of which there are examples elsewhere) can detect "Do you wish to use ANSI colors? (Y/n):" and add a newline to it.