|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Fri May 09, 2003 4:11 pm
Timer and Capture |
been trying to work a countdown timer into the status bar don't seem to work too well. Dont know why.....
Pattern:A surge of rejuvenating energy
Value: vitality1=0
#until (@vitality1=120) {
#WA 1000
#AD vitality1 1
}
Status Bar: @vitality1
Also a small yet annoying capture problem
Pattern: ^(%w) tells you,
Value: windows="tells"
#CAP tells
#T+ Capture
Pattern:(%d)h, (%d)m
#T- Capture
Class: Capture
Pattern:(*)
#CAP @windows |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri May 09, 2003 5:32 pm |
You should not use #WAIT, this will pause the MUD output until the trigger finishes. Use an alarm instead:
#TRIGGER {A surge of rejuvenating energy} {#VAR vitality1 0;#T+ vitcounter}
#ALARM "vitcounter" {*1} {#ADD vitality1 1;#IF (@vitality1 > 120) {#T- vitcounter}}
For the capture script, what is the problem with it?
Kjata |
|
|
|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Sat May 10, 2003 10:07 am |
oh yea the capture script captures the line twice so it come up double.....like
Guy Tells you Hello!
Guy Tells you Hello!
just a minor prob just wondering if it could be fixed. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat May 10, 2003 1:22 pm |
The problem is that the * trigger tries to fire as soon as it is enabled on the last line received. Change the trigger like this to have it check for that:
#TRIGGER {(*)} {#IF (!("%1" =~ "^%w tells you,")) {#CAP @windows}}
This will first check that whatever is matched by the trigger does not also match the other trigger that enabeld it. If it doesn't then it captures the line.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat May 10, 2003 3:21 pm |
A simpler solution is to simply remove the #CAPTURE command from the first trigger.
LightBulb
Advanced Member |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat May 10, 2003 11:55 pm |
I'm guessing that this is done to capture multi-line tells.
Kjata |
|
|
|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Sun May 11, 2003 4:10 pm |
yup its to capture multilines =)
btw the alarm thing seems too count until 1 so its only 0-1......wierd huh.....hmmm the vitcounter folder, does it need to have anything in there? the *1 maybe? I donno I just imported what you wrote done hehe |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun May 11, 2003 4:40 pm |
I also assumed this was being done to capture multi-line tells.
The #CAPTURE @windows command from the second trigger (the one in the Capture class) will capture both single- and multi-line tells. The #CAPTURE tells command in the first trigger (the one with the #T+ command) isn't needed.
The alarm counted from 0 to 121 when I tried it. I observed the actual variable using the command #STATUS @vitality1. There is no "vitcounter" folder. "vitcounter" is the ID of the alarm.
LightBulb
Advanced Member |
|
|
|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Mon May 12, 2003 2:51 am |
hmm the capture works great now. yet the alarm thing I still cant get to work lol I really dont get it, just imported the bugger and even tried manually......
is it suppose to create a new trigger? it creates the
*1
looks like this
Pattern: bla bla bla
Values:
#VAR vitality1 0
#T+ vitcounter
#ALARM "vitcounter" {*1}
#ADD vitality1 1
#IF (@vitality1 > 120) {#T- vitcounter}
*shrugs* whats wrong here =) its really simple I bet Im just missing it |
|
|
|
horks Apprentice
Joined: 20 Jul 2001 Posts: 127 Location: USA
|
Posted: Mon May 12, 2003 3:36 am |
Those last two lines (the #ADD and the #IF) should be part of the #ALARM (that's what the function of the #ALARM is, to fire off those two commands every second)
Father Horks
The only problem with computer security, is when you think it exists. |
|
|
|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Mon May 12, 2003 5:07 am |
yea I tried it like this
#VAR vitality1 0
#T+ vitcounter
#ALARM "vitcounter" {*1} {#ADD vitality1 1;#IF (@vitality1 > 120) {#T- vitcounter}}
gives me a syntax error....... |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon May 12, 2003 12:43 pm |
Delete what you have created, copy the two lines I provided, paste them into the zMUD command line and press Enter. That should create everything as needed, except that the alarm is initally enabled. Just disable it to have everything as normal.
Kjata |
|
|
|
darkfenix Wanderer
Joined: 02 Feb 2002 Posts: 58
|
Posted: Mon May 12, 2003 4:19 pm |
thanks I guess that worked.....on to a new problem see ya in the next thread thanks again!
|
|
|
|
|
|