 |
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Fri Nov 07, 2003 9:24 am
%roomname questions |
what I amtrying to do is set up a trigger that will take the roomname
and convert it to what I need
the room name would appear as this
A Black Hallway.
I want to convert it to a variable that would look like
(A Black Hallway)
brackets around.. and period at the end.
then I can use that variable in triggers I need.
Is there a way to do this? |
|
|
 |
jurz Novice
Joined: 22 Feb 2002 Posts: 48 Location: Latvia
|
Posted: Fri Nov 07, 2003 1:32 pm |
You have to find something that is common to all rooms.
For example
Ir Room looks like
A Black Hole [east, west]
Then we set up a trigger on
^(*)~[
to do
#var roomname ~(%1~)
Which would make roomname
(A Black Hole)
Otherwise there is no way, unless you want to map every room in your mud and then
use the names. |
|
|
 |
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Fri Nov 07, 2003 2:24 pm |
*chuckles*
Well.. I have almost every room in the mud mapped
What I am trying to accomplish
is an alias that takes %roomname
and makes it a variable
then take that variable and remove the . and add brackets
Having all the rooms mapped or not should be regardless as its
taking the room I am in which is of course mapped and in the mapper
so capturing the %roomname is easy
if it can't be done then I will have to find another way.. or if I could even get it to just strip the . I could probably work around it |
|
|
 |
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Fri Nov 07, 2003 3:02 pm |
Actually I solved it quite easily after a few cups of caffiene and looking through some helpfiles.
for anyone that may want to know in the future this is
how I did it
#VAR roomname %roomname
#VAR roomnames %remove( ., @roomname)
it doesnt put the brackets but it -does- strip the . and that makes what I wanted to do doable. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Nov 07, 2003 6:58 pm |
You could probably even shorten that to one step.
#VAR roomname %remove( ., {%roomname})
%remove will remove the first period in the string, which might not always be at the end. This might be a better (but more complicated) solution. It includes %trim to remove leading and trailing spaces and has delimiters to avoid possible problems with embedded commas.
#IF %ends( %trim( {%roomname}), .) {#VAR roomname %leftback( %trim( {%roomname}), 1)} |
|
|
 |
|
|