Examples of what you can do with miniwindows

Posted by Nick Gammon on Tue 02 Sep 2008 11:55 PM — 51 posts, 230,580 views.

Australia Forum Administrator #0

Below are some screenshots of a plugin I am working on, to show inventory details. Notice the tabbed window - each tab is a hotspot, and if you click on it, the window is redrawn with the appropriate inventory items filtered into the main view. The filtering reduces the amount of space needed to show the entire inventory, as well as grouping thing together logically.

Also, as you mouse-over each item, a "rollover" window appears which gives more details about that item, resized to exactly fit what needs to be said:


The second screenshot shows how the rollover window is smaller, for a different item. Also in the main inventory window you can see multiple items (5 x Ring of Demonslaying):

There is also provision for managing multiple "pages" of inventory, by clicking on the "Next" or "Previous" buttons to scroll through the inventory.


The third screenshot shows an example of responding to mousedown/mouseup. This pops up an "action" menu so you can choose what to do with this item:

The popup menu code is not available yet - this will be released in MUSHclient version 4.37.


Another rollover window appears if you mouse-over the inventory header - this shows a summary of the inventory contents (or bag contents, as in this case):


Predictable behaviour of the actions has been facilitated by extra code being added to Aardwolf by Lasher, which gives each item a unique "id" (which is shown at the bottom of the rollover window). This removes confusion about dropping 2.sword or wearing 4.shield, which can be hard to manage if you pick up and remove items.

This plugin is not available yet, it is a work in progress, however I hope that what has been achieved so far will inspire other plugin authors to do similar things for their MUDs.

USA #1
Really nice work, Nick! As usual. :)
Netherlands #2
I'm definately inspired. And looking forward to seeing a chatwindow come out since that one has a lot of potential as well in my eyes. =)
Germany #3
i was thinking about such a plugin, to make MUD look out more Diablo-like, first with MXP, later with miniwindows. But what You already made is really great!
Amended on Wed 03 Sep 2008 12:34 PM by Erendir
USA #4
Damn, Nick. That is impressive :)
#5
I, too, am impressed and inspired! Now, where can we get Lua code (OOP, right?) that will do these types of things for us more easily? :)
USA #6
Hey Larkin, my InfoBox lua module actually started as nick's HP Bar plugin (I think the If Percent then GoodColour else BadColour still is recognizable, especially all the Aussie U's in Colour all over the place. ;))

I'll probably end up doing the same thing when he makes this plugin available.
USA #7
The miniwindow showing "The Grand City of Aylor" is that output from the mud or is that a plugin mapper?
#8
Output from the MUD (Continent map), being directed to another window.
#9
Err.. that's the overhead map, sorry (I'm a bit sleepy)... the continent map is a whole 'nuther beast. Answer is the same, it's MUD output.
USA #10
OMG, that's so cool, I /really/ need to start learning Lua, but I find myself falling asleep when I try to read the documentation, they really drone on, is there anything out there that just shows a side by side comparison of the syntax in one language and the syntax in Lua? I'd find that a bit more useful to start with(I could learn the more advanced stuff later) than it trying to explain it all to me like I just started coding yesterday. Also something with examples would be good. I can't really think of how a plugin like this would be immediately useful to me on the game I play(at least at the moment, I'm sure I could think of something), but it's still awesome. Hmm, to display the equipment data, does it use the same request/trigger method as the Grab plugin, or does it store the relevant data in memory, or is that just the output from the game put into the window?
USA #11
Have you tried PiL? http://www.lua.org/pil/
You might have to start skimming from time to time but it's much better for getting a quick introduction to the language than the manual (which is really a reference and not a guide). It also has several examples. It doesn't have a syntax comparison but frankly you shouldn't need one if you go through the book just a little bit and look at the examples.

And yes, I've already told Nick, but these examples are stupendous.
#12
Nick

How do you get the ID tags for equipment? I'm guessing that you can use normal commands on them (get, take etc). I'd love to have access to these for my own scripts, but can't find out where they come from.

Australia Forum Administrator #13
Lasher has been adding some extra commands to support them - I'm not sure if they are on the live server yet. We are still in the process of working out what information needs to be exchanged between client and server, so the design may be subject to change.
USA #14
OMFG! I have been away for so very long, only to check in on what has been accomplished in the newer versions, and ... WOW. I cannot believe all the new features that have been added, , plugins for Aardwolf, and all that Mushclient can now do.

When I have time to look into how to use these features I will have to learn my arse off.

-Onoitsu2
USA #15
Any more progress made on this idea, and functions of miniwindows?

Or perhaps a timeline on expected completion on changes as communicated from Lasher?

