I am trying to use the class implementation from:
http://class.luaforge.net/
It works fine in the lua 5.1.3 interpreter on my linux box. But when I create a simple plugin to use the class, I get this error in Mush:
I don't know enough about lua to figure it out. I could use some help.
Thanks,
Eric
Here is the plugin
http://class.luaforge.net/
It works fine in the lua 5.1.3 interpreter on my linux box. But when I create a simple plugin to use the class, I get this error in Mush:
Run-time error
Plugin: Test_Plugin (called from world: Aardwolf)
Immediate execution
C:\Program Files\MUSHclient\lua\class.lua:136: bad argument #1 to 'unpack' (table expected, got nil)
stack traceback:
[C]: in function 'unpack'
C:\Program Files\MUSHclient\lua\class.lua:136: in function <C:\Program Files\MUSHclient\lua\class.lua:134>
C:\Program Files\MUSHclient\lua\class.lua:370: in main chunk
[C]: in function 'require'
[string "Plugin"]:1: in main chunk
I don't know enough about lua to figure it out. I could use some help.
Thanks,
Eric
Here is the plugin
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Test_Plugin"
author="Bast"
id="76c897dda20af89787c6b438"
language="Lua"
purpose="Test class stuff"
date_written="2008-12-24"
requires="4.37"
version="1.0"
save_state="n"
>
</plugin>
<script>
<![CDATA[
require 'class'
class "Window"
function Window:initialize(targs)
--[[
init the class, named arguments only
the named arguments are
name, title, text, font, background_colour
title_colour, hyperlink_colour, windowpos,
title_width, title_colour, title_text_colour,
text_colour, ishidden
--]]
self.name = targs.name or "Default"
end
print("making window")
questwin = Window{name="Quest"}
]]>
</script>
</muclient>