List of Triggers

Posted by Exodus on Fri 19 Jul 2002 03:14 AM — 2 posts, 12,191 views.

#0
Hi there,

I'm tried to figure out a way of writing a script to trigger on a list of room names. The idea is to create a list of names on the script that will set a variable when it identifies each room as you move along.
For example,

Select Case (Room)
Case "A Dark hallway (n,s)"
RoomVar = "Dark halls"
Case "A lonely mountain path (n,s,e,w)"
RoomVar = "Mountain path"
Case "A fiery pit (u)"
RoomVar = "Fire pit"
end select
world.SetVariable "Roomname", "" & RoomVar & ""
when I see .. say "HP:* EP:* A Dark hallway (n,s)", where "HP:* EP:*" is my prompt.
It will set the variable "Roomname" to be "Dark halls"

Instead of having to separately setting a trigger for each room to change the variable accordingly, is there a way them from just one script? And to be able to continue adding rooms as I go along?

Sorry if this doesn't make sense,ii'll try to clarify it.
Australia Forum Administrator #1
What about matching on:

HP:* EP:* *

This way the room name is the third wildcard, and then the script makes the decision the way it does already.