lua

Is there a Perl or Lua alternative to Capistrano?

For a number of web-applications I need something like Capistrano to automate deployment. I know Capistrano can be used to deploy non-ruby applications but I'm not familiar with Ruby, so I expect writing deployment configurations can be a bit of a pain. So I was wondering, are there any alternatives to Capistrano written in either Perl ...

Lua equivalent to shlex?

Is there a Lua equivalent for python's shlex library? ...

WOW Addon Development / Events....

Not sure if this is an appropriate programming question or not; but here goes.... I've written a very simple add-on that displays text/plays a sound when certain spells become usable (Overpower / Revenge). But I've been unable to find the appropriate event to listen for to check this. My hack-ish approach is to simply check the state ...

ANTLR grammar license

I'm planning to make an implementation of Lua for the DLR, and i would like to use the listed Lua 5.1 grammar here. However i can't see a license that it was released under, so can someone please kindly point me in the direction of the license it uses? ...

Why Lua is better for game developement than the iPhone Quartz framework?

I have seen lots of information about the Lua scripting language for game developement, but I don't understand why it's more powerful than the Quartz framework. What functionality does Lua give that Quartz does not? ...

How to justify using a scripting language as part of a project

I have a specific project in which I want to use either a scripting language + C, or as an alternative a 100% Java solution. The program adapts a legacy system for use with other moderns systems. Basically, I have few choices as to what language I can use. I have C/C++, Java 1.4, and I have also compiled the Lua for this environment. ...

Calling functions in a Lua table from C++

I have for example, a Lua table/object: bannana And this Lua table has a function inside it called chew, that takes a parameter bannana.chew(5) I have also used SWIG, and have for example a class CPerson: class CPerson { public: // .... void Eat(); // .... }; I can obtain an instance of this object fr...

How to get started with embeddable scripting?

I am working on a game in C++. I've been told, though, that I should also use an embeddable scripting language like Lua or Angelscript, but to be honest, I have no idea how or why. What advantages would this bring me, over storing all of my data in some sort of text file? How do I get started? I tried to read some Lua examples, but I don...

How to load text file into sort of table-like variable in Lua?

Hi, I need to load file to Lua's variables. Let's say I got name address email There is space between each. I need the text file that has x-many of such lines in it to be loaded into some kind of object - or at least the one line shall be cut to array of strings divided by spaces. Is this kind of job possible in Lua and how should...

Calling a Lua function from another thread

In my sample application, I have basically two threads. The main thread contains a Lua engine (which is not thread-safe) and registers some C++ functions into this engine. However, one of these functions takes too long to perform (since it downloads some file over the internet) and I want the Lua engine to continue doing other stuff wit...

Lost references in Lua

Having a problem with objects, not needed any more but still having references. Result: size of allocated memory is constantly growing due to not collected objects. How to solve this sort of problem? Is there any way to find objects with only one reference, or objects with lifetime more than some value? Or any another solution? Using L...

Trouble installing/compiling lua on macosx

I have been attempting to compile/install Lua on Snow Leopard. I have changed the target platform in the Makefile.std to macosx and I still get the following issue: sudo make -f Makefile.std macosx make[1]: *** No rule to make target 'macosx'. Stop make: *** [macsox] Error 2 I also changed the target of the same Makefile.std file in ...

LuaInterface and 64Bit

Ok i'm currently using LuaScript v5.1 in a Game engine i'm using. and the handy LuaInterface that comes along with it. i've tested it on a range of systems running a range of OS's. LuaInterface seems to fail on 64bit Operating Systems. Could anyone point me to a 64bit Compiled LuaInterface.dll, or is there any alternative to the LuaInter...

Problem with luabind::object dereferencing (simplified)

Using C++, lua5.1, luabind 0.7 Lua code: -- allocates near 8Mb of memory function fff() local t = {} for i = 1, 300000 do table.insert(t, i) end return t end C++ code: { luaL_dostring(lua_state, "return fff()"); luabind::object obj(luabind::from_stack(ls, -1)); } lua_gc(l_, LUA_GCCOLLECT, 0); // colle...

Storing a lua class with parent in luabind::object (updated)

Using C++, lua 5.1, luabind 0.7-0.81 Trying to create a lua class with parent and store it in a luabind::object. Lua class 'TestClassParent' function TestClassParent:__init() print('parent init\n') end function TestClassParent:__finalize() print('parent finalize\n') end class 'TestClass' (TestClassParent) function TestCla...

Accessing built-in string hash functions of Lua

Lua has built-in string hashing functionality for storage of strings inside its maps. It is possible to access it? Or is there another string hash function already available in the lua language/libraries? ...

Luabind class deriving problem (memory 'leak')

Using luabind 0.81 Simple test to illustrate the problem: 1) class 'A' function A:__init() print('A init\n') end function A:__finalize() print('A finalize\n') end do local obj = A() end collectgarbage("collect") Output: A init A finalize 2) class 'A' function A:__init() print('A init\n') end function A:__finaliz...

Embed webserver in carbon bundle

I need to embed a tiny webserver in a compiled jsfl external library for Adobe Flash CS4 so that an outside process can communicate with it. The external library will be a Carbon bundle on Mac and a set of dlls on Windows, so the webserver will need to be embedded/loaded from C/C++ code with no external dependencies like Ruby. Most of t...

How to get ANTLR to output hierarchical ASTs?

I have a Lua grammar, (minor modifications to get it to output for C#, just namespace directives and a couple of option changes) and when I run it on some sample input, it gives me back a tree with a root "nil" node and as childs what looks to be a tokenized version of the input code. It looks like ANTLR's tree grammars operate on hierar...

Access violation when exporting a C++ class to Lua using LuaBind

I'm trying to export a simple class to Lua using LuaBind. I took the code from two sites which showed roughly the same way to do it, but it's still failing. // Default headers #include <iostream> #include <string> // Lua headers extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } #include "luabind/luab...