Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE MudletPackage>
- <MudletPackage version="1.001">
- <ScriptPackage>
- <ScriptGroup isActive="yes" isFolder="yes">
- <name>Print Room Info</name>
- <packageName></packageName>
- <script></script>
- <eventHandlerList />
- <Script isActive="yes" isFolder="no">
- <name>printRoomInfo</name>
- <packageName></packageName>
- <script>function printRoomInfo()
- --tempRegexTrigger("^.+\.$",[[pUtils.displayRoomInfo()]],1)
- if not printRoomInfoAntiSpam then
- displayRoomInfo = tempTrigger(gmcp.Room.Info.name:gsub(" %(road%)",""),[[displayRoomInfo()]],1)
- end
- printRoomInfoAntiSpam = true
- end</script>
- <eventHandlerList>
- <string>gmcp.Room.Info</string>
- </eventHandlerList>
- </Script>
- <Script isActive="yes" isFolder="no">
- <name>Display Room</name>
- <packageName></packageName>
- <script>function displayRoomInfo()
- local roomName = gmcp.Room.Info.name
- local roomDetails = gmcp.Room.Info.details
- local roomEnv = gmcp.Room.Info.environment
- local roomNum = gmcp.Room.Info.num
- local roomString = ""
- local roomColour = ""
- local roomStringLength = 0
- local windowWrap = getWindowWrap("main")
- roomString = "<DimGrey>[ "
- if #roomDetails > 0 then
- for k, v in ipairs(roomDetails) do
- roomColour = "<DimGrey>"
- if v == "indoors" then
- roomColour = "<yellow>"
- elseif v == "water" then
- roomColour = "<ansiLightBlue>"
- end
- roomString = roomString .. roomColour .. string.title(v)
- if k < #roomDetails and #roomDetails > 0 then roomString = roomString .."<DimGrey>|" end
- end
- roomString = roomString .. "<DimGrey> "
- end
- roomString = roomString .. roomEnv .. " <tan>" .. roomNum .. "<DimGrey> ]"
- roomStringLength = string.len(roomString:gsub("<[%w_]+>", ""))
- if roomStringLength + string.len(roomName) + 1 > windowWrap then
- roomString = string.rep(" ", windowWrap - roomStringLength) .. roomString
- else
- roomString = string.rep(" ", windowWrap - string.len(roomName) - 1 - roomStringLength) .. roomString
- end
- cecho(roomString)
- end</script>
- <eventHandlerList />
- </Script>
- </ScriptGroup>
- </ScriptPackage>
- </MudletPackage>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement