Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Exodus
(12 posts) bio
|
| Date |
Fri 19 Jul 2002 03:14 AM (UTC) [ quote
] |
| Message |
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. | top |
|
| Posted by |
Nick Gammon
Australia (18,800 posts) bio
Forum Administrator |
| Date |
Reply #1 on Fri 19 Jul 2002 08:05 AM (UTC) [ quote
] |
| Message |
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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,462 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )