Thread: [TF] Triggers
Brought to you by:
kenkeys
From: sage at ieee.o. (T. Smith) - 2003-11-11 22:59:17
|
I have this: /def -p1 /mregexp -t'^HP: ' xa = xa but I want to change it to trigger on something similar to HP: [100/300], .... and take the 100/300 values and put them into vars for me to use in logic later. I've been playing with this for a while, but I haven't figure it out yet, someone mind pointing me in the right direction? Thanks, -- ~ Travis Smith sage at ieee dot org |
From: mikeride at localnet.c. (M. G. Schabert) - 2003-11-12 04:09:48
|
>I have this: > >/def -p1 /mregexp -t'^HP: ' xa = xa > >but I want to change it to trigger on something similar to > >HP: [100/300], .... > >and take the 100/300 values and put them into vars for me to use in >logic later. I've been playing with this for a while, but I haven't >figure it out yet, someone mind pointing me in the right direction? Hi Travis, How's this: /def -p1 -mregexp -t'^HP: \[([0-9]+)/([0-9]+)\]' HP_counts = \ /set current_HP=%P1 %; /set max_HP=%P2 Hope this helps, Mike -- Bikers don't *DO* taglines. |
From: geeklab at gmail.c. (Geeklab) - 2004-10-04 15:51:14
|
I'm trying to do a very simple trigger, and thought I was using syntax similar to an example from the documentation for 5.0Beta. Trying to do spell triggers: /def -wdsd -t"{*} says 'armor'" tarmor = cast armor %1 My intent was to have it work only for the session of my cleric, and would cast armor on an individual that says armor. Currently it does nothing, but I'm not sure why.... TIA, jdk PS - Does anyone have any links to newer tutorials or example tfrc files. I've found quite a few, but they all seem to be for VERY old versions. |
From: mikeride at localnet.c. (M. G. Schabert) - 2004-10-05 20:15:47
|
>I'm trying to do a very simple trigger, and thought I was using syntax >similar to an example from the documentation for 5.0Beta. Trying to >do spell triggers: > >/def -wdsd -t"{*} says 'armor'" tarmor = cast armor %1 > >My intent was to have it work only for the session of my cleric, and >would cast armor on an individual that says armor. Currently it does >nothing, but I'm not sure why.... It seems to test okay here (that particular trig is illegal on my MUD). There are 2 things that may be restricting it on first glance. 1) It is written in glob syntax...make sure that's how it's being interpreted. To do this, after it loas in, type "/list tarmor" & see what the -m part is. If you specified default matching to be regexp, then it wouldn't work. 2) Is the world you're connected to "dsd"? Try taking out the -w part altogether. Finally, a great feature in tf5 is "trigger -n" (and -l). Hope this helps, Mike -- Bikers don't *DO* taglines. |
From: geeklab at gmail.c. (Geeklab) - 2004-10-07 02:54:30
|
On Tue, 5 Oct 2004 16:15:47 -0400, Michael G. Schabert <mik...@lo...> wrote: > >/def -wdsd -t"{*} says 'armor'" tarmor = cast armor %1 > > > >My intent was to have it work only for the session of my cleric, and > >would cast armor on an individual that says armor. Currently it does > >nothing, but I'm not sure why.... > > It seems to test okay here (that particular trig is illegal on my > MUD). There are 2 things that may be restricting it on first glance. > > 1) It is written in glob syntax...make sure that's how it's being > interpreted. To do this, after it loas in, type "/list tarmor" & see > what the -m part is. If you specified default matching to be regexp, > then it wouldn't work. The dangers of "borrowed" code.. This was actually my problem. Since this whole thing was new to me, I had pieced together a .tfrc file from things I found lying around on the web. Early in the file I found where matching was being set to regexp. Once I switched to glob, it worked fine. > Finally, a great feature in tf5 is "trigger -n" (and -l). > I saw stuff on trigger and alias, but gathered from the documentation that for ver5 stuff, /def was the prefered method of handling these things, so wanted to learn it that way from the start. Is that not the case? Thanks! jdk |
From: mikeride at localnet.c. (M. G. Schabert) - 2004-10-08 14:51:12
|
> > 1) It is written in glob syntax...make sure that's how it's being >> interpreted. To do this, after it loas in, type "/list tarmor" & see >> what the -m part is. If you specified default matching to be regexp, >> then it wouldn't work. > >The dangers of "borrowed" code.. This was actually my problem. Since >this whole thing was new to me, I had pieced together a .tfrc file >from things I found lying around on the web. Early in the file I >found where matching was being set to regexp. Once I switched to >glob, it worked fine. Cool, glad to hear it :) > > Finally, a great feature in tf5 is "trigger -n" (and -l). >> > >I saw stuff on trigger and alias, but gathered from the documentation >that for ver5 stuff, /def was the prefered method of handling these >things, so wanted to learn it that way from the start. Is that not >the case? /def is preferred over /trig, yes...but /trigger is a testing command, not a defining command. If you did, for instance: /trigger -n foo says 'armor' then tf would tell you that that line would match the tarmor trigger. Using /trigger <text> will actually perform the trigger. Using -n just gives the shortname of the triggers that would have matched (without doing anything) and -l gives the full /def line (again without doing anything). Hope this helps, Mike -- Bikers don't *DO* taglines. |