|
Benjaminaott Newbie
Joined: 13 May 2003 Posts: 1 Location: USA
|
Posted: Tue May 13, 2003 2:25 am
trigger help |
In my mud I want to pick up objects off the ground known as artifacts. I've made a stringlist of the artifact names the problem is recognizing when they are on the ground to be picked up. Here is a sample room description with an artifact on the ground:
Rue des Orhe.
You are able to see by the light of the lantern. The Rue des Orhe continues to
the east and west. You could progress eastwards, westwards. In your immediate
vicinity you see a bottle of cognac.
What I need to do is test the string between "vicinity you see" and "." against my artifact list but there are more complicated cases. For example sometimes the line breaks within the artifact name and sometimes there are multiple objects on the ground. Here is an example of the latter:
In your immediate vicinity you see a young black horse and a bottle of cognac.
In that example the first object is not an artifact but as you can imagine it might well be or there may even be more than 2 on the ground.
Since there are so many cases I'm not sure of how to make triggers to account for them all. I've made one that works in the simplest case where everything is on one line and there is only one artifact but with everything else I've had no luck. Can anyone help me with this? |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun Jun 15, 2003 6:56 pm |
Please list more cases so that we can better help you.
#trigger {In your immediate
vicinity you see (*).} {#var newitem "";#var newitem "%1";#var founditem "";#var founditem %ismember(@newitem,@stringlist);#echo you found this~: %item(@stringlist,@founditem)}
if like you said it has more than one item try searcing the finished scripts for the one that allows you to capture multiple lines.
Then use the word "and" as a delimiter like so:
%replace(@newitem,"and","|") then make it loop through this list checking it against you @stringlist.
Any questions?
megamog75
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment.
-Raistlin Majere |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
|
|
|
|
|