You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
3.4 KiB
144 lines
3.4 KiB
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE muclient>
|
|
<!-- Saved on Thursday, July 06, 2023, 10:03 AM -->
|
|
<!-- MuClient version 5.07-pre -->
|
|
|
|
<!-- Plugin "InfoWindow" generated by Plugin Wizard -->
|
|
|
|
<muclient>
|
|
<plugin
|
|
name="PlayerInfoWindow"
|
|
author="Crowley"
|
|
id="51e6d559f53be43ae8f93574"
|
|
language="Lua"
|
|
purpose="Sends player info to window"
|
|
save_state="y"
|
|
date_written="2023-07-06 10:02:24"
|
|
requires="5.07"
|
|
version="1.9"
|
|
>
|
|
|
|
</plugin>
|
|
|
|
|
|
<!-- Aliases -->
|
|
|
|
<aliases>
|
|
<alias
|
|
match="^((?:(?:fing(?:e|er)?|whois?|sc(?:o|or|ore|a|an)?)(?:.*)?))$"
|
|
enabled="y"
|
|
regexp="y"
|
|
script="onInfoRequest"
|
|
sequence="100"
|
|
>
|
|
</alias>
|
|
<alias
|
|
match="^closeinfo$"
|
|
enabled="y"
|
|
regexp="y"
|
|
script="closeWin"
|
|
sequence="100"
|
|
>
|
|
</alias>
|
|
</aliases>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
dofile(GetInfo(60) .. "aardwolf_colors.lua")
|
|
local extras = require "aard_lua_extras"
|
|
require "gmcphelper"
|
|
local snapshotV = tonumber(extras.PackageVersion())
|
|
|
|
local prefix = GetAlphaOption("script_prefix")
|
|
|
|
if (snapshotV< 2245) or (snapshotV < 2252 and tonumber(gmcp("char.base.level")) > 201) then
|
|
ColourNote("white", "blue", "Sorry, your snapshot of the AardMUSH package is not compatible for your level and you will not be able to use this script. Please update your snapshot of the AardMUSH package to use this plugin. Unloading plugin to prevent issues.")
|
|
Execute(prefix .. 'DoAfterSpecial(1, "UnloadPlugin(\'' .. GetPluginID() .. '\')", sendto.script)')
|
|
else
|
|
require "wrapped_captures"
|
|
end
|
|
|
|
require 'themed_miniwindows'
|
|
|
|
fontName = GetAlphaOption("output_font_name")
|
|
fontHeight = GetOption("output_font_height")
|
|
|
|
function OnPluginInstall()
|
|
InfoWin = ThemedTextWindow(
|
|
"PlayerInfo",
|
|
200,
|
|
200,
|
|
840,
|
|
500,
|
|
"Player Info",
|
|
"center",
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
fontName,
|
|
fontHeight,
|
|
fontName,
|
|
fontHeight,
|
|
100,
|
|
5,
|
|
true
|
|
)
|
|
end
|
|
|
|
function onInfoRequest(name, line, wildcards)
|
|
if not WindowInfo("PlayerInfo", 1) then OnPluginInstall() end
|
|
|
|
local param = wildcards[1]
|
|
Capture.untagged_output(param, true, true, false, addToWindow, false)
|
|
end
|
|
|
|
function addToWindow(lines)
|
|
foundStartIdx = 0
|
|
InfoWin:clear(false)
|
|
|
|
for indexStart, v in ipairs(lines) do
|
|
local vText = v[1].text
|
|
|
|
if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") or vText == "{scan}" then
|
|
foundStartIdx = (vText ~= "{scan}" and indexStart or indexStart + 1)
|
|
break
|
|
end
|
|
end
|
|
|
|
if foundStartIdx ~= 0 then
|
|
for indexEnd = #lines, 1, -1 do
|
|
vText = lines[indexEnd][1].text
|
|
|
|
if vText:find("%-+") or vText:find("There is no player with that name%.") or vText:find("You found nobody online with the name '%w+'%.") or vText == "{/scan}" then
|
|
foundEndIdx = (vText ~= "{/scan}" and indexEnd or indexEnd - 1)
|
|
table.move(lines, foundStartIdx, foundEndIdx, 1)
|
|
local len = foundEndIdx - foundStartIdx + 1
|
|
table.move(lines, #lines + 1, #lines * 2 - len, len + 1)
|
|
break
|
|
end
|
|
end
|
|
|
|
if #lines > 0 then
|
|
InfoWin:add_text(lines, false)
|
|
InfoWin:fit_contents()
|
|
InfoWin:show()
|
|
end
|
|
else
|
|
Simulate(stylesToANSI(lines))
|
|
end
|
|
end
|
|
|
|
function closeWin()
|
|
InfoWin:hide()
|
|
end
|
|
]]>
|
|
</script>
|
|
</muclient>
|