 |
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: Sat Oct 17, 2009 2:17 am
trigger to find exits |
Pattern
-----------------------------------------------------------------------------------------
You notice exits north, northeast, east, southeast, south, southwest, west, and
northwest.
Value
-----------------------------------------------------------------------------------------
RoomExits = %replace( %1, "and", "," " ")
RoomExits = %replace( @RoomExits, ", ", "|")
RoomExits = %replace( @RoomExits, " , ", "|")
#DELITEM RoomExits {}
If one exit falls on the next line like the northwest direction above, it will not become part of the list RoomExits.
I really don't know where to start to fix this.
Another problem is that the last direction will add the period for some reason, also don't know how to get rid of this.
For example: You notice exits north, and northeast.
RoomExits would hold the values: "north" and "northeast."
The period screws everything up when I try to use it for something. |
|
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sun Oct 18, 2009 10:59 am |
Use this as your trigger.
| Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="10" copy="yes">
<pattern>You notice exits (*).</pattern>
<value>RoomExits = %replace( %1, ", ", "|")
#ECHO @RoomExits
RoomExits = %replace( @RoomExits, "and ", "|")
#ECHO @RoomExits
#DELITEM RoomExits {}
#ECHO @RoomExits
</value>
</trigger>
</cmud> |
The reason there's always a period in last direction is because it's included in the text you match. The first replace didn't work quite properly because you have an extra pair of quotation marks in it. |
|
_________________ Asati di tempari! |
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|