 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Tue Sep 01, 2009 3:05 pm
TRIGGER: problem matching TRIGGER "" {...} {#TEMP {..} {....}} COND |
I'm trying to match the stuff between:
-------------------------------------
a
b
c
d
--------- blah blah --------
#CLASS {GetUsers}
#ALIAS Main {#T+ GrabStart;#SEND wizlist;}
#VAR Players {""}
#TRIGGER "GrabStart" {^[-]$} {#COLOR Red; #TEMP {[-]}{#STATE 0}} "" {disable}
#COND {^(.+)$} {#COLOR Yellow;#ADDITEM Players %1} {looplines|param=99|regex}
#CLASS 0
The --------- comes out Red
The a,b,c,d comes out Yellow
The --- blah blah --- comes out Yellow!
And then it stays Yellow.. forever (param=99) The COND is not being disabled
Any idea why?? |
|
|
|
 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Tue Sep 01, 2009 3:18 pm |
#CLASS GetUsers
#VAR Players ""
#REGEX "GrabStart" {^-+$} { #COLOR Red; #TEMP {^-+\s+\w+}{#STATE 0} "" {regex} } "" {disable}
#COND {^(.+)$} {#COLOR Yellow;#ADDITEM Players %1} {looplines|param=99|regex}
#ALIAS Main {
#T+ GrabStart;
#SEND wizlist;
}
#CLASS 0
(Can I do something like this instead? Use REGEX/COND AND a #TEMP regex.) |
|
|
|
 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Tue Sep 01, 2009 3:42 pm |
It says in the documentation:
#SEND hello there
Sends the text "hello there" to the MUD just as if you had typed it
[ You have to quote "hello there". Grr! I'm finding this program to be ridiculously frustrating to use! Could you please fix that in your documentation! ] |
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Sep 01, 2009 9:35 pm |
Because you asked so nicely I've updated the on-line documentation.
Since you are new to the forums (and from your last comment) new to zMUD, I would strongly recommend you use CMUD instead; it is the next generation MUD client from Zuggsoft.
[Edit] I will try to post a response to your original query later this evening. |
|
_________________ Asati di tempari! |
|
|
 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Wed Sep 02, 2009 4:20 am |
I installed CMUD: How do I load/paste my 10-100 line zScript stored in a file into CMUD? I don't want to use the crappy interface that you've provided for creating Triggers and Classes and stuff - it's too slow, and I have to constantly move the mouse all over and clicky clicky all over, and painfully recreate every variable from scratch - do I have to add every single variable via mouse-clicks?? Is there some way to paste the script (CLASSES, TRIGGERS, and ALL) directly into CMUD - the GUI expects an XML file, but my script is in zScript/(REGEX Perl) so.. what do I do?? I could just paste whatever script into zMUD.. I'd create a CLASS first and just cut and paste the contents of the CLASS directly into it.
|
|
|
|
 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Wed Sep 02, 2009 4:24 am |
do you have some kind of zScript to XML converter that I could run??
|
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Sep 02, 2009 1:58 pm |
Ok.. the reason the first one doesn't work is because you're telling zMUD to match everything in the next 99 lines "{^(.+)$}" is the regex equivalent of saying match each and every line. So you're turning it on, but not turning it off.
The reason you're second one doesn't work is because you're using the #STATE in the temporary trigger. If you don't specify the trigger ID you want to reset then zMUD assumes that you want to reset the current trigger. Since the temporary trigger running at the time it essentially has no effect.
The way I typically do it is like this.
| Code: |
#CLASS {GetUsers}
#ALIAS Main {
#T+ GrabStart
#SEND wizlist
}
#VAR Players {a|b|c|d}
#REGEX "GrabStart" {^-+$} {
#COLOR Red
#T+ WizListCapture
}
#COND {^-+.*} {
#T- WizListCapture
#color red
#state 0
} {regex}
#REGEX "WizListCapture" {^(\a.*)} {
#COLOR Yellow
#ADDITEM Players %1
} "" {disable}
#CLASS 0 |
I use one multi-state trigger to turn on/off the main the capture trigger. |
|
_________________ Asati di tempari! |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Sep 02, 2009 2:00 pm |
I'm not sure what you mean by a zScript to XML converter. Can you explain?
|
|
_________________ Asati di tempari! |
|
|
 |
paleywiener Newbie
Joined: 01 Sep 2009 Posts: 7
|
Posted: Wed Sep 02, 2009 3:48 pm |
Thanks, it ALL solved now. I wanted to know if there was a easy way to write a script in vi and then IMPORT it into CMUD. Right now, what I do is paste a CLASS into the CMUD cmd line.. which is okay I guess. I'll play with this some more.. maybe it'll take a whole script.
|
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Sep 02, 2009 7:42 pm |
CMUD will automatically convert your zMUD sessions the first time your run. You can also manually import you zMUD sessions by going to File -> Import from zMUD on the sessions menu.
|
|
_________________ Asati di tempari! |
|
|
 |
|
|
|