 |
ToyMage Apprentice
Joined: 01 Sep 2005 Posts: 120
|
Posted: 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 |
|
|
 |
Vitae Enchanter

Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: 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? |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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? |
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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. |
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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} |
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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. |
|
|
 |
ToyMage Apprentice
Joined: 01 Sep 2005 Posts: 120
|
Posted: 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. |
|
|
 |
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: 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! |
|
|
 |
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: 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.  |
|
|
 |
|
|