 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Tue Jun 04, 2002 9:11 pm
'notrig' option on #TEMP trigger? |
How to set notrig option on temporary trigger?
Below is code of _alias_ colled foo
----
#TEMP {*} {
#IF (%left(%line,5)=" ") {
#CAPTURE %1
foo %1
}
} "Dune|Infos" {notrig}
----
In this way 'foo %1' creates temp. trigger which is executed imidiatelly and zMud is 'trigger looped' :(
Best rgds, Waldek |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jun 04, 2002 9:49 pm |
You have a recursive alias. The alias is named "foo", and one of the commands is "foo %1". This is going to loop. Find another way to do this.
#AL foo {#C+ %1;#T+ cap}
#CLASS cap
#TR {^%x} {#C-;#T- cap}
#CLASSS 0
LightBulb
Vague questions get vague answers  |
|
|
|
 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Tue Jun 04, 2002 10:47 pm |
I know this is recursive and make it specially. Problem won't appear if I could set option notrig on #TEMP defined in alias foo.
I wish to get effect of executing something for next line (in current state calling foo %1 makes imidiately execution of trigger for current line (%line).
Rgds,
Waldek |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jun 05, 2002 4:29 am |
I tested your #TEMP trigger, and it does set the "notrig" option.
The "notrig" flag controls the "Trigger on Trigger" option in the editor. The default for this option is enabled, the "Trigger on Trigger" box is checked. "notrig" disables it, the box is unchecked. You can test it yourself by disabling triggers before you use the alias. With triggers disabled, your #TEMP won't fire, so it won't delete itself, so you can easily verify that "notrig" unchecked the box.
As I said, you'll have to find another way to do this.
LightBulb
Vague questions get vague answers  |
|
|
|
 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Wed Jun 05, 2002 9:17 am |
I know - I've put syntax for normal trigger in code when using temp trigger. What I need is to have temporary trigger with flag notrig. I can make such a trigger manualy (in editor window), but can't make it using normal #TEMP command b/s this command doesn't have the same syntax as #TRIGGER (it haven't class and option parameters)!!
--
Waldek
There are no mistakes, just learning experience |
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jun 05, 2002 1:52 pm |
You need to do this some different way. You can always replace a temp trigger with a permanent trigger that you turn on/off as you need. Also, there should never be a reason to create a recursive alias - there is always another way of doing what you need. Perhaps if you explained a bit better what it is exactly that you want to do, we might be able to help you come up with some alternate methods of doing it.
Kjata |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Jun 05, 2002 2:21 pm |
To set notrig option on temporary trigger:
#TEMP {trigger phrase} {trigger action} {class} {notrig}
Apparently you ignored the first line of my last post, where I said I tested this syntax and it does work. And you also seem to have ignored the next paragraph where I explained how you could test it for yourself. But the answer is YES, it does work, and NO it doesn't solve your problem. The problem is NOT trigger-on-trigger. The problem is a looping alias.
Try the solution I suggested in my first post.
LightBulb
Vague questions get vague answers  |
|
|
|
 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Wed Jun 05, 2002 2:43 pm |
I'm sorry LightBulb - you're right and notrig option is setted on #TEMP trigger. I'will try to describe problem.
I wish to capture all messages that comes on i.e. pol channel. But when message on channel is long it is divided on smaller text and appears in few lines, where each line is ended with <NL> code and 2nd and rest lines have prefix of few spaces.
Mud output can be something like that:
[pol] Me: something something something something something something something<NL>
something something something something something<NL>
something something something something something, etc.
I can set trigger for first line, but there is problem for me for setting trigger for rest lines. I wish to be sure that if line begins with spaces it belongs to 'pol' channel message. For now I have something which catch 1st and 2nd line:
#ALIAS setNextLineGet {#TEMP {*} { #IF (%left(%line,5)=" ") { #CAPTURE %1}}} "Dune|Infos"
#TRIGGER {^~[pol~]} {#CW yellow;#CAPTURE harko;setNextLineGet harko} "Dune|Infos" {notrig}
But when I tried do add new call of setNextLineGet alias just after #CAPTURE %1 I get zMud 'deadlock'.
I do not wish to have permanent trigger for {*} or {<spaces>*} pattern - this is why I'm trying to do something like that.
Rgds,
--
Waldek
There are no mistakes, just learning experience |
|
|
|
 |
dacheeba Adept
Joined: 29 Oct 2001 Posts: 250
|
Posted: Wed Jun 05, 2002 4:46 pm |
You shouldnt need a temp trigger. Try this:
#ALIAS setNextLineGet {#IF (%left(%line,5)=" ") {#CAPTURE harko;setNextLineGet}} "Dune|Infos"
#CAPTURE with no numerical argument(or an argument of 1) will always capture the same thing in %line, the last line sent from the mud. The way you had it set up, it would have made the pattern of the temp trigger the name of a new window anyways.
It IS a recursive alias, however, once the if statement reads false, it will stop. |
|
|
|
 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Wed Jun 05, 2002 5:01 pm |
Alias setNextLineGet is used not only for 'harko' window, but is parametrized to be able to use this alias to catch messages from other channels like 'chat', 'servint', etc - and each channels has its own window.
And #TEMP {*} in alias is needed b/s I want parsing next line (%line(-1)) - not current. Current line is parsed in trigger.
The solve of this problem could be (not tested yet):
#VARIABLE lastChannel ""
#TRIGGER infoTrigger {*} {
#IF (%left(%line,5)=" ") {#CAPTURE @lastChannel} {#T- infoTrigger}
} {"Dune|Infos"} {notrig}
#TRIGGER {^~[(%w)~]} {
#CW yellow
#VARIABLE lastChannel %1
#CAPTURE %1
#T+ infoTrigger
} {"Dune|Infos"} {notrig}
Thanks for all answers,
--
Waldek
There are no mistakes, just learning experience |
|
|
|
 |
wth Novice
Joined: 14 Nov 2001 Posts: 37 Location: Poland
|
Posted: Wed Jun 05, 2002 5:42 pm |
Ok - final and tested version of triggers which I need:
#VAR firstLine {0} {0} "Dune|Infos"
#VAR lastChannel {tells} {} "Dune|Infos"
#TRIGGER "infoTrigger" {*} {#IF (%left(%line,5)=" " | @firstLine=1) {#CAPTURE @lastChannel;#VARIABLE firstLine 0} { #T- infoTrigger}} "Dune|Infos" {notrig}
#TRIGGER {^~[pol~]} {#CW yellow;#VARIABLE lastChannel "harko";#VARIABLE firstLine 1;#T+ infoTrigger} "Dune|Infos"
--
Waldek
There are no mistakes, just learning experience |
|
|
|
 |
|
|
|