Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: Wed Jun 30, 2004 5:40 pm   

The name of the current room in a variable
 
I want to have a variable which contains the name of the room i'm standing in and updates automatically as I move around.

What might make it tricky is I dont use the mapper at all and dont plan on ever using it unless it gets a bit smarter.

The rooms name is always on the first line when you enter the room.
Heres a Sample of what i see:

Baths.
A runic totem is planted solidly in the ground. A sense of balmy languor blankets the area surrounding a large shrine to Valnurana, composed of four statues supporting a dome of softly sparkling crystal. A sleek pony grazes nearby.
You see a single exit leading north (open door).

Maybe i'm totally overlooking a really simple solution but my brain has gone to sleep on this one. [xx(]
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Wed Jun 30, 2004 7:09 pm   
 
Maybe adding an alias to each direction you move
#AL n {north;#TEMP {^(*)} {#VAR currentroom %%1}
Reply with quote
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: Thu Jul 01, 2004 12:35 pm   
 
I eventually got something to work but your solution didnt work.. I already have macros for each of the directions to clear certain variables when I move so i put the #temp trigger stuff in there but when i move around it wasnt changing the variable ..
I turned the show triggers option on and saw this line:
[^(%*)-> #VAR currentroom 3338h, 2160m, 15590e cex-nw]

thats my prompt and the direction I was moving and what it was doing was creating new class folders with parts of my prompt as a name and a blank current room variable in it

In the end I removed #VAR and just put currentroom=%1 there instead and it works fine

Now the second problem I then ran into is that whenever I moved an invalid direction I get a 'There is no exit in that direction.' message and the temp trigger then stores this in the currentroom variable. Well my brain must have woke up again cause I solved this too and here is my solution:

#KEY KEY8 {n;#temp {^(*)} {oldroom=@currentroom;currentroom=%1;#if (@currentroom="There is no exit in that direction.") {currentroom=@oldroom}}}

by making an oldroom variable to store the previous current room I could then check for 'There is no exit in that direction.' being the current room and restore its previous value.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net