|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sun Apr 20, 2008 10:38 pm
help on another trigger using (%*) |
I have another zmud trigger that is not working in cmud. Can anybody help with this one.
Trigger pattern:
(%*)
Script:
#IF ({%param1} =~ {@MagicWork/MagicGag/CastingGag}) {
#GAGSPACE
#CAP Casting
} {xCasting %param1}
@MagicWork/MagicGag/CastingGag is a variable string list storing lines of text from the mud that I was to suppress
xCasting is a simple alias. I've removing the else statement with the xCasting command and it still does not work.
I saw that %%1 syntax was removed, I'm wondering if %* no longer works. |
|
_________________ Talahaski
dartmud.com 2525 |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Apr 20, 2008 10:55 pm |
Try changing the %param1 to %param(1). Not sure it'll work, but it's a start, considering that %param1 doesn't even exist, as far as I know.
Charneus |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sun Apr 20, 2008 11:15 pm |
nope.
I also tried %parms
tried changing trigger pattern to (*) and ^(*)$
also tried #IF (%line(0) =~ @MagicWork/MagicGag/CastingGag) {#GAGSPACE} |
|
_________________ Talahaski
dartmud.com 2525 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Apr 20, 2008 11:35 pm |
%line's not a function, it's a variable. You can use %1, %line, %param(1) - in this case, they all mean the same thing. But so far all the examples you've given don't actually mean anything. %params doesn't mean anything to a trigger, it's for aliases.
You're probably going to want this:
#IF (%line =~ %concat("{",@MagicWork/MagicGag/CastingGag,"}")) {#GAGSPACE}
Because the =~ operator expects a valid pattern to match against. The stringlist needs to have the braces {} around it in the pattern for it to be a proper pattern.
I assume, by the way, that you're not going to have this trigger on all the time. If you did, you'd be spamming xCasting all the time and slowed down by this trigger firing on every line. |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sun Apr 20, 2008 11:49 pm |
Awsome Fang. That worked perfect.
and you correct in that this trigger will only be enabled for a limited time. |
|
_________________ Talahaski
dartmud.com 2525 |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sun Apr 20, 2008 11:55 pm |
Would it be better to create 2 seperate triggers
one matching on @MagicWork/MagicGag/CastingGag
and a second one matching anying NOT in @MagicWork/MagicGag/CastingGag
I'm not sure how to create the second one though. |
|
_________________ Talahaski
dartmud.com 2525 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Apr 20, 2008 11:58 pm |
I was actually pondering that myself, and in this case I expect it wouldn't - it'd be harder to maintain, I think. But you could do it, and the way how is by having a trigger with the pattern {@MagicWork/MagicGag/CastingGag} that runs your code for when that stuff happens. This trigger has the Stop Further Processing option enabled. Your second trigger (with a larger priority number than the first one, so that it fires second) has a pattern that's simply * and runs your code for when it's not part of the variable. That way, if it's part of the variable, your first trigger goes off, runs its code, and the stop further processing option stops the second trigger from firing. If it's not in the variable, the first trigger never fires and the second one catches it.
|
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Mon Apr 21, 2008 12:18 am |
Stop Further Processing would not work, I have other triggers that may hit on the same line. I think I'll have to stick with this.
I have it running now testing it. Had to bump the priority way up to prevent it from messing up. Seems to be working well now though |
|
_________________ Talahaski
dartmud.com 2525 |
|
|
|
|
|