Miniwindows - basics, about how to create a miniwindow

Posted by Mazarin on Wed 15 Sep 2010 07:54 AM — 3 posts, 15,259 views.

#0
Hi all!

I have been playing now a bit trying to start with miniwindows (I want to keep track of available potions) after beeing able to finish my combat-trigs. Thanks for the help I've got so far. Without it I would still be where i was when starting!

However, about miniwindows, the first example in the helparticle "Miniwindows in MUSHclient - Create / move / resize" gives an error message. The text:
"win = "test_" .. GetPluginID () -- get a unique name, ensure not empty if outside plugin
WindowCreate (win, 0, 0, 200, 200, miniwin.pos_center_all, 0, ColourNameToRGB("white")) -- create window
WindowShow (win, true) -- show it "

gives when run in immidiate mode as suggested in the article the message:
"Run-time error
World: Aardwolf
Immediate execution
[string "Immediate"]:2: attempt to index global 'miniwin' (a nil value)
stack traceback:
[string "Immediate"]:2: in main chunk"

though I have only copied and pasted the text from the example given in the article without making any changes?

Anyone knows what might be wrong?

Thank you in advance, regds

// Mazarin
USA #1
Which MUSHclient version are you using? The miniwin table was added in 4.52:

Quote:
10. Added miniwin table of constants into the Lua script space.

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

This lets you use symbolic names (like miniwin.brush_hatch_horizontal instead of 2).

[Commit 754a918]
Australia Forum Administrator #2
Correct. On this page for example:

http://www.gammon.com.au/mushclient/mw_creation.htm

I noted "Lua note: Instead of numbers you can use the above "symbolic constants" in Lua (version 4.52 onwards).".

Those pages were recently updated to use the miniwin constants, and if you are using an earlier version they won't work.