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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Tue Feb 28, 2006 8:55 am   

ALIAS WITH TEMP TRIGGER?
 
Hi,

I'm trying to make a alias which create a temporary trigger that attempts to match the next 20 lines?

How can I do this?

Confused
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Feb 28, 2006 1:39 pm   
 
put a counter in there?
in the trigger something like adding a 1 for each match and if it's 20 to disable itself?
_________________
http://www.Aardwolf.com
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Mar 01, 2006 6:27 am   
 
Syntax: #TR [id] pattern command [classname] [options]

option:
within match trigger within N lines


#ALIAS domatch {#TEMP domatchtemp {You get a temp match within 20 lines.} {#ECHO Got it} "" {within=20}}

Something like that?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Mar 01, 2006 11:10 pm   
 
The Within Lines option is designed for secondary states, I'm pretty sure. It may work for a single state trigger, but you've gotten the syntax wrong for the options. It would be {within|param=20}, if it's going to have a chance of working at all.

My advice is to avoid temporary triggers whenever possible. They often end up being stranded when they fail to find a match or else they simply don't fire when you want them to because of congestion in the system. Too many temporary triggers or alarms or nested functions can kill a system. Instead, just have a permanent trigger with an ID, so you can enable/disable it as needed and set it to disabled by default.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Mar 02, 2006 6:11 am   
 
Actually this is very easy using multistate triggers.
#Oninput is a #trigger that matches input instead of output.

#ONINPUT {^domatch} {}
#COND {Pattern to match} {What to do with matched pattern} {within|param=20}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Mar 02, 2006 12:27 pm   
 
#ONINPUT is useful when you're capturing a command that you want to pass through to the game, just so you can track that action and do other things relating to it. However, it's not the greatest thing to use as an alias because the gagging of text causes headaches and often gags the wrong line, in my own experiences. When I want an alias that sets off a trigger like this one, I use a multi-state with the first state being manually fired by the alias.

Code:
#ALIAS blah {#set blahtrig}
#TRIGGER "blahtrig" {} {} "" {manual}
#COND {Line you want to find.} {action to do} {within|param=20}


Again, it may or may not work this way, but that's what I'd try.
Reply with quote
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sat Mar 04, 2006 9:11 am   
 
Actually I want to create a automated spellfailure recast with this...

CI
#VAR CAST_SPELL %1
CAST '%1'
#TEMP FAILCAST {You lost your concentration.} {CAST '%1'} "" {within|param=1}

This works fine except it will only attempt to recast once.
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Sat Mar 04, 2006 6:14 pm   
 
Instead of using a #TEMP, have your cast alias enable a class you've created with two triggers in it. One catches the success message, and disables the class. The other catches the failure message and recasts. That will recast as many times as needed to get success, then stop.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
dazed-n-confused999
Wanderer


Joined: 03 Aug 2004
Posts: 79

PostPosted: Sat Mar 11, 2006 5:54 am   
 
this may be too simple for what you need, but I do this
ailias: levitate
value: cast levitate; @spell = levitate
trigger: You lost your concentration
value: cast @spell
its low tech, but i try to follow the KISS (keep it simple stupid) rule. Very Happy
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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