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
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Thu Feb 08, 2007 12:17 pm   

Map script problem
 
How do I see, with a script, if the mapper is set to follow or to off?
I can use %maplocked( ) to see if the mapper is on follow (results in 1), if it is in explore mode (results in 0) and if the map is shut down completely (results in "").
When the map is put to "off" the %maplocked( ) shows 1.
Any suggestions?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Feb 08, 2007 7:58 pm   
 
%pref(MapOn) will return 0 if the mapper is off or closed, and 1 if it is in follow or explore mode. This in conjunction with %maplocked should do what you need.

P.S. Technically speaking if the map window is closed, %maplocked returns null.
_________________
Asati di tempari!
Reply with quote
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Thu Feb 08, 2007 8:10 pm   
 
I don't know if I am doing something wrong or what, but I can't get that to work. Is that function only available in CMUD and not in zMUD?
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Feb 08, 2007 11:34 pm   
 
Yes %pref if only available in CMUD.
_________________
Taz :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Feb 08, 2007 11:48 pm   
 
ZMud doesn't have the %pref() function, but you can do all of that already via a user-defined function or alias (while I don't rule out possible issues due to proper syntax and such, the following has been tested and found to be operating as expected):

-1 = mapper not open, 0 = Off mode, 1 = Follow, and 2 = Explore

#FUNCTION CheckMapperStatus() {%if(%maplocked() = "",-1,%if(%class(AutoMapper),2,%if(%class(AutomapperAll),1,0)))}

This doesn't handle %maplocked() for when the mapper is open, but since %maplocked() is there already this shouldn't be a problem.

Alternatively, you can always force the issue by using the proper #MENU commands.
_________________
EDIT: I didn't like my old signature
Reply with quote
Anders
Novice


Joined: 14 Jul 2003
Posts: 31
Location: USA

PostPosted: Fri Feb 09, 2007 6:32 am   
 
Thank you, it works great.
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