Advertisement
virelen

Untitled

Sep 24th, 2024
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.30 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE MudletPackage>
  3. <MudletPackage version="1.001">
  4.     <ScriptPackage>
  5.         <ScriptGroup isActive="yes" isFolder="yes">
  6.             <name>Print Room Info</name>
  7.             <packageName></packageName>
  8.             <script></script>
  9.             <eventHandlerList />
  10.             <Script isActive="yes" isFolder="no">
  11.                 <name>printRoomInfo</name>
  12.                 <packageName></packageName>
  13.                 <script>function printRoomInfo()
  14.   --tempRegexTrigger("^.+\.$",[[pUtils.displayRoomInfo()]],1)
  15.   if not printRoomInfoAntiSpam then
  16.     displayRoomInfo = tempTrigger(gmcp.Room.Info.name:gsub(" %(road%)",""),[[displayRoomInfo()]],1)
  17.   end
  18.   printRoomInfoAntiSpam = true
  19. end</script>
  20.                 <eventHandlerList>
  21.                     <string>gmcp.Room.Info</string>
  22.                 </eventHandlerList>
  23.             </Script>
  24.             <Script isActive="yes" isFolder="no">
  25.                 <name>Display Room</name>
  26.                 <packageName></packageName>
  27.                 <script>function displayRoomInfo()
  28.   local roomName = gmcp.Room.Info.name
  29.   local roomDetails = gmcp.Room.Info.details
  30.   local roomEnv = gmcp.Room.Info.environment
  31.   local roomNum = gmcp.Room.Info.num
  32.   local roomString = ""
  33.   local roomColour = ""
  34.   local roomStringLength = 0
  35.   local windowWrap = getWindowWrap("main")
  36.  
  37.   roomString = "&lt;DimGrey&gt;[ "
  38.  
  39.   if #roomDetails &gt; 0 then
  40.     for k, v in ipairs(roomDetails) do
  41.       roomColour = "&lt;DimGrey&gt;"
  42.      
  43.       if v == "indoors" then
  44.         roomColour = "&lt;yellow&gt;"
  45.       elseif v == "water" then
  46.         roomColour = "&lt;ansiLightBlue&gt;"
  47.       end
  48.       roomString = roomString .. roomColour .. string.title(v)
  49.       if k &lt; #roomDetails and #roomDetails &gt; 0 then roomString = roomString .."&lt;DimGrey&gt;|" end
  50.     end
  51.     roomString = roomString .. "&lt;DimGrey&gt; "
  52.   end
  53.  
  54.   roomString = roomString .. roomEnv .. " &lt;tan&gt;" .. roomNum .. "&lt;DimGrey&gt; ]"
  55.  
  56.   roomStringLength = string.len(roomString:gsub("&lt;[%w_]+&gt;", ""))
  57.  
  58.   if roomStringLength + string.len(roomName) + 1  &gt; windowWrap then
  59.     roomString = string.rep(" ", windowWrap - roomStringLength) .. roomString
  60.   else
  61.     roomString = string.rep(" ", windowWrap - string.len(roomName) - 1 - roomStringLength) .. roomString
  62.   end
  63.  
  64.   cecho(roomString)
  65. end</script>
  66.                 <eventHandlerList />
  67.             </Script>
  68.         </ScriptGroup>
  69.     </ScriptPackage>
  70. </MudletPackage>
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement