Exit area trigger

edited March 2019 in Mechanic's Corner
This is a trigger to show what area an exit goes to if it would result in a change of area.
Requires mudlet, mudlet mapper and gmcp.
Thanks to @Aramel for helping me with the last few bugs 


pattern: ^You see (?:a single )?exits? leading script:local dirs = {} dirs["n"] = "north" dirs["ne"] = "northeast" dirs["e"] = "east" dirs["se"] = "southeast" dirs["s"] = "south" dirs["sw"] = "southwest" dirs["w"] = "west" dirs["nw"] = "northwest" dirs["u"] = "up" dirs["d"] = "down" dirs["in"] = "in" dirs["out"] = "out" local areaHere = mmp.getAreaName(gmcp.Room.Info.num) for k,v in pairs(gmcp.Room.Info.exits) do if k ~= "x" then local areaNew = mmp.getAreaName(v) if areaNew ~= areaHere and areaNew ~= "?" then selectCurrentLine() for s,l in pairs(dirs) do if k == s then selectString(" "..l.." ",1) replace(" "..l.."("..areaNew..") ",true) deselect() selectString(" "..l..".",1) replace(" "..l.."("..areaNew..").",true) deselect() selectString(" "..l..",",1) replace(" "..l.."("..areaNew.."),",true) end end end end end <br><br>*edit* Sorry for the formatting.

Comments

Sign In or Register to comment.