11-- mmp = mudlet mapper namespace
22mmp = mmp
3- or {
4- paused = false ,
5- autowalking = false ,
6- currentroom = 0 ,
7- currentroomname = " (unknown)" ,
8- firstRun = true ,
9- specials = {},
10- }
3+ or {
4+ paused = false ,
5+ autowalking = false ,
6+ currentroom = 0 ,
7+ currentroomname = " (unknown)" ,
8+ firstRun = true ,
9+ specials = {},
10+ }
1111mmp .speedWalkWatch = createStopWatch ()
1212-- speedWalkPath and speedWalkDir populated by Mudlet from getPath() and gotoRoom()
1313speedWalkPath = speedWalkPath or {}
@@ -19,114 +19,114 @@ mmp.speedWalk = mmp.speedWalk or {}
1919mmp .speedWalkPath = mmp .speedWalkPath or {}
2020mmp .speedWalkDir = mmp .speedWalkDir or {}
2121mmp .lagtable = {
22- [1 ] = { description = " Normal, default level." , time = 0.5 },
23- [2 ] = { description = " Decent, but slightly laggy." , time = 1 },
24- [3 ] = { description = " Noticeably laggy with occasional spikes." , time = 2 },
25- [4 ] = { description = " Bad. Terrible. Terribad." , time = 5 },
26- [5 ] = { description = " Carrier Pigeon" , time = 10 },
22+ [1 ] = { description = " Normal, default level." , time = 0.5 },
23+ [2 ] = { description = " Decent, but slightly laggy." , time = 1 },
24+ [3 ] = { description = " Noticeably laggy with occasional spikes." , time = 2 },
25+ [4 ] = { description = " Bad. Terrible. Terribad." , time = 5 },
26+ [5 ] = { description = " Carrier Pigeon" , time = 10 },
2727}
28- local newversion = " 2.0.0 "
28+ local newversion = " 2.0.1 "
2929if mmp .version and mmp .version ~= newversion then
30- if not mmp .game then
31- mmp .echo (
32- " Mapper script updated - Thanks! I don't know what game are you connected to, though - so please reconnect, if you could."
33- )
34- else
35- mmp .echo (" Mapper script updated - thanks! You don't need to restart." )
36- end
30+ if not mmp .game then
31+ mmp .echo (
32+ " Mapper script updated - Thanks! I don't know what game are you connected to, though - so please reconnect, if you could."
33+ )
34+ else
35+ mmp .echo (" Mapper script updated - thanks! You don't need to restart." )
36+ end
3737end
3838mmp .version = newversion
3939
4040function mmp .reload ()
41- -- Force reload of settings
42- mmp .firstRun = true
43- mmp .startup ()
44- mmp .echo (" Mapper settings reloaded!" )
41+ -- Force reload of settings
42+ mmp .firstRun = true
43+ mmp .startup ()
44+ mmp .echo (" Mapper settings reloaded!" )
4545end
4646
4747function mmp .startup ()
48- if not mmp .firstRun then
49- return
50- end
51- local private_settings = {}
48+ if not mmp .firstRun then
49+ return
50+ end
51+ local private_settings = {}
5252
53- -- General settings
53+ -- General settings
5454
55- private_settings [" echocolour" ] = mmp .createOption (
56- " cyan" ,
57- mmp .changeEchoColour ,
58- { " string" },
59- " Set the color for room number echos?" ,
60- function (newSetting )
61- return color_table [newSetting ] ~= nil
62- end
63- )
64- private_settings [" crowdmap" ] = mmp .createOption (
65- false ,
66- mmp .changeMapSource ,
67- { " boolean" },
68- " Use a crowd-sourced map instead of games default?" ,
69- nil ,
70- { gomud = true }
71- )
72- private_settings [" showcmds" ] = mmp .createOption (true , mmp .changeBoolFunc , { " boolean" }, " Show walking commands?" )
73- private_settings [" laglevel" ] = mmp .createOption (
74- 1 ,
75- mmp .changeLaglevel ,
76- { " number" },
77- " How laggy is your connection, (fast 1<->5 slow)?" ,
78- mmp .verifyLaglevel
79- )
80- private_settings [" slowwalk" ] =
81- mmp .createOption (false , mmp .setSlowWalk , { " boolean" }, " Walk slowly instead of as quick as possible?" )
82- private_settings [" fastwalk" ] = mmp .createOption (
83- false ,
84- mmp .changeBoolFunc ,
85- { " boolean" },
86- " Walk as quick as possible instead of waiting for prompts?"
87- )
88- private_settings [" updatemap" ] =
89- mmp .createOption (true , mmp .changeUpdateMap , { " boolean" }, " Check for new maps from your MUD?" )
90- private_settings [" autopositionrooms" ] = mmp .createOption (
91- true ,
92- mmp .setAutoPositionRooms ,
93- { " boolean" },
94- " Auto position rooms when mapping?" ,
95- nil ,
96- { gomud = true }
97- )
98- private_settings [" debug" ] = mmp .createOption (false , mmp .changeBoolFunc , { " boolean" }, " Enable debug messages?" )
55+ private_settings [" echocolour" ] = mmp .createOption (
56+ " cyan" ,
57+ mmp .changeEchoColour ,
58+ { " string" },
59+ " Set the color for room number echos?" ,
60+ function (newSetting )
61+ return color_table [newSetting ] ~= nil
62+ end
63+ )
64+ private_settings [" crowdmap" ] = mmp .createOption (
65+ false ,
66+ mmp .changeMapSource ,
67+ { " boolean" },
68+ " Use a crowd-sourced map instead of games default?" ,
69+ nil ,
70+ { gomud = true }
71+ )
72+ private_settings [" showcmds" ] = mmp .createOption (true , mmp .changeBoolFunc , { " boolean" }, " Show walking commands?" )
73+ private_settings [" laglevel" ] = mmp .createOption (
74+ 1 ,
75+ mmp .changeLaglevel ,
76+ { " number" },
77+ " How laggy is your connection, (fast 1<->5 slow)?" ,
78+ mmp .verifyLaglevel
79+ )
80+ private_settings [" slowwalk" ] =
81+ mmp .createOption (false , mmp .setSlowWalk , { " boolean" }, " Walk slowly instead of as quick as possible?" )
82+ private_settings [" fastwalk" ] = mmp .createOption (
83+ false ,
84+ mmp .changeBoolFunc ,
85+ { " boolean" },
86+ " Walk as quick as possible instead of waiting for prompts?"
87+ )
88+ private_settings [" updatemap" ] =
89+ mmp .createOption (true , mmp .changeUpdateMap , { " boolean" }, " Check for new maps from your MUD?" )
90+ private_settings [" autopositionrooms" ] = mmp .createOption (
91+ true ,
92+ mmp .setAutoPositionRooms ,
93+ { " boolean" },
94+ " Auto position rooms when mapping?" ,
95+ nil ,
96+ { gomud = true }
97+ )
98+ private_settings [" debug" ] = mmp .createOption (false , mmp .changeBoolFunc , { " boolean" }, " Enable debug messages?" )
9999
100- -- Settings that lock things
100+ -- Settings that lock things
101101
102- private_settings [" lockspecials" ] =
103- mmp .createOption (false , mmp .lockSpecials , { " boolean" }, " Lock all special exits?" )
102+ private_settings [" lockspecials" ] =
103+ mmp .createOption (false , mmp .lockSpecials , { " boolean" }, " Lock all special exits?" )
104104
105- mmp .settings = mmp .createOptionsTable (private_settings )
106- mmp .settings .disp = mmp .echo
107- mmp .game = false
108- mmp .settings .dispOption = function (opt , val )
109- cecho (
110- " <green>"
111- .. val .use
112- .. " <white> ("
113- .. opt
114- .. " ) "
115- .. string.rep (" " , 50 - val .use :len () - opt :len ())
116- .. tostring (val .value )
117- .. " \n "
118- )
119- end
120- mmp .settings .dispDefaultWriteError = function ()
121- mmp .echo (" Please use the mconfig alias to set options!" )
122- end
123- raiseEvent (" mmp areas changed" )
124- mmp .firstRun = false
125- mmp .echon (" Mudlet Mapper script for GoMud (" .. tostring (mmp .version ) .. " ) loaded! (" )
126- echoLink (
127- " See more on Github" ,
128- " (openUrl or openURL)('https://github.com/GoMudEngine/MudletMapper')" ,
129- " Clicky clicky to read up on what's this about"
130- )
131- echo (" )\n " )
105+ mmp .settings = mmp .createOptionsTable (private_settings )
106+ mmp .settings .disp = mmp .echo
107+ mmp .game = false
108+ mmp .settings .dispOption = function (opt , val )
109+ cecho (
110+ " <green>"
111+ .. val .use
112+ .. " <white> ("
113+ .. opt
114+ .. " ) "
115+ .. string.rep (" " , 50 - val .use :len () - opt :len ())
116+ .. tostring (val .value )
117+ .. " \n "
118+ )
119+ end
120+ mmp .settings .dispDefaultWriteError = function ()
121+ mmp .echo (" Please use the mconfig alias to set options!" )
122+ end
123+ raiseEvent (" mmp areas changed" )
124+ mmp .firstRun = false
125+ mmp .echon (" Mudlet Mapper script for GoMud (" .. tostring (mmp .version ) .. " ) loaded! (" )
126+ echoLink (
127+ " See more on Github" ,
128+ " (openUrl or openURL)('https://github.com/GoMudEngine/MudletMapper')" ,
129+ " Clicky clicky to read up on what's this about"
130+ )
131+ echo (" )\n " )
132132end
0 commit comments