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
raymondvinzant
Beginner


Joined: 05 Dec 2001
Posts: 10

PostPosted: Mon Mar 21, 2011 7:32 pm   

hunt trigger
 
This is what I received from the command line.

You are certain that the dirty harpy is east from here.

So I tried to make a trigger.

#trigger {^You are certain that (%w) (%w) (%w) is (%w) from here.}{%4; hunt %3} Hunt

Which doesn't work. part of the problem is the mud returns (the, a, and an) right after that depending on what type of creature it is. In addition, sometimes it is a one word mud and sometimes 2 as in this chase it is a dirty harpy. How do I rewrite this trigger so it automatically hunts the mob, but still allows me to toggle it on and off, so if I hit an aggro mob, I can focus on fighting.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 21, 2011 8:22 pm   
 
First thing, you don't have to put parentheses around parts that you don't need. Second, you should not use %2 as a command. Use #SEND to send the command to the mud instead.

Assuming that the target is always the last word before "is", the simplest pattern would be:
#trigger {^You are certain that * (%w) is (%w) from here.}{#SEND %2; hunt %1} Hunt

If that does not work, you'll have to give some examples of cases where it doesn't work.
Reply with quote
raymondvinzant
Beginner


Joined: 05 Dec 2001
Posts: 10

PostPosted: Mon Mar 21, 2011 8:25 pm   
 
It tells me that there is an error in parsing, I copied it and pasted it directly into the command line.
Reply with quote
raymondvinzant
Beginner


Joined: 05 Dec 2001
Posts: 10

PostPosted: Mon Mar 21, 2011 8:26 pm   
 
It says illegal token {#send %2
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Mar 21, 2011 8:29 pm   
 
that's not where the problem actually is. The problem is the lack of space between the closing and opening curly braces that separate the pattern from the executed code.
_________________
EDIT: I didn't like my old signature
Reply with quote
raymondvinzant
Beginner


Joined: 05 Dec 2001
Posts: 10

PostPosted: Mon Mar 21, 2011 8:32 pm   
 
removed them still same message, error in parsing : illegal token {#send %2
Reply with quote
DraxDrax
Apprentice


Joined: 22 Mar 2009
Posts: 149

PostPosted: Mon Mar 21, 2011 9:09 pm   
 
Try:

#TRIGGER {^You are certain that * (%w) is (%w) from here.} {#SEND %2;hunt %1} Hunt
Reply with quote
raymondvinzant
Beginner


Joined: 05 Dec 2001
Posts: 10

PostPosted: Mon Mar 21, 2011 9:15 pm   
 
That worked
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