|
SiberianPhoenix Newbie
Joined: 04 Dec 2003 Posts: 6 Location: USA
|
Posted: Tue Mar 23, 2004 1:35 pm
Trigger Help |
here's the deal; I'm on a mud that if I type in the command:
Read list the mud will display the following:
You still need to find the following:
An Evil Charm.
A Powerful bracer.
The Key to the City.
A yellow potion of Flight.
Those were example items.
I have a lot of the ways to get the different items via alias.
what I'd like is for the trig to detect the first line (You still need to find the following:) and then check the second line (In this case An Evil Charm.) and then if that second line is actually (An Evil Charm. (or whatever the item is)) I'd like it to fire off the alias (in this case the alis is AnEvilCharm) while ignoring the rest.
The thing about this is that I'd like it to check again the next time I type read list (once you use the item it's no longer on the list) and then detect the next item (In this case A Powerful Bracer.)
and fire off the alias for that item.
Example: (I'll put this in a format similar to if I were using it in the mud)
Read list
You still need to find the following:
An Evil Charm.
A Powerful bracer.
The Key to the City.
A yellow potion of Flight.
(here it fires off the alias AnEvilCharm)
(the alias goes about it's work and gathers me the evil charm)
read list
You still need to find the following:
A Powerful bracer.
The Key to the City.
A yellow potion of Flight.
(here it fires off the alias for The Powerful Bracer)
and so on....
Heh dang I didn't expect this to be so long rofl.
Any help would be GLADLY apprectiated.. also I'm only a starting scripter so explenations of WHY it works would be freaking excellent as I'm trying my hardest to learn this.
Thanks Much,
SiberianPhoenix |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Mar 23, 2004 4:14 pm |
#TR {^You still need to find the following:}
#COND {(*).} {#IF %len( %alias( %replace( "%1", " ", ""))) {%replace( "%1", " ", "")} {#SAY Find it yourself!}} {Within|Param=1}
This is a multistate trigger. It checks the line after "You still need to find the following:" to see if there is a matching alias (with spaces removed). If there is, then the length of that alias should be greater than 0.
If it finds an alias which matches the line (with spaces removed), it executes the alias. If not, it tells you to find the item yourself. |
|
|
|
SiberianPhoenix Newbie
Joined: 04 Dec 2003 Posts: 6 Location: USA
|
Posted: Fri Mar 26, 2004 7:58 am |
sorry, for some reason that didn't work. I copy and pasted it into it and tried it out but it didn't work nonetheless.
Anyone got an alternate way or and explanation of why it might not have worked?
Thanks in advance
Siberianphoenix |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Fri Mar 26, 2004 5:32 pm |
What version of zmud are you using? If its an earlier version, it might not support #cond multistate triggers.
|
|
|
|
SiberianPhoenix Newbie
Joined: 04 Dec 2003 Posts: 6 Location: USA
|
Posted: Mon Apr 12, 2004 9:55 am |
7.04 gonna upgrade to 7.05 tonight as I just realised there was anew version.
|
|
|
|
Morgoth Beginner
Joined: 07 Apr 2004 Posts: 12 Location: Israel
|
Posted: Mon Apr 12, 2004 1:40 pm |
Well, you could try this:
Pattern: You still need the following:$(*)$
Command: #If (%2="An Evil Charm") {AnEvilCharm};#If (%2="A Powerful bracer") {APowerfulBracer};....and so forth. Maybe that'll work. |
|
|
|
Morgoth Beginner
Joined: 07 Apr 2004 Posts: 12 Location: Israel
|
Posted: Mon Apr 12, 2004 3:37 pm |
My bad, thats %1 not %2 on those. Sorry.
|
|
|
|
Insomniac Wanderer
Joined: 25 Mar 2004 Posts: 78 Location: United Kingdom
|
Posted: Wed Apr 14, 2004 2:25 am |
The alias' will have to be named EXACTLY the same as the triggers minus the spaces.
Although I'm still learning myself, I believe that will include the period(s).
Hope this helps in some way? :)
-=Insomniac=- |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Apr 14, 2004 4:01 am |
No, I put the period in the pattern. It's outside the parentheses so it won't be part of %1 and therefore won't be in the alias name.
|
|
|
|
|
|