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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Fri Mar 19, 2010 7:11 am   

Help with a new trigger VS 3.08 btw
 
you guys are awesome with this stuff and i'm not entirely sure how to do a conditional trigger.

This is the mud output.


A Vampire attempts to flee.
A Vampire leaves south.

I would like to set up a condition that when X attempts to flee and successfully leaves a direction that it enters X into #var fleetarget and then the direction in #var fleedirection

so that i can than alias for
charge X direction

Now I want this for a specific set of races and i can create multiple triggers for each race or is there a way to create a set of races to choose from? IE Drow, Lich, Vampire, Etc

Thanks in advance. Atm i just have a basic trig for each race, but i want this to autofill only when someone attempts to flee instead of the way i have it now which is when ever someone just leaves room.

Thanks agian
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Mar 19, 2010 10:35 am   
 
Don't even need to use variables, to be honest, unless you're using them for a specific purpose. I'll give you both ways, though.

To automate it from a trigger:
Code:
#REGEX {^An? (?:@racecheck) attempts to flee.} {}
#COND {^An? (?:(@racecheck)) leaves (\w+).} {charge %1 %2} "" "regex"


All you need to do is put the list of acceptable races into a variable called 'racecheck', and then you're set.

If you'd rather do it as an alias:
Code:
#REGEX (^An? (?:@racecheck) attempts to flee.} {}
#COND (^An? (?:(@racecheck)) leaves (\w+).} {Fleetarget=%1;fleedirection=%2} "" "regex"


Then make your alias as normal. Double check to make sure the conditional triggers are regex, though they should be with the above codes.

Charneus
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Fri Mar 19, 2010 4:44 pm   
 
Awesome thanks, i chose alias cuz i don't want to always chase as it may lead me into places i don't want to go, so i want the option to chase by hitting alias.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 19, 2010 7:13 pm   
 
I know you already know better, but to remind everyone yet again:

If you are using a beta version, post in the beta forums.
If you are using a public version, post in the general forums.

Even in simple situations that don't seem to be in a beta-feature area, bugfixes and additions can introduce changes to how this works. Ergo, someone using a public version might not be able to produce the results you're seeing or the solutions they give you might work differently.
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Mar 20, 2010 4:31 pm   
 
Also, if you are really using v3.08, then you must upgrade to 3.14. Older Beta versions are not supported. Part of the Beta agreement is that you keep up-to-date with the latest beta version. If you don't want to update, then you should stick with the current Public version (2.37).
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Mar 20, 2010 4:36 pm   
 
Also, a note to forum helpers: Unless there is a compelling reason to use a Regular Expression, please answer trigger questions using the regular zScript trigger syntax. Especially when helping new players. This will become even more important when the new Trigger Pattern Wizard is released soon since it only supports the zScript syntax.

The purpose of the zScript pattern syntax is to make triggers and patterns easier for new players so that they are less intimidated by clients. Regular Expressions are notoriously intimidating to many people. Just using the term "Regular Expression" can scare people away.

The zScript version of the above suggestion would be:
Code:
#TRIGGER {^A? {@racecheck} attempts to flee.} {}
#COND {^A? ({@racecheck}) leaves (%w)} {charge %1 %2}
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 22, 2010 9:45 pm   
 
Thanks Zugg I'll update next time i log in, I hadn't used the program in awhile didn't even really think bout it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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