Saturday, August 22, 2009 at 05:18:05 UTC
http://code.google.com/p/aardinvwin/
Inventory Window Plugin
Show Aardwolf inventory in a mini window for MUSH Client 4.40.
Features:
-Shows a miniwindow with inventory contents.
-Caches item details in a searchable SQLite database.
-Drag and drop window (click and drag title text).
-Minimize miniwindow to a movable button.
-Apply filters to inventory from menu and command line.
-View contents of bags.
-Reference items by line number from command line.
Commands:
inw - show/refresh inventory window.
inw h - minimize window to a movable button.
inw s - maximize window, or just "inw".
inw n - next page.
inw p - previous page.
inw <page num> - show page <page num>.
inw f - show Filters list.
inw <filter name> - filter inventory list, filter names can be shortened, "inw ar" will match Armour.
inw a - use filter Show all.
inw s:<item desc> - search database for an item by description.
inw slist - add spell list to the database (needs to be done once to display details properly).
inw dbmsg - toggle script database messages, at install reverts to value set in script.
inw <serial> - get invdetails on item.
inw getalldetails - get item details for entire inventory (not items in bags).
inw lines - toggle show line numbers.
i <command> <num> - send <command> for item <number>, "i id 1" = id item 1 on inv list.
inw ? - show this help.
Upgrade Instructions
The script may not function properly if the state file is not deleted before new version is
installed.
1.
Download the plugin again from the here to get the latest version:
http://code.google.com/p/aardinvwin/
2.
Remove the old plugin from the File > Plugins dialog.
3.
Use Window XP search on the start menu with this search "*6dbbeddda02ed2390b58ccd9-state.xml" with out the quotes (").
The search should find a file like this:
777af83cdf336b8bb5207967-6dbbeddda02ed2390b58ccd9-state.xml
Or just use Explorer to browse to this directory:
"C:\Program Files\MUSHclient\worlds\plugins\state\777af83cdf336b8bb5207967-6dbbeddda02ed2390b58ccd9-state.xml"
This is my state file name it may different on your computer
how ever the "dbbeddda02ed2390b58ccd9" will be the same.
4.
Delete this file, it's important that this file be deleted after the plugin has
been removed and before you install the new version.
5.
If requested at begining of post.
Delete the Aardwolfdb.db file. By default this file is installed at:
"C:\Program Files\MUSHclient\worlds\plugins\Aardwolfdb.db"
6.
Then go to the File > Plugins dialog and install the new version.
Install Instructions
Requires MUSH 4.40 the custom Aardwolf MUSH client is here:
http://www.aardwolf.com/play/downloadmc.htm
1.
Three files are required to run this plugin Inventory_Window_2.xml, mw.lua and aardsql.lua.
Inventory_Window_2.xml
Download these from http://code.google.com/p/aardinvwin/:
Inventory_window_2.xml save to MUSH plugin directory (default: C:\Program Files\MUSHclient\worlds\plugins\)
aardsql.lua save to MUSH lua directory (default: C:\Program Files\MUSHclient\lua\)
If you have the latest version of MUSH the file below is included.
mw.lua
Download the file on the site below to the lua directory under the MUSH install directory.
http://www.gammon.com.au/forum/bbshowpost.php?id=8947
2.
If "invmon" is turned on at the MUD when plugin is installed the Plugin will disable this tag and AutoUpdate won't
work I plan to make a set of triggers to solve this.
So before install enter "invmon" until you get "You will no longer see inventory update tags." back from the MUD.
3.
Then install Inventory_Window_2.xml into MUSHclient using the File menu -> Plugins.
http://www.gammon.com.au/forum/?id=9617
4.
After the plugin is installed you need to run the command "inw slist" to load the spells list into the database.
I recommend creating an alias to reload the script from the command line. This is useful if you are editing the settings
in the script file or if the script screws up. Reloading the script won't change setting unless you have edited the script.
I plan to add this alias via the script but for now you'll need to do it manually.
1.
Select and copy between the lines below.
2.
Open "Game -> Configure -> Aliases" or "CTRL+SHIFT+9" menu.
3.
Click the paste button.
--cut--
<aliases>
<alias
match="rlinv"
enabled="y"
send_to="12"
sequence="100"
>
<send>
if ReloadPlugin ("6dbbeddda02ed2390b58ccd9") == error_code.eNoSuchPlugin then
check (LoadPlugin ("/program files/mushclient/worlds/plugins/Inventory_Window_2.xml"))
end
</send>
</alias>
</aliases>
--cut--
Full cut and paste aliases, triggers and timers instructions can be found here:
http://www.gammon.com.au/forum/?id=4777
The settings below will work as default.
A database is created in the plugin directory this can be changed by editing the script file.
change:
db_path = GetPluginInfo (GetPluginID(), 20) .. "\Aardwolfdb.db"
to:
db_path = [[c:\your directory]]
To change the look and behaviour of the plugin open the Inventory_Window_2.xml file
and edit the options below. An editor like Crimson Editor can be configured to display MUSH xml
files with colours making editing MUCH easier.
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=8692
You can find the options below starting at line 316 of Look_Scan.xml, make a backup of
these settings because tests are not done for unreasonable values.
BackgroundColour = "black" -- Background colour for window. Supports Lua codes and MUSH colour names
-- i.e. "2432272" or "black" or GetInfo(271) can be used, this is your current window colour.
TitleColour = "dimgray" -- Title text colour. Supports Lua codes and MUSH colour names.
LabelColour = "dimgray" -- Colour for labels on popups, flags and values in list. Supports Lua codes and MUSH colour names.
SpellColour = "65280" -- Colour for spell names on popups. Supports Lua codes Edit > Colour in MUSH
LevelColour = "6908265" -- Colour for levels. Supports Lua codes. Supports Lua codes Edit > Colour in MUSH
ValueColour = "6908265" -- Colour for values. Supports Lua codes. Supports Lua codes Edit > Colour in MUSH
WeightColour = "6908265" -- Colour for weight. Supports Lua codes. Supports Lua codes Edit > Colour in MUSH
FontName = GetInfo(20) -- Font for window, i.e. "Times New Roman", GetInfo(20) is current window font.
LFontSize = 10 -- List font size.
TFontSize = 8 -- Title font size.
CircleAction = 2 -- Set shape of boxes, 2="square", 3="rounded". popup shap in mw.lua.
BorderWidth = 1 -- Line thickness for display boxes, border width for popups is set in mw.lua.
ButtonGap = 10 -- Space between buttons.
OffSet = BorderWidth + 4 -- Objects offset from window edge.
ItemSpace = 5 -- Space between list columns in points.
LineSpaces = 2 -- Space between inventory list lines.
PopOffSet = 1 -- Number of space characters to place at the begining and end of popup lines.
TitleText = "Inventory" -- Title for window.
BagLabelChars = 12 -- Number of characters to display in bag name on bag button after bag open.
ShowBorders = true -- true = draw title and foot boxes.
-- false = don't draw title and footer boxes.
ShowLineNums = false -- Displays numbered lines that can be use to reference items from the commands line.
ShowValues = true -- Show item values in inventory list (only appear after mouseover and then refresh).
LinesPerPage = 40 -- Number of lines per page in inv list.
MaxDescWidth = 0 -- Max number of chars in Item Description, 0 for unlitmited.
AutoSize = false -- true = adjust window height to inv list size or LinesPerPage
-- false = always size to LinesPerPage.
AlignSide = true -- true = Popup window on left
-- false = Popup window on right.
AlignBottom = false -- false = Popup align bottom of AlignSide.
-- true = Popup align top of AlignSide.
PopupTop = 10 -- Top position of details popup in points
UseCache = true -- "true" = use cached item details from db
-- "false" = get details from MUD each mouse over.
KeepInvDB = false -- "true" = keep a table of current inventory
-- "false" is recommended because inventory table is not used atm
-- and all details are saved in other tables.
ShowWelcome = true -- "true" = Displays msg when script has loaded
-- "false" = No message on install
AutoRefresh = true -- "true" = uses invmon and invitem tags to trigger inventory refresh
It shouldn't interfere with any other plugins, all triggers are turned on and off as
needed if it does please let me know.
To trigger commands in plugin from other plugins use:
Execute (“inw <arg>”)
To view the contents of the database outside MUSH get SQLite Browser:
http://sourceforge.net/projects/sqlitebrowser/
The commands to reference items in a bag using serials is not completed on the MUD. So items in a bag can
be viewed but no details can be gotten from the MUD.
I would not run commands from this plugin on items in bags at all.
Look here for limitations on the MUD commands used for this plugin:
http://www.gammon.com.au/forum/?id=9461
|