Hi Luke,
Great to see someone working on this!
I have an early demo I worked on here:
Note that Wow does not provide a "normal" lua environment. It's necessary to work around some missing methods, etc. You can see where I did that in the repo.
The reality for now is that the lua target is still in alpha stage. You can get things working with some effort, but there's some rough edges. However, there's been some nice improvements necessary for proper wow scripting support : lua 5.1 support, and multireturn support. You'll find these features in the development branch. However, they're still undocumented.
You can simplify your UnitName extern definition with:
@:native("_G")
extern class Wow {
public static function UnitName(arg:String) : UnitNameResult;
}
@:multiReturn
extern class UnitNameResult {
var name : String;
var realm : String;
}
You can then use the method as follows:
var res = Wow.UnitName("player");
print(res.realm);
It's a lot easier to deal with than using untyped code.
Keep on the lookout for more lua extern features. This is under active development right now.
Best,
-Justin