local mapfile = "/home/th3r00t/.local/share/blightmud/sindome.map" Map = Mapper.create("untolddawn") local function file_exists(file) local f = io.open(file, "r") if f then f:close() return true else return false end end local function load_map() if file_exists(mapfile) then blight.status_line(1, "Loading map...") Map:load(mapfile) end end local function untolddawn_connect() blight.status_height(1) blight.status_line(0, "Connecting to Untold Dawn...") blight.status_line(1, "Logging in...") mud.send("login th3r00t b2edxfrr1") blight.status_line(1, "Connected To Untold Dawn.") blight.status_line(0, "Untold Dawn") load_map() Map:print() end mud.on_disconnect(function() blight.status_line(0, "Disconnected.") if Map then Map:save(mapfile) end end) untolddawn_connect()