|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Thu Jan 09, 2003 5:23 pm
A trig that check a line before the trigger line? |
Hi all,
I was wondering if it is possible, to make a trigger that check for the line above it? And if that line isn't there, to perform a certain action.
I have a certain spell that will show off the line,
The sands drip through to the bottom of your hourglass.
at every mud tick. Now, if a mob is poison, a message will show right above the tick message
Name suffers from the poison in his veins.
with no linebreak.
I want it so, that zMUD do nothing, until it doesn't see that poison message, then it will stand and cast a poison spell.
Is that possible? |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Thu Jan 09, 2003 6:00 pm |
You might look into %line, %line2 and %line3 which return the last line received from the MUD, the line before that, and the line before that, respectively.
- Charbal |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 09, 2003 6:07 pm |
#TRIG {(%w)$The sands drip through to the bottom of your hourglass} {#IF (%1 <> "veins") {stand;cast poison}}
LightBulb
Senior Member |
|
|
|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Thu Jan 09, 2003 6:13 pm |
Is there a helpfile somewhere that show how to use those things?
|
|
|
|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Thu Jan 09, 2003 6:21 pm |
Thanks Lighbuld, but umm, it doesn't seem to work, since the field just contain (IF
|
|
|
|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Thu Jan 09, 2003 6:24 pm |
oh, and also, the trigger you got, make it so that I cast poison everytime I see him suffering from poisons, how would I do it so that only the times I don't see it?
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 09, 2003 6:33 pm |
1. Variables, predefined from the helpfile index.
2. Corrected trigger typo (added } at the end).
3. <> is the opposite of =, so I actually have you NOT casting poison every time you see him suffering from it. However, I assumed (probably incorrectly) that you'd have some other non-blank line immediately before the mudtick. If there's usually a blank line (when nobody is poisoned) use
#TR {^$The sands drip through to the bottom} {stand;cast poison}
You'll probably need to provide a target for your spell (variables are good for this) and I'd recommend placing these triggers in a CLASS which can be disabled when you aren't trying to keep a mob poisoned.
LightBulb
Senior Member |
|
|
|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Thu Jan 09, 2003 6:50 pm |
I'm guessing that it doesn't work because I have another trigger, to input 'chalice' whenver it see "The sands drip through the bottom of your hourglass".
But there must be away to use both triggers at the same time, or sometime not if I don't want to have auto-poison on. So far with Lighbuld's trigs, it keep casting it everytime I see "The sands drip through to the bottom of your hourglass".
Here is what it look like if the person is poison...
Name suffers from the poison in his veins.
The sands drip through to the bottom of your hourglass. |
|
|
|
AzCowboy Adept
Joined: 09 Nov 2000 Posts: 222 Location: USA
|
Posted: Thu Jan 09, 2003 9:54 pm |
Ok, this is getting too complicated... how about a two-trigger solution that works....
#TR {Name suffers from the poison in his veins.} {#var poisoned 1}
#TR {The sands drip through to the bottom of your hourglass.} {#if (@poisoned) {} {stand;cast poison;#var poison 0} }
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 09, 2003 10:31 pm |
Please post your triggers that involve sand dripping. Use cut-and-paste to avoid typos.
It's impossible to troubleshoot without seeing the actual script that's giving you
trouble.
LightBulb
Senior Member |
|
|
|
PHLN Adept
Joined: 30 Dec 2001 Posts: 220 Location: Canada
|
Posted: Fri Jan 10, 2003 1:47 am |
hehe, this sound stupid, but err, how do I cut and paste triggers stuff? Like how you guys have it?
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Jan 10, 2003 1:48 am |
Forgive my brain power, been mudding 12 hours straight heh and shouldn't be!
Try a kludge like:
#VAR DoPoison {0} {1}
#VAR ToPoison {Thomas Johnson} {}
#VAR RePoisonThings {Thomas Johnson|Richard the Innkeeper}
#VAR IsPoisonned {0} {1}
#TRIGGER {^({@RePoisonThings}) suffers from the poison in {his|her|its} veins.} {#COLOR 71;#VARIABLE IsPoisonned 1;#VARIABLE ToPoison {%1}}
#TRIGGER {^The sands drip} {#NOOP Add this to your existing trigger for the chalice;#COLOR 30;#IF (!@IsPoisonned AND @DoPoison) {stand;#ECHO cast poison @ToPoison;rest;meditate};#VARIABLE IsPoisonned 0}
#BUTTON 22 {Poison @DoPoison} {#IF (@DoPoison) {#VARIABLE DoPoison 0} {#VARIABLE DoPoison 1}} {} {} {} {} {} {} {} {} {} {} {} {110} {} {} {} "" {} {} {KeepPoisonning}
Has to be a cleaner way but not from me at this time! |
|
|
|
AzCowboy Adept
Joined: 09 Nov 2000 Posts: 222 Location: USA
|
Posted: Fri Jan 10, 2003 5:08 pm |
quote:
hehe, this sound stupid, but err, how do I cut and paste triggers stuff? Like how you guys have it?
You mean to put them here in the forum? Or the other way, to get them into your zMud?
To show them in the forum, you'd have to export your settings to a text file, then copy out the lines you want, and paste them into the forum. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 10, 2003 5:53 pm |
Go to the Settings Editor, select the trigger you want to cut-and-paste. In the
editing panel, select the text in the Phrase box. Right-click and select Copy. Switch
windows to the forum, type Pattern: , right-click and select Paste. Go back to the
Settings Editor and select the text in the Value box. Right-click and select Copy.
Return to the forum, Type Value: , right-click and Paste. Don't worry about
highlighting, colors, formatting or anything like that. Those are just bells and
whistles, it's the actual text that matters. A lot of people use the forum's code tags to
make things look nice, but that just screws up word-wrapping and makes it difficult to
cut-and-paste back to zMUD. It would be better if they didn't.
LightBulb
Senior Member |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 10, 2003 5:56 pm |
And to post them in the format that most people use in the forum without having to export it, just create a new class folder, select the settings you want to post and move them to the new class folder. Click on the class folder and then switch to the Class Script tab. Copy everything between the "#CLASS classname" and "#CLASS 0" lines and paste it here.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 10, 2003 7:28 pm |
As long as we've strayed onto this topic, Kjata, how do you get your scripts to look
like they were done with Pretty Printing? I mean, BOLD commands, blue
underlined variables, etc? I've been manually inserting forum codes for
quite a long time, but always wondered if there was an easier way.
LightBulb
Senior Member |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 10, 2003 9:59 pm |
Heh, I wish there was. I do the same thing. I post the whole script and go back command by command, function by function, variable by variable, inserting the forum codes.
Kjata |
|
|
|
|
|