This puts your stats in a small window designed to sit at the top of the screen.
 |
To save and install the Aardwolf_Stats_Window plugin do this:
- Copy between the lines below (to the Clipboard)
- Open a text editor (such as Notepad) and paste the plugin into it
- Save to disk on your PC, preferably in your plugins directory, as Aardwolf_Stats_Window.xml
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file Aardwolf_Stats_Window.xml (which you just saved in step 3) as a plugin
- Click "Close"
|
The plugin requires Stats_Detector.xml from the link below.
------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, August 19, 2009, 7:38 AM -->
<!-- MuClient version 4.43 -->
<!-- Plugin "Aardwolf_Stats_Miniwindow" generated by Plugin Wizard -->
<muclient>
<plugin
name="Aardwolf_Stats_Miniwindow"
author="Blainer"
id="124279faf50f012ce0fdd17c"
language="Lua"
purpose="Put aardwolf stats in a miniwindow"
date_written="2009-08-19 07:37:33"
requires="4.43"
version="1.0"
save_state="y"
>
<description trim="n">
<![CDATA[
Uses the xStats_Detector.xml to put a one line bar with player states, align, exp to level and gold at the top of the screen.
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.lua"/>
<!-- Script -->
<script>
<![CDATA[
require "movewindow"
require "mw"
-- Options --------------
local WIN_STACK = "aa"
local TITLE = "Aardwolf Player Stats"
local BACKGROUND_COLOUR = 0x00220E
local TEXT_OFFSET = "2"
local BORDER_WIDTH = "1"
local LINE_SPACING = "1"
local FONT_NAME = "Courier"
local FONT_SIZE = 8
function Draw_Window (t)
fstr = "@YStr @g\[@w%3d@g/@w%-3d@g\] @YInt @g\[@w%3d@g/@w%-3d@g\] @YWis @g\[@w%3d@g/@w%-3d@g\] @YDex @g\[@w%3d@g/@w%-3d@g\] @YCon @g\[@w%3d@g/@w%-3d@g\] @YLuck @g\[@w%3d@g/@w%-3d@g\] @YHitroll @g\[ @w%d @g\] @YDamroll @g\[ @w%d @g\] @YExp to Level @g\[ @w%d @g\] @YLevel @g\[ @W%d @g\] @YAlignment @g\[ @w%d @g\] @YGold @g\[ @Y%d @g\]"
s = fstr:format(t.str, t.base_str, t.int, t.base_int, t.wis, t.base_wis, t.dex, t.base_dex, t.con, t.base_con, t.luck, t.base_luck, t.hitroll, t.damroll, t.to_level, t.level, t.align, t.gold)
text_width = WindowTextWidth (win, font_id, mw.strip_colours(s))
window_width = text_width + TEXT_OFFSET * 2
window_height = font_height + (TEXT_OFFSET * 2)
check(WindowCreate (win,
windowinfo.window_left,
windowinfo.window_top,
window_width, -- width
window_height, -- height
windowinfo.window_mode,
windowinfo.window_flags,
BACKGROUND_COLOUR))
left = TEXT_OFFSET
top = TEXT_OFFSET
bottom = top + font_height
right = left + text_width
mw.colourtext (win, font_id, s, left, top, right, bottom, false)
movewindow.add_drag_handler (win, 0, 0, WindowInfo (win, 3), WindowInfo (win, 4), 1)
WindowShow (win, true)
end
function OnPluginInstall ()
win = WIN_STACK .. GetPluginID ()
local fonts = utils.getfontfamilies ()
if fonts[FONT_NAME] then
font_size = FONT_SIZE
font_name = FONT_NAME
elseif fonts.Dina then
font_size = 8
font_name = "Dina" -- the actual font
else
font_size = 10
font_name = "Courier"
end -- if
font_id = "stat_font"
windowinfo = movewindow.install (win, 4)
check (WindowCreate (win,
windowinfo.window_left,
windowinfo.window_top,
1, 1,
windowinfo.window_mode,
windowinfo.window_flags,
BACKGROUND_COLOUR) )
WindowFont (win, font_id, font_name, font_size, false, false, false, false, 0, 0) -- normal
font_height = WindowFontInfo (win, font_id, 1) -- height
if GetVariable ("enabled") == "false" then
ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
check (EnablePlugin(GetPluginID (), false))
return
end -- they didn't enable us last time
end -- OnPluginInstall
function OnPluginEnable ()
OnPluginInstall ()
end -- OnPluginEnable
function OnPluginClose ()
OnPluginDisable ()
end -- OnPluginClose
function OnPluginDisable ()
WindowShow (win, false)
end -- OnPluginDisable
function OnPluginSaveState ()
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
movewindow.save_state (win)
end -- OnPluginSaveState
function OnPluginBroadcast (msg, id, name, text)
if msg == 1 and id == "8a710e0783b431c06d61a54c" then
local stats = GetPluginVariableList("8a710e0783b431c06d61a54c")
Draw_Window (stats)
end -- stats changed
end
]]>
</script>
</muclient>
------------------------------------------ |