Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Oct 11, 2009 12:00 am   

I need help with a trigger please
 
Pattern: ^[(\d{1,2})] Cmds: help, end, roll, add, rem>
Value: #IF (%1 < 54) {roll}


I cant get it to work, can someone please help me trouble shoot?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Oct 11, 2009 3:30 pm   
 
Happy too. I can venture a guess but you need to tell us exactly what text you are trying to match.

I'll assumed you want to match text like

Code:
[10] Cmds: help, end, roll, add, rem>


A trigger like this should do what you want.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="20" copy="yes">
    <pattern>^~[(%d)~] Cmds: help, end, roll, add, rem> </pattern>
    <value>#IF (%1 < 54) {roll} </value>
  </trigger>
</cmud>
_________________
Asati di tempari!
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 8:22 am   
 
Ok its saying trigger fired but did not compile
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 8:27 am   
 
I am trying to make a character roller for the Forsaken lands Mud



216.136.9.8 1848 [216.136.9.8] Port 1848
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sun Nov 08, 2009 3:33 pm   
 
sounds neat. i could write that trig if i understood more what your mud is sending as text.

i don't understand this trig ^[(\d{1,2})] can you paste the text from your mud?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 08, 2009 4:43 pm   
 
Josiah, it's a regex pattern match. It means match one or two digits.

One thing to note is if there are spaces between the opening bracket and a single digit.

Also, I noticed you posted in zMUD forum. Is this for zMUD or CMUD?

Either way, copy/paste this on the command line:

Code:
#REGEX {\[\s?(\d+)\] Cmds: help, end, roll, add, rem>} {#IF (%1<54) {roll}}


I'm pretty sure the > doesn't need a \, but if it doesn't work, add that in front of it.

Charneus
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 5:24 pm   
 
Rolling stats for human thief.:
Max: Str: 20 Int: 20 Wis: 20 Dex: 21 Con: 20
Cur: Str: 8 Int: 8 Wis: 8 Dex: 8 Con: 8
[39] Cmds: help, end, roll, add, rem>


The bottom left number I will want trigger to stop rolling when it hits [54]
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 5:25 pm   
 
Oh sorry this is for Cmud
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 08, 2009 5:32 pm   
 
Did you try my trigger at all? And Tech's trigger shouldn't have failed on you either. For Tech's trigger, you have to open up the package editor and paste there. For mine, you just copy/paste to the command line.

One thing to make note is that it appears the line doesn't end with a carriage return. If that is the case, you'll want to uncheck the "Trigger on newline" option and see if it works then.

Charneus
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 5:46 pm   
 
I just tried yours but didn't work I put

#REGEX {[\s?(\d+)] Cmds: help, end, roll, add, rem>} by where it says Pattern up top

and
{#IF (%1<54) {roll}} in the large box underneath it

On the bottom left it says pattern in the box and on bottom right I have regular expression checked
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 5:47 pm   
 
oh and box top right says Zscript
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 08, 2009 6:02 pm   
 
Like I said, just copy/paste it into the command line, the box under the main window that you type all your commands in. Don't need to open package editor except to uncheck the box "Trigger on newline."

You'll need to delete any prior triggers you used for this particular one.

Charneus
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 6:41 pm   
 
Ok I deleted any similar triggers.

so are you saying

#REGEX {[\s?(\d+)] Cmds: help, end, roll, add, rem>}
{#IF (%1<54) {roll}}

should all be under where it says pattern? Is that what you mean by command line?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 08, 2009 6:46 pm   
 
No. You know the box where you type all your commands, such as where you would type roll if you didn't have triggers? Or the box you use to chat with?

That is your command line. That is where you paste it and hit enter.

Charneus
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 6:53 pm   
 
I think I may have it working!!!!!!!!!
I will let you know how it goes, and THANK YOU!
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 7:01 pm   
 
I put cut and pasted the commands under the Pattern box, not in it and then I unchecked Trigger on new line like you said and also unchecked trigger on trigger and it still didn't work so i went under editor and clicked the lightning bolt to execute script and it started running.


Not sure what you mean by chat, never used Cmud to chat to my knowledge, but I assume its the big white box under pattern section.

ITs still running as I type this, will let you know when I get a successful roll :)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Nov 08, 2009 7:05 pm   
 
What I mean by command line is this:

Whenever you log in to your MUD, or send commands that you have to type to the MUD, you put them in a thin, long bar under your MUD window. If I had my computer, I'd do a screenshot.

That's the command line. By executing what you did, you actually created the trigger in a roundabout way. I bet you'll find the trigger in your package editor now. :p

Charneus
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 7:05 pm   
 
oh ok I may have done it wrong again.....hmmm
Reply with quote
Soagth
Beginner


Joined: 10 Oct 2009
Posts: 14

PostPosted: Sun Nov 08, 2009 7:08 pm   
 
yes I get what you mean by command line now, I did not know I could make a Trigger there at all.
I always clicked trigger on the top of the screen and then in the pattern box I put what would trigger the trigger like a spell falling and then underneath I would type in the words that would recast said spell. So I was trying to the same thing here.
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Mon Nov 09, 2009 3:42 am   I would do it like this.
 
<trigger priority="3690" id="369">
<pattern>Cur: Str: (%d)Int: (%d)Wis: (%d)Dex: (%d)Con: (%d)</pattern>
<value>#If (%1+%2+%3+%4+%5&lt;54) {roll}</value>
</trigger>


I assume that you want to roll if your stats equal less than 54 total?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Nov 09, 2009 3:46 am   
 
There's no need to when it gives the count there instead. Don't make things more complicated than they need be.

Charneus
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Mon Nov 09, 2009 5:35 pm   How about this one then?
 
<trigger priority="3680" id="368">
<pattern>^[(%d)] *</pattern>
<value>#If (%1<54) {roll}</value>
</trigger>
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net