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
Caman
Newbie


Joined: 20 Mar 2009
Posts: 9

PostPosted: Wed Jul 10, 2013 10:16 pm   

Trigger Help, Pls
 
I am trying to figure out a Trigger that will record the " P " when it happens and wait for the next char and use it in conjunction with each other while directly posting anything else
my current script is this and it will post the " P " with everything instead of just the " L " and " R " sounds confusing when I say it but Hope someone can help me

#IF (%2=p || l || r) {#IF (%2=p) {#abort} {p %2}} {%2}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon Jul 15, 2013 6:04 pm   
 
You will need to explain in greater detail, show us the text you want to trigger on, and the desired output.
_________________
Discord: Shalimarwildcat
Reply with quote
Caman
Newbie


Joined: 20 Mar 2009
Posts: 9

PostPosted: Tue Jul 16, 2013 4:03 am   
 
I am looking to Capture this when posted and it does vary on combinations

" COMBO! ( p l swe swe ) " when a combo happens I wish to capture whats in the Parenthesis
and use it as commands in order. The "P" is punch and the following Char is the " L " or " R " which is left or right so want it to post " p l or p r " but for all else I want to just post.
Example:
COMBO! ( p l swe swe )
p l
swe
swe

is what I want to happen with this example
Reply with quote
Caman
Newbie


Joined: 20 Mar 2009
Posts: 9

PostPosted: Tue Jul 16, 2013 4:41 am   
 
Pattern: COMBO! ~( (%w) (%w) (%w) (%w) ~)
#IF (%1=p || l || r) {#IF (%1=p) {#abort} {p %1}} {%1}
#IF (%2=p || l || r) {#IF (%2=p) {#abort} {p %2}} {%2}
#IF (%3=p || l || r) {#IF (%3=p) {#abort} {p %3}} {%3}
#IF (%4=p || l || r) {#IF (%4=p) {#abort} {p %4}} {%4}

is my trigger
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Jul 16, 2013 6:58 am   
 
are combos always just three moves?

if so... try something like

#VAR combos {p r|p l|swe|etc}

#TR {COMBO! ~( ({@combos}) ({@combos}) ({@combos}) ~)} {
#SEND {%1}
#SEND {%2}
#SEND {%3}
}
_________________
Discord: Shalimarwildcat
Reply with quote
Caman
Newbie


Joined: 20 Mar 2009
Posts: 9

PostPosted: Wed Jul 17, 2013 12:39 am   
 
The combos can be anywhere from 1 - 8 diff skills involved with 1-7 diff moves. My problem is the spacing between the p and L or R . notice the #IF in a #IF
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jul 17, 2013 1:41 pm   
 
what I would do is capture everything inside the parentheses (excluding the bounding spaces) into %1. I would then use %replace() to first change all spaces to | and then to change all instances of p|r or p|l back to p r or p l. After that, you can then use #forall to #send each command in order.
_________________
EDIT: I didn't like my old signature
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