-Onoitsu2
#16
Wow those are pretty awesome! I'm trying to wrap my mind around how to create these. I'd love to make a miniwindow like that with the tabs to keep track of data.
Australia Forum Administrator #17
Quote:

Any more progress made on this idea, and functions of miniwindows?


Well this project slowed down a bit, and I'll tell you why ...

When I first did the "proof of concept" shown on page 1, I rattled it off fairly quickly, with the result that it worked quite well for a single inventory.

However I then wanted to extend it to also show your equipped items, and possibly also what a shop sells you. Then the plan was to drag-and-drop items (eg. drag from inventory to equipped, or vice-versa).

The problem was my coding design was for one window, not lots of them, and I have had to do a fairly major rewrite, to make it more general. For example, a mouse-down on an window (or a mouse-over) could be the equipped window, or the inventory window.

Now that the summer holidays are over, I'll take another look and try to get it finished.
USA #18
Heck yeah, you rock Nick. I've never seen another coder with as much spirit towards what they do, such as yourself. Nor another coder that assisted others in their endeavors like yourself either.

Hope all goes well on this project, and it might bring me back to mudding on Aardwolf again.

-Onoitsu2
#19
Ooo! This looks really awesome. :) Please continue working on it! (When you have time, of course.)

One thing I'm wondering, though -- do the stats come from a master database with id numbers? (And if yes, :O) Or do they come from lore/id/etc? How's it stored..? Just wondering whether I have some hope of having an eq db on mush. XD I still switch to zmud to do it at the moment.
Australia Forum Administrator #20
The stats are delivered on-the-fly using a special request/reply sequence Lasher and I worked out. It looks something like this:



Client sends:

invdetails 2067752

Server replies:

{invdetails}
{invheader}2067752|0|3|Weapon|3|2wield|v3|||||1|
{weapon}spear|5|pierce|Pierce|
{statmod}Dexterity|1
{/invdetails}


The number is the item "id" number which is now generated for every item on Aardwolf. There is no central database, although you could gradually build one up, it may not be accurate because of item enhancements.
#21
Interesting. So it requests from the server...so say I have a lucky resonated item, it'd still have the same id number as the normal item? Hrm that makes it a bit more difficult...especially with those stat-randomly-generated items.

Ah well. My eq db is created from identifying my own eq...it's a bit of a pain switching to zmud to do it, but I don't play as much any more so I guess it doesn't really matter. XD Come to think of it, I could probably write to a text file then import that to Excel from mush..ah well never mind.
Australia Forum Administrator #22
MUSHclient now has SQLite database support, so you could eventually put everything in that.
Australia Forum Administrator #23
Quote:

say I have a lucky resonated item, it'd still have the same id number as the normal item


No, I think every instance of an item gets its own ID.
#24
Ah, I'll look forward to that, then! :)

SQLite database.. ._. Hrm will go and look around, didn't think I'd seen it in the menus but it might be hidden.
Australia Forum Administrator #25
It's not in the menus - scripting only.
USA #26
So yeah, it's been like *checks watch* months. Is this script available for use? The screen shots look fantastic, and if it works, I would love to have that to help sort out the hundreds of items in my inventory at nearly all times.

That, and well, I want to steal various bits of code.
Australia Forum Administrator #27
*Takes watch off and shakes it - looks doubtfully at watch.*

My code isn't complete, I saw some major design issues at the time, and then got a bit bogged down fixing them.

One major issue is that the tabbed window look was implemented in such a way (basically, with global variables) that I couldn't have two or more of them.

After seeing how fantastic the inventory looked, I wanted to have a similar window elsewhere for a shopkeeper, and a third for what you have equipped, and drag and drop between them. Now the drag and drop code went in, but my mind boggled a bit trying to re-implemented the tabbed look in a more general way.

I already released part of it, the code for doing the mouse-over information windows, which is practically identical to what I used:

http://www.gammon.com.au/forum/?id=8947

If you are keen, I can post the code for the inventory window bearing in mind it isn't perfect, and someone who is particularly enthusiastic can rip it apart and make it work better.
USA #28
I'd be willing to help beta test/debug, Nick. The window and screen shots on page one look utterly fantastic.

I would love to be able to implement this, and i spend alot of time debugging/fixing scripts people throw my way, so it's no problem to work on this one.

I'm sure other would also be willing to help, if you post it.
Australia Forum Administrator #29
OK, after some minor changes this appears to work as far as it goes. :)

http://github.com/nickgammon/plugins/blob/master/aardwolf/Aardwolf_Inventory_v3.xml

This code is released "as is", it has design flaws, in particular the way it is written it will be hard to make another window for shops or equipped items. It needs major work to make things like the tabbed window be able to be instanced more than once.

When first used it tries to get spell information. I got an error when doing that, but after closing and re-opening the world it seemed to go away, so not sure about that.

The basic way it works is, when getting an inventory, it turns on tags to get this sort of stuff:


{invdata}
62567556,,a short stabbing sword,44,5,0,-1,-1
62567535,HKG,a long sleeved @RAard @YZoo@w tshirt,21,7,1,-1,-1
62567534,,@G(>@rBlood@WStone @rGauntlets@G<)@w,41,7,1,-1,-1
62567533,HI,@r:@W:@y:@WSmooth Moves@y:@W:@r:@w,41,7,1,-1,-1
62567532,,@G(>@YW@yh@Yi@ys@Yp@ye@Yr@ys @Wof the @YE@ya@Yr@yt@Yh@G<)@w,41,7,1,-1,-1
62567531,,@G(>@YW@yh@Yi@ys@Yp@ye@Yr@ys @Wof the @YE@ya@Yr@yt@Yh@G<)@w,41,7,1,-1,-1
62567530,,@W(>@cAs@Cura@W's Az@Buri@Wte P@Cea@crl@W<)@w,41,7,1,-1,-1
62567529,HKG,a hero's leggings,21,7,1,-1,-1
62567528,,@WCan@ytera Ado@Wquin @GBo@Wdy Ar@Gmor@w,41,7,1,-1,-1
62567527,HKG,@B-@Y)@BM@bask @Bo@bf @BP@brediction@Y(@B-@w,41,6,1,-1,-1
62567526,G,a bright ball of light,0,1,1,-1,-1
62567525,G,a bright ball of light,0,1,1,-1,-1
62567524,,@yhenchman's leather vest@w,54,7,0,-1,-1
62567523,,a six shot rifle,54,5,0,-1,-1
62567522,,@yhenchman's leather vest@w,54,7,0,-1,-1
62567521,,a six shot rifle,54,5,0,-1,-1
62567520,,@yhenchman's leather vest@w,56,7,0,-1,-1
62567519,,a six shot rifle,54,5,0,-1,-1
62567518,,@yhenchman's leather vest@w,54,7,0,-1,-1
62567517,,a six shot rifle,54,5,0,-1,-1
62567515,G,blood shot eye,18,3,0,-1,-1
62567514,,scale of the enforcer,34,7,0,-1,-1
62567513,,scale of the enforcer,32,7,0,-1,-1
62567511,G,a bright ball of light,0,1,1,-1,-1
62567510,,@yhenchman's leather vest@w,52,7,0,-1,-1
62567509,,a six shot rifle,54,5,0,-1,-1
62567508,,the quivering palm style,48,5,0,-1,-1
62567507,,the dragon style,38,5,0,-1,-1
62567506,,the scorpion style,39,5,0,-1,-1
62567505,,the centipede style,41,5,0,-1,-1
62567504,K,the iron head style,44,5,0,-1,-1
62567503,K,chin kang palm,35,5,0,-1,-1
62567502,,@WS@we@Wa@wr@Wi@wn@Wg @wB@Wl@wa@Wz@we,20,5,1,-1,-1
62567501,,@WG@wa@Wv@we@Wl @wof @WJ@wu@Ws@wt@Wi@wc@We@w,50,5,1,-1,-1
62567500,K,a @gsmall bag@w,0,11,0,-1,-1
62567492,K,a @gsmall bag@w,0,11,0,-1,-1
62567486,K,Hretan's Battlegear,35,7,0,-1,-1
62567485,G,a heavy slab of granite,36,7,0,-1,-1
62567484,HK,Vladia's Shopping List,1,10,0,-1,-1
62567483,K,a hemp bracelet,20,7,0,-1,-1
{/invdata}


Then as you mouse-over your inventory it tries to get more details about an item, eg. by sending "invdetails 62567534" it gets:


{invdetails}
{invheader}62567534|41|Armor|5600|5|hands|unique, magic, burn-proof, v3||House of Touchstone||2|||60
{statmod}Damage roll|4
{statmod}Dexterity|2
{statmod}Strength|2
{/invdetails}


(see next page for screenshot of what this looks like)

This is used to display the mouse-over floating window. The details are then cached so it doesn't need to get details for 62567534 again in that session.

<advertisement>
The details are cached to save time and make the plugin much more responsive than it would have been without the caching.
</advertisement>

If you make improvements to the plugin I am happy to pull your changes back into my copy for general release.
Amended on Fri 21 May 2010 10:08 PM by Nick Gammon
Australia Forum Administrator #30

This is a screenshot of the data I showed above:

Australia Forum Administrator #31

Hidden away in the plugin is an idea I was working on - a "rating" for weapons. See below, the rating is circled. This is calculated based on the "standard" damage a weapon of a certain level does, and indicates if this weapon does more or less than the standard damage. It is intended to see if the weapon is "better" than another one, for its level.

Australia Forum Administrator #32

If you hit the "combine" link, then multiple items of the same type are combined, to save space and where you don't care for the mouse-over detail about each one:

Australia Forum Administrator #33
I have added the "movewindow" code to the above plugin.

http://github.com/nickgammon/plugins/blob/master/aardwolf/Aardwolf_Inventory_v3.xml

In particular, in this commit:

http://github.com/nickgammon/plugins/commit/268a89ca386


You can now drag the inventory around by clicking on the top line of the inventory, however not on the part saying "- Inventory -" because if you mouse-over that particular spot a summary of your inventory appears. However to the left or right of the center should work.
Australia Forum Administrator #34

Example of the inventory summary (mouse-over the middle of the top line):

Australia Forum Administrator #35
Nick Gammon said:


When first used it tries to get spell information. I got an error when doing that, but after closing and re-opening the world it seemed to go away, so not sure about that.



The problem there turns out to be that the spell information is too long and the server truncates it, or disconnects you.

As a workaround, if you close the world and re-open at least some of the spell stuff is saved, and it works more or less.
#36
I tried to load this plugin on the new Aardwolf Plugin Setup and could not get a inventory window. The plugin would load. Are there any suggestions at getting it to work?
Australia Forum Administrator #37
I'm not sure that Aardwolf sends out the codes I used when I wrote this. Make sure that the inventory tags are turned on (they may have only been on the test server).

Try asking on the Tech channel in Aardwolf, someone there may be able to help.
#38
Reading though this thread a few times I think Im a little confused as to what the problem is. Is there difficulty with listing different items on another tab of the same miniwindow, or is it a problem of wanting to write another entire window with its own tabs and the two conflicting?

Personally I could do without the drag-and-drop functionality, I think the "action mouseclick popup" is more than enough. What I would like to be able to do is only have one miniwindow with tabs like this, but then have the tabs be along the lines of:

"Inventory" "Equip" "Score" "Skills" "Map?"

So I guess thats why it comes down to whether its a problem of drawing inventory and equipment off of two tabs on the same window, or two entirely different windows.
Australia Forum Administrator #39
I think you are referring to a different problem here. The earlier problem was that to have two "inventory-like" windows was a major rewrite because I used names in the plugin that didn't lend themselves to duplication. For example, a window for a shop, a window for your equipped items, and a window for your inventory.
#40
So, with the understanding that I would have to tailor the output for each tab to match the information for my own mud, is something like what Im describing workable with this plugin? I know I can make separate windows, one for inventory, one for worn equipment, one for score, etc, but having them together with the tabs looks very clean and space saving.
Australia Forum Administrator #41
Yes that should be achievable. Instead of splitting into tabs by category you could split by what you said.
#42
Hi, when I try to load v3 into Aardwolf I get this error,

Line 79: Elements terminated out of sequence, expected </meta>, got </head> (Cannot load)

Is there anything im doing wrong or somthing I can change easily for it to work?
Australia Forum Administrator #43
There is no </head> in the plugin. Sounds like you have a web page.

Follow the link to GitHub, then use the Download button to get a copy of the plugin.
USA #44
Do I need additional plug-ins for the inventory window to be displayed (playing aardwoldf)?

I added AFK_Detector, Playing_Detector, and Create_World_File as well as Aardwolf_Inventory_v3 from the repo.

All I get is:
{/invdata}
my
inventory
listed
as item
numbers, etc
{/invdata}

displayed in the main window twice, so I feel like I am missing something to handle sending this to a separate window and squelching the main output. The drop trigger seems to activate the same as above.

Thanks in advance.
USA #45
http://sites.google.com/site/dontarion/MUSH.png

That is my example of what you can do with miniwindows. I haven't actually made the Info display information look pretty yet but eventually I will. Each button works.

[EDIT]I couldn't make any sort of image tag work so it's just a link.
Amended on Sun 08 Jan 2012 08:05 PM by Dontarion
Australia Forum Administrator #46


Images are restricted to forum administrators, to avoid abuse. :)
Finland #47
Nick Gammon said:

Images are restricted to forum administrators, to avoid abuse. :)


has there been a problem with abuse before? if not, why unnecessarily gimp out the forum software?
Australia Forum Administrator #48
No, because people can't post images. :)
#49
Can someone help me? I can load the plugin, but nothing happens other than the load message.
Australia Forum Administrator #50
What plugin? Please don't post in multiple threads on the same topic. Is this something to do with the inventory plugin?

Other thread:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=12491