|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: 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? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: 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?
|
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Feb 08, 2007 11:34 pm |
Yes %pref if only available in CMUD.
|
|
_________________ Taz :) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Anders Novice
Joined: 14 Jul 2003 Posts: 31 Location: USA
|
Posted: Fri Feb 09, 2007 6:32 am |
Thank you, it works great.
|
|
|
|
|
|