"Send to" just tells MUSHclient what you want to do with the Send box. If it were set to "Variable", the contents of the Send box would be put in a variable. ;) You want Send to Script, using %1 in it for the capture.
OOPS. I just edited my original post instead of quoting it! XD Luckily I could go back in my history and fish out the original... anyways, my response is below.
^You are level \d+ \([^)]+\) and (\d+(?:\.\d+)?)% of the way to the next level\.$
You can add parentheses around a piece of the expression to capture it. I bolded/underlined the changed part.
Amended on Mon 16 May 2011 10:52 AM (UTC) by Twisol
Message
Kaimarae said:
^You are level * and *% of the way to the next level.$
Any idea what I'm doing wrong? (Regular Expression is checked)
Yeah, it's the mixture of basic patterns and regular expressions again. * alone is a basic pattern symbol for a match. In a regular expression it means something totally different ("zero or more of the character before this one").
^You are level \d+ \([^)]+\) and \d+(?:\.\d+)?% of the way to the next level\.$
Internally the basic-pattern * is converted to (.*?), but that's not always (read: rarely) optimal, so I took the liberty of making it match more exactly. \d means "a digit", and the + after it means "one or more". The bit after that matches anything in parentheses that isn't an end parenthesis, and then I match the experience (making the fractional part optional). I also escaped the .'s because . means "any character" in regexp.
You might want to check out a tutorial on regular expressions. They're pretty easy to understand once you've learned a bit of the syntax.
http://www.regular-expressions.info/tutorial.html
[EDIT]: Also, congratulations on levelling up since you started the thread. ;)
Amended on Mon 16 May 2011 10:36 AM (UTC) by Kaimarae
Message
I think I've narrowed it down. Everything is working hunkey-dorey... EXCEPT the experience catching line isn't triggering (according to trace). Disabled trigger "*" to see if it was overriding, it isn't. Which meeeans my trigger is probably wrong. This is the line:
You are level 25 (Significant) and 34.46% of the way to the next level.
I'm trying to match with this:
^You are level * and *% of the way to the next level.$
I have also tried with:
^You are level * \(*\) and *\% of the way to the next level\.$
Any idea what I'm doing wrong? (Regular Expression is checked)
EDIT: Jeeeesus. Just copy/pasted the line exactly and it still isn't matching. :|
Trigger #2 wasn't being enabled (duhhh... God) and it was trying to update CurrentEXP with "%3"... notice there are only two wildcards in my match line... Haha, fixed that, but it's still not happening... Hrm.
Well, one's enabled by default and the other isn't. I think both should likely be disabled by default, and make sure you're enabling them both when the start trigger fires.
I went looking and found SendNoEcho myself actually. But the changing the end-trigger to the prompt I didn't think of. That works beautifully now.
This is what I tried:
Grab exp:
<triggers>
<trigger
group="Prompting"
keep_evaluating="y"
match="^You are level * and *% of the way to the next level\."
name="EXPgrab2"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="99"
>
<send>SetVariable("CurrentEXP", "%3")</send>
</trigger>
</triggers>
Kaimarae said: How do I set the priority? I thought it was Sequence... But that was mistaken. I think. Didn't work anyway.
A lower sequence actually means a higher priority, so a trigger with sequence 99 will always be processed before a trigger with sequence 100. Can you paste what you tried?
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
Kaimarae said: Is it possible to hide the echo
Yes, use SendNoEcho(). (This doesn't apply if it's the MUD that's sending the echo.)
Kaimarae said: and therefore the extra line of prompt?
Do you mean the prompt that comes after the SCORE output? If you change your "end" trigger to the prompt instead of the final line of the SCORE, you'll gag the prompt as well.
How do I set the priority? I thought it was Sequence... But that was mistaken. I think. Didn't work anyway.
It's all triggering and enabling/disabling just fine, but because I still want to check score, I made a trigger on "You have slain *" which enables the start trigger and does Send("SCORE"). Is it possible to hide the echo and therefore the extra line of prompt? Is a minor quibble.
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.