mudletmapper.xml 2.29 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
    <ScriptPackage>
        <Script isActive="yes" isFolder="no">
            <name>mapper</name>
            <packageName></packageName>
            <script>mudlet = mudlet or {}; mudlet.mapper_script = true

exitmap = {
  n = 1,
  north = 1,
  ne = 2,
  northeast = 2,
  nw = 3,
  northwest = 3,
  e = 4,
  east = 4,
  w = 5,
  west = 5,
  s = 6,
  south = 6,
  se = 7,
  southeast = 7,
  sw = 8,
  southwest = 8,
  u = 9,
  up = 9,
  d = 10,
  down = 10,
  [&quot;in&quot;] = 11,
  out = 12,
  [1] = &quot;north&quot;,
  [2] = &quot;northeast&quot;,
  [3] = &quot;northwest&quot;,
  [4] = &quot;east&quot;,
  [5] = &quot;west&quot;,
  [6] = &quot;south&quot;,
  [7] = &quot;southeast&quot;,
  [8] = &quot;southwest&quot;,
  [9] = &quot;up&quot;,
  [10] = &quot;down&quot;,
  [11] = &quot;in&quot;,
  [12] = &quot;out&quot;,
}

function doSpeedWalk()
  echo(&quot;Path we need to take: &quot; .. table.concat(speedWalkDir, &quot;, &quot;) .. &quot;\n&quot;)
  echo(&quot;Rooms we'll pass through: &quot; .. table.concat(speedWalkPath, &quot;, &quot;) .. &quot;\n&quot;)
	
	speedwalk(table.concat(speedWalkDir, &quot; &quot;))
end

function readNewRoom()
    local info = gmcp.Room.Info

    addAreaName(info.zone)
    addRoom(info.num)
    setRoomCoordinates(info.num, info.coord.x, info.coord.y, info.coord.z)
    setRoomArea(info.num, info.zone)
    centerview(info.num)
		display(gmcp)
		for direction,num in pairs(info.exits) do
    	print(&quot;Creating exit: &quot; .. direction)
			if direction == &quot;east&quot; then
				setExitStub(info.num, exitmap.e, true)
				connectExitStub(info.num, exitmap.e)
			elseif direction == &quot;west&quot; then
				setExitStub(info.num, exitmap.w, true)
				connectExitStub(info.num, exitmap.w)
			elseif direction == &quot;north&quot; then
				setExitStub(info.num, exitmap.n, true)
				connectExitStub(info.num, exitmap.n)
			elseif direction == &quot;south&quot; then
				setExitStub(info.num, exitmap.s, true)
				connectExitStub(info.num, exitmap.s)
			end
		end
		print(&quot;Mapper test: &quot; .. info.zone)
end

registerAnonymousEventHandler(&quot;gmcp.Room.Info&quot;, &quot;readNewRoom&quot;)</script>
            <eventHandlerList/>
        </Script>
    </ScriptPackage>
</MudletPackage>