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


Joined: 10 Jun 2020
Posts: 5

PostPosted: Sat Jun 27, 2020 6:56 pm   

simple trigger help
 
Hi all. I'm trying to make a trigger that does something very simple. Whenever I see the text "X attacks you" (where X is any player name), I want to issue the command "insult X" Let's say James attacks me and I get the game text "James attacks you". I should issue the command "insult James"

I have tried this trigger:
%1 attacks you

insult %1

This does not seem to work. I have also tried with %w
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jun 27, 2020 7:16 pm   
 
(%w) attacks you

Is what you want, you need to wrap a portion of the pattern in parenthesis for the anonymous variables (%1-%99) to have any value.

#HELP #TRIGGER has a link to the various pattern matching wildcards like %w.
_________________
Discord: Shalimar#3679
Reply with quote
Love-
Newbie


Joined: 10 Jun 2020
Posts: 5

PostPosted: Sat Jun 27, 2020 10:31 pm   
 
Thanks shalimar! This works for me with (%1)
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jun 27, 2020 11:07 pm   
 
It might work in this sample, but it is improper syntax.
I would rather teach people the right way.
What you do is on you.
_________________
Discord: Shalimar#3679
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