Talk about anything in Runes of Magic. This does not need to pertain to botting.
-
BlubBlab
- Posts: 948
- Joined: Fri Nov 30, 2012 11:33 pm
- Location: My little Pony cafe
#1
Post
by BlubBlab » Wed Jan 21, 2015 9:47 am
I picked the MM2 XML project up again when I last stopped I wanted to add a compatible layer for ROMbot because I can't remeber where I stopped I wanted to runt the code how it is, to see where it ends and what I missed.
I have this code ...
Code: Select all
local xmlDLL = require("LuaXml");
include("Node.lua");
---local stack = {};
XML = class(
function (self)
-- <mylabel,</mylabel
self.stack = {};
self.lastXML = {};
end
);
function XML:pushS(symbol)
table.insert(self.stack, symbol)
end
function XML:popS()
-- = stack[#stack];
local entry = table.remove(self.stack,#self.stack);
return entry;
end
function XML:load2(file)
self:validXML(file)
self.lastXML = xmlDLL.load(file);
return self.lastXML;
end
function XML:open(file)
--TODO: add file checks
local xml_load = self:load2(file)
local node = parse(xml_load)
return node;
end
I added the waypointlist form Rombot but what I got is:
Code: Select all
Failed to run init function, err code: 7 (Runtime error)
Xml.lua:33: attempt to call method 'load2' (a nil value)
stack traceback:
Xml.lua:33: in function 'open'
waypointlist.lua:24: in function 'load'
main.lua:46: in function <main.lua:10>
Some how I'm blind I don't get why MM won't find the load2 function ???
-
Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
#2
Post
by Administrator » Wed Jan 21, 2015 12:23 pm
My guess is that 'self' isn't a proper XML object in XML:open(). Try XML:load2() instead of self:load2() for clarity.
If that doesn't help, can you show your main.lua's init function?
-
BlubBlab
- Posts: 948
- Joined: Fri Nov 30, 2012 11:33 pm
- Location: My little Pony cafe
#3
Post
by BlubBlab » Wed Jan 21, 2015 1:51 pm
True it was something like that, but it seems to work now
Who is online
Users browsing this forum: No registered users and 1 guest