The generic mapper script demo is available at the following link: http://sourceforge.net/p/mudlet/code/ci ... format=raw
Note that this is not a complete script - it's an example of how to get started making one.
Generic mapper script link
All and any discussion and development of the Mudlet Mapper.
Re: Generic mapper script link
Well, why not use the forums for convenience. File size is 23KB, file name is generic_mapper_script.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
<TriggerPackage>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>generic mapper script</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>1</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList/>
<regexCodePropertyList/>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>highlight exits</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>exits</string>
<string>exit:</string>
<string>EXIT</string>
<string>EXITS</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
</regexCodePropertyList>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>exits</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>99</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>up</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>d</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>down</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>n</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>99</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>north</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>w</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>west</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>e</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>east</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>s</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>south</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>nw</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>99</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>northwest</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>ne</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>northeast</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>sw</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>southwest</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="yes" isColorizerTrigger="yes" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>se</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>southeast</string>
</regexCodeList>
<regexCodePropertyList>
<integer>0</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
</TriggerGroup>
</TriggerPackage>
<TimerPackage/>
<AliasPackage>
<AliasGroup isActive="yes" isFolder="yes">
<name>generic mapper script commands</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<AliasGroup isActive="yes" isFolder="yes">
<name>moving directions</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>^out$</name>
<script>send("out")
mapperMove("out")</script>
<command></command>
<packageName></packageName>
<regex>^out$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^in$</name>
<script>send("in")
mapperMove("in")</script>
<command></command>
<packageName></packageName>
<regex>^in$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^d$</name>
<script>send("d")
mapperMove("down")</script>
<command></command>
<packageName></packageName>
<regex>^d$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^u$</name>
<script>send("u")
mapperMove("up")</script>
<command></command>
<packageName></packageName>
<regex>^u$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^se$</name>
<script>send("se")
mapperMove("se")</script>
<command></command>
<packageName></packageName>
<regex>^se$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^sw$</name>
<script>send("sw")
mapperMove("sw")</script>
<command></command>
<packageName></packageName>
<regex>^sw$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^ne$</name>
<script>send("ne")
mapperMove("ne")</script>
<command></command>
<packageName></packageName>
<regex>^ne$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^nw$</name>
<script>send("nw")
mapperMove("nw")</script>
<command></command>
<packageName></packageName>
<regex>^nw$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^e$</name>
<script>send("e")
mapperMove("e")</script>
<command></command>
<packageName></packageName>
<regex>^e$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^w$</name>
<script>send("w")
mapperMove("w")</script>
<command></command>
<packageName></packageName>
<regex>^w$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^s$</name>
<script>send("s")
mapperMove("s")</script>
<command></command>
<packageName></packageName>
<regex>^s$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>^n$</name>
<script>send("n")
mapperMove("n")</script>
<command></command>
<packageName></packageName>
<regex>^n$</regex>
</Alias>
</AliasGroup>
<AliasGroup isActive="yes" isFolder="yes">
<name>tools</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>^deleteMap$</name>
<script>deleteArea(1)</script>
<command></command>
<packageName></packageName>
<regex>^deleteMap$</regex>
</Alias>
</AliasGroup>
</AliasGroup>
</AliasPackage>
<ActionPackage/>
<ScriptPackage>
<ScriptGroup isActive="yes" isFolder="yes">
<name>generic mapper scripts</name>
<packageName></packageName>
<script></script>
<eventHandlerList/>
<Script isActive="yes" isFolder="no">
<name>mapper variables</name>
<packageName></packageName>
<script>mapperDirectionInvers = {}
mapperDirectionInvers[1]=6
mapperDirectionInvers[6]=1
mapperDirectionInvers[4]=5
mapperDirectionInvers[5]=4
mapperDirectionInvers[2]=8
mapperDirectionInvers[8]=2
mapperDirectionInvers[3]=7
mapperDirectionInvers[7]=3
mapperDirectionInvers[9]=10
mapperDirectionInvers[10]=9
mapperDirectionInvers[11]=12
mapperDirectionInvers[12]=11
mapperRoomID = 1
mapperStep = 3;
addAreaName("main")
mapperAreaID = 1
mapperPositionX = 0
mapperPositionY = 0
mapperPositionZ = 0
--#define DIR_NORTH 1
--#define DIR_NORTHEAST 2
--#define DIR_NORTHWEST 3
--#define DIR_EAST 4
--#define DIR_WEST 5
--#define DIR_SOUTH 6
--#define DIR_SOUTHEAST 7
--#define DIR_SOUTHWEST 8
--#define DIR_UP 9
--#define DIR_DOWN 10
--#define DIR_IN 11
--#define DIR_OUT 12
</script>
<eventHandlerList/>
</Script>
<Script isActive="yes" isFolder="no">
<name>functions</name>
<packageName></packageName>
<script>
function mapperMoveRoom( id )
mapperRoomID = id
mapperPositionX, mapperPositionY, mapperPositionZ = getRoomCoordinates( id )
mapperAreaID = getRoomArea( id )
end
function mapperCheckExits( dir )
if not mapperRoomID then return false end
if not roomExists(mapperRoomID ) then return false end
local exits = getRoomExits(mapperRoomID);
if not exits then return false; end
if dir == "n" then
if table.contains(exits, "north" ) then
mapperMoveRoom( exits["north"] )
return true
end
end
if dir == "s" then
if table.contains(exits, "south" ) then
mapperMoveRoom( exits["south"] )
return true
end
end
if dir == "w" then
if table.contains(exits, "west" ) then
mapperMoveRoom( exits["west"] )
return true
end
end
if dir == "e" then
if table.contains(exits, "east" ) then
mapperMoveRoom( exits["east"] )
return true
end
end
if dir == "nw" then
if table.contains(exits, "northwest" ) then
mapperMoveRoom( exits["northwest"] )
return true
end
end
if dir == "ne" then
if table.contains(exits, "northeast" ) then
mapperMoveRoom( exits["northeast"] )
return true
end
end
if dir == "sw" then
if table.contains(exits, "southwest" ) then
mapperMoveRoom( exits["southwest"] )
return true
end
end
if dir == "se" then
if table.contains(exits, "southeast" ) then
mapperMoveRoom( exits["southeast"] )
return true
end
end
if dir == "up" then
if table.contains(exits, "up" ) then
mapperMoveRoom( exits["up"] )
return true
end
end
if dir == "down" then
if table.contains(exits, "north" ) then
mapperMoveRoom( exits["north"] )
return true
end
end
if dir == "in" then
if table.contains(exits, "in" ) then
mapperMoveRoom( exits["in"] )
return true
end
end
if dir == "out" then
if table.contains(exits, "out" ) then
mapperMoveRoom( exits["out"] )
return true
end
end
return false
end
function mapperMove( dir )
local _dir = 0; -- exit direction value see defines above
if not mapperCheckExits( dir ) then
if dir == "n" then mapperPositionY = mapperPositionY + mapperStep; _dir = 1 end
if dir == "s" then mapperPositionY = mapperPositionY - mapperStep; _dir = 6 end
if dir == "w" then mapperPositionX = mapperPositionX - mapperStep; _dir = 5 end
if dir == "e" then mapperPositionX = mapperPositionX + mapperStep; _dir = 4 end
if dir == "nw" then mapperPositionY = mapperPositionY + mapperStep; mapperPositionX = mapperPositionX - mapperStep; _dir = 3 end
if dir == "ne" then mapperPositionY = mapperPositionY + mapperStep; mapperPositionX = mapperPositionX + mapperStep; _dir = 2 end
if dir == "sw" then mapperPositionY = mapperPositionY - mapperStep; mapperPositionX = mapperPositionX - mapperStep; _dir = 8 end
if dir == "se" then mapperPositionY = mapperPositionY - mapperStep; mapperPositionX = mapperPositionX + mapperStep; _dir = 7 end
if dir == "up" then mapperPositionZ = mapperPositionZ + 1; end
if dir == "down" then mapperPositionZ = mapperPositionZ - 1; end
local roomCollisions = {}
if getAreaRooms( 1 ) ~= nil then
numRooms = getAreaRooms(1)
if # numRooms > 0 then
roomCollisions = getRoomsByPosition( mapperAreaID, mapperPositionX, mapperPositionY, mapperPositionZ )
display(roomCollisions)
echo("size="..table.size(roomCollisions).."\n")
if table.size(roomCollisions) > 0 then
echo("(mapper:) room collisions: size="..table.size(roomCollisions).."\n")
display(roomCollisions )
echo("(mapper:) merging room\n");
mapperRoomID_old = mapperRoomID
mapperRoomID = roomCollisions[0]
setExit( mapperRoomID_old, mapperRoomID, _dir )
setExit( mapperRoomID, mapperRoomID_old, mapperDirectionInvers[_dir] )
end
else
echo("die area hat keine raeume\n")
end
end
if table.size(roomCollisions) == 0 then
echo("creating new room\n")
mapperRoomID_old = mapperRoomID
mapperRoomID = createRoomID();
addRoom(mapperRoomID)
setRoomCoordinates( mapperRoomID, mapperPositionX, mapperPositionY, mapperPositionZ )
setRoomArea( mapperRoomID, mapperAreaID )
setRoomEnv( mapperRoomID, 2 )
setExit( mapperRoomID_old, mapperRoomID, _dir )
setExit( mapperRoomID, mapperRoomID_old, mapperDirectionInvers[_dir] )
display(getAreaRooms(1))
else
display(roomCollisions)
end
end
centerview( mapperRoomID )
echo("roomID:"..mapperRoomID.." POS("..mapperPositionX.."/"..mapperPositionY.."/"..mapperPositionZ..") move done\n")
end</script>
<eventHandlerList/>
</Script>
</ScriptGroup>
</ScriptPackage>
<KeyPackage/>
</MudletPackage>
Re: Generic mapper script link
I think that this thread is misleading and should be closed because the "generic mapper script" is incomplete and unmaintained. The best place for information on simple generic mapper scripts is this stickied thread: http://forums.mudlet.org/viewtopic.php?f=13&t=3453