I'm a bit confused

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

I'm a bit confused

#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

xml = XML()

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 ???
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: I'm a bit confused

#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?

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: I'm a bit confused

#3 Post by BlubBlab » Wed Jan 21, 2015 1:51 pm

True it was something like that, but it seems to work now :D
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest