Question

I'm trying to use the LuaXml module in my world of warcraft addon. Every time I test the addon I get an error that I am calling a nil value with require(). I suspect that this is because the thing I am requiring has not loaded correctly. From looking at the LuaXml.lua file it seems that it requires LuaXML_lib.dll. However, I am unsure how to get this to load into the addon. I have all of the files in the proper addon folder and in my .toc file and I believe they are in the correct order.

I suspect that I need to do something with LuaBinaries. I put the folder Microsoft.VC80.CRT in the addon folder and put msvcr80.dll in that folder. I feel like I need a .lib file to link this to my lua files but I'm not sure.

After doing all this I feel lost. Any advice/next steps/corrections would be appreciated!

Was it helpful?

Solution

The World of Warcraft Lua environment is extremely restricted.

The following are prohibited:

  • Interaction with external applications (e.g: connecting to the Internet)
  • Storing information in a custom manner
  • Interaction between "protected states" (e.g: minimap and spell casting UI)

These restrictions are in place to prevent people from making automated bots, UI hacks, and other things that count as "cheating".

Also, to make it clear to programmers that is very different to the standard Lua environment, they have removed the require and module functions. Instead, they have the .toc file, which is used to declare all the files needed by an addon.

Unfortunately, this also means you cannot load any DLLs or other non-Lua files. As LuaXML requires a DLL file, it cannot be used by World of Warcraft.

I haven't programmed for World of Warcraft in a while, so I am not aware of any solutions specifically for it; there are plenty of pure Lua libraries available, however. A little bit of Googling and you'll find them.

I must ask though.. why do you want to parse XML in World of Warcraft? I see no reason for you to store anything in XML, nor am I aware of anything that you would need to parse.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top