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


Joined: 20 Jun 2010
Posts: 3
Location: NY

PostPosted: Sun Jun 20, 2010 6:36 pm   

100% newb and need trigger help!
 
I play a warrior, and i really need to set up auto rescue triggers....but i have NO IDEA how to do it...so i need someone to explain it to me like i'm a first grader :p
Reply with quote
Tech
GURU


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

PostPosted: Sun Jun 20, 2010 6:41 pm   
 
We'll need some information from you.

How do you know someone needs rescuing, i.e. what text do you see? How do you respond?

A great place to start is by reading Introduction to Triggers. Then read Multistate triggers for more information.
_________________
Asati di tempari!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Sun Jun 20, 2010 6:44 pm   
 
Would my autorescue script be of help? You'd need to modify the damage messages to match your MUD...

Code:

#CLASS {autorescue}

#ALIAS superrescue {#IF (%ismember( %1 , @rescueppl)) {#3 rescue %1}}

#TRIGGER {(*) DECIMATES (%w)} {superrescue %2}

#TRIGGER {(%w) hard.} {superrescue %1}

#TRIGGER {(*) ANNIHILATES (%w)} {superrescue %2}

#TRIGGER {(*) OBLITERATES (%w)} {superrescue %2}

#TRIGGER {(*) LIQUIDATES (%w)} {superrescue %2}

#TRIGGER {(*) DOES AN INCREDIBLE AMOUNT OF DAMAGE TO (%w)} {superrescue %2}

#TRIGGER {(*) DEVASTATES (%w)} {superrescue %2}

#TRIGGER {(*) SLAUGHTERS (%w)} {superrescue %2}

#TRIGGER {(*) BEATS THE LIVING DAYLIGHTS OUT OF (%w)} {superrescue %2}

#TRIGGER {(*) FUBARS (%w)} {superrescue %2}

#TRIGGER {(*) DEMOLISHES (%w) with his unbelieveable hit!!} {superrescue %2}

#TRIGGER {(*) butchers (%w)} {superrescue %2}

#TRIGGER {(*) massacres (%w)} {superrescue %2}

#TRIGGER {(%w) extremely hard!} {superrescue %1}

#TRIGGER {(%w) very hard.} {superrescue %1}

#TRIGGER {(%w) assists (%w)} {superrescue %2} "" {disable}

#TRIGGER {~(TANK~)(%w) has quite a few wounds.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) has some big nasty wounds and scratches.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) has some small wounds and bruises.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) is in excellent condition.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) has a few scratches.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) looks pretty hurt.} {superrescue %1}

#TRIGGER {~(TANK~)(%w) is in awful condition.} {superrescue %1}

#CLASS 0

#CLASS {autorescue|blocks}

#TRIGGER {(%w)'s blade barrier blocks (*)} {superrescue %1}

#TRIGGER {(%w)'s Cyris luck makes (*) miss!} {superrescue %1}

#TRIGGER {(%w) blocks (*)} {superrescue %1}

#TRIGGER {(%w) parries (*)} {superrescue %1}

#TRIGGER {(%w) wind wall blocks (*)} {superrescue %1}

#TRIGGER {(%w) dodges (*)} {superrescue %1}

#TRIGGER {(%w)'s Sword blazes blue white as the power of Granduar protects him!} {superrescue %1}

#CLASS 0

#CLASS {autorescue|misses}

#TRIGGER {(%w) barely avoids} {superrescue %1}

#TRIGGER {practices shadow-boxing while (%w) takes a break.} {superrescue %1}

#TRIGGER {(%w) ducks under} {superrescue %1}

#CLASS 0

#ALIAS addresc {#ADDITEM rescueppl %1}

#ALIAS delresc {#DELITEM rescueppl %1}

#ALIAS rescon {#t+ autorescue}

#ALIAS rescoff {#t- autorescue}

_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Jespooky
Newbie


Joined: 20 Jun 2010
Posts: 3
Location: NY

PostPosted: Sun Jun 20, 2010 6:57 pm   
 
I see the text...

(mob) suddenly attacks (char name) or (mob) turns it focus on (char name)

then i would have to type

Rescue (char name)

is there a way to autorescue any person that is in your group?

i'm a pretty decent tank, lol but i just cant seem to rescue fast enough!!!! the other problem is when there are 2 aggro mobs in a room, and i'm on one, the other attacks the vulnerable person in the group and i dont see it, because of the screen spam. so i want to be able to auto rescue them.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Jun 20, 2010 7:13 pm   
 
Jespooky wrote:
I see the text...

(mob) suddenly attacks (char name) or (mob) turns it focus on (char name)

then i would have to type

Rescue (char name)

is there a way to autorescue any person that is in your group?

i'm a pretty decent tank, lol but i just cant seem to rescue fast enough!!!! the other problem is when there are 2 aggro mobs in a room, and i'm on one, the other attacks the vulnerable person in the group and i dont see it, because of the screen spam. so i want to be able to auto rescue them.


Let's look at it in parts really quick:

Jespooky wrote:

(mob) suddenly attacks (char name) or (mob) turns it focus on (char name)


This is known as the Pattern for the trigger, which, as far as the editor is concerned, is the one-line text box at the top after you create a new trigger. The pattern is what allows the trigger to fire. You can think of it as a If this happens, do this! where the pattern is the "If this happens".

So, in your case we know that a variable mob name will sometimes give one of two echoes concerning a variable ally name:
(mob) suddenly attacks (ally)
or
(mob) turns its focus on (ally)

Now, the cool thing about patterns in this case is that they don't have to start at the beginning. So, assuming that these lines are unique to the situation you want, we can cut out (mob).

So we have...
suddenly attacks (ally)
or
turns its focus on (ally)

CMUD has a way of allowing us to have optional lines in its pattern matching if we enclose them in {}

So we can turn that into:
{suddenly attacks|turns its focus on} (ally)

CMUD also has ways of identifying possible variables in a pattern. If your allies name cannot be more than one word, you can use: %w
So you have:
{suddenly attacks|turns its focus on} %w

However, this isn't enough, as, presumably, you need your ally's name to rescue them. If you surround something you want in () it tells CMUD to remember it in numerical order from where it is captured in the pattern, preceded by a % sign (%1, %2, %3, %n...)

So we have:
{suddenly attacks|turns its focus on} (%w)

Now that seems like a lot for a pattern, but once you get used to making triggers for yourself it actually becomes rather simply and straightforward and easy to remember. There's other neat tricks you can learn, all of which can be found in the CMUD manual. Anyways, now that we're done with the pattern...

Jespooky wrote:

Rescue (char name)


This is the "do this!" part of the phrase I mentioned earlier. It goes in the script box of the new trigger you've made. The script box comes right after the pattern one and is a large, multi-line text box. Of course, what you want it to do is simple enough so you only actually need one line. We're just going to make some basic alterations to what you have so that it's more efficient when processed. First we'll add:

#send "Rescue "(char name)

The #send command tells CMUD that it can send the text straight to the MUD as is, aka it's not an alias or anything. Which is just a bit faster than not using a #send command.

The second thing we need to do is allow you to work with the variable you captured in your pattern (%w). Now if you recall what I mentioned earlier, since (%w) is the first and only capture in your pattern, it can be accessed in the script box with %1. So:
#send "Rescue "%1

completes your trigger. Something like:

Chamenas suddenly attacks Tech

would fire your trigger and send "Rescue Tech" to the MUD. Voila.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Jun 21, 2010 12:41 am   
 
Nice introduction to triggers, Chamenas!
Reply with quote
Jespooky
Newbie


Joined: 20 Jun 2010
Posts: 3
Location: NY

PostPosted: Mon Jun 21, 2010 3:08 pm   
 
Thanks sooooo much ;)
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