lua

Convert Lua data in asp.net?

Hi all, is there an easy way in .Net to convert Lua table to something else (XML, datatable, array etc.) I google it for few hours but i don't ask google right or there is no easy way :-) Thanks! ...

Lua/SWIG wrap userdata from within Lua

I am using swig-lua. I have a function in Lua which I call and it returns me a pointer (userdata). right now I know what this pointer is, but how can I tell Lua from within Lua? ...

LuaInterface - how to register overloaded methods?

Hello world! I'm trying to integrate Lua to my C# app when I hit a little snag. I was hoping someone with more expertise could help point me to the right direction. Let's say I have the following C# methods: public void MyMethod(int foo) { ... } public void MyMethod(int foo, int bar) { ... } I would like to register it to my Lua scri...

Avoiding string copying in Lua

Say I have a C program which wants to call a very simple Lua function with two strings (let's say two comma separated lists, returning true if the lists intersect at all, false if not). The obvious way to do this is to push them onto the stack with lua_pushstring, which works fine, however, from the doc it looks like lua_pushstring but ...

using sqlite3 with lua

I'm trying to use sqlite3 with lua (am already using c++, but I'm a n00b with lua- I read this) but I'm getting the following when trying to build the library or whatever: C:\lib\lsqlite3-7>mingw32-make process_begin: CreateProcess(NULL, pkg-config --version, ...) failed. makefile:53: *** windows32. Stop. I'm not at all surprised at ...

Compact web server with Lua support?

Hello, I need to find a very compact, cross-platform web server that can run Lua scripts, ie. either a regular web server like Mongoose that will forward queries to a Lua program in eg. FastCGI, or a web server itself written in Lua which will save the need to provide a separate web server. I recently started learning about Lua so am s...

SWIG-Lua question on class returning another class

I am concreting a question I had earlier. I have two classes in C++ and I use SWIG to wrap them. A method in one class can return a pointer to the other class. How can I get Lua to see it as more than just a userdata? More concretely: I have class fruit { int numberofseeds; //some other stuff about fruit constructors etc... ...

How to open wav file with Lua

Hello, I am trying to do some wav processing using Lua, but have fallen a the first hurdle! I cannot find a function or library that will allow me to load a wav file and access the raw data. There is one library, but it onl allows playing of wavs, not access to the raw data. Are there any out there? Cheers, Pete. ...

_REQUIREDNAME always nil

I'm trying to use the method for naming a lua package after the filename mentioned here, however _REQUIREDNAME is never defined. For example I have these two files samplePackage.lua: print("_REQUIREDNAME: ", _REQUIREDNAME) return nil; packageTest.lua: require "samplePackage" And when I run packageTest.lua it outputs > _REQUIREDNAM...

Why doesn't luazip extract files when called from c++ application?

I have a c++ application that interfaces with lua files. I have a lua file that extracts zip files, which works when I run it using SciTe or the Lua command line. But when I try to run it from a c++ application it doesn't seem to work. require "zip" function ExtractZipFiles(zipFilename, destinationPath) zipFile, err = zip.open(zip...

Lua library/wrapper for cryptography

Hi, I'm looking for a library or wrapper for Lua to use some cryptographic functions. Initially I only need to create SHA-1 hashs. Any tips or suggestion are appreciated. ...

QuadTrees - how to update when internal items are moving

I've implemented a working QuadTree. It subdivides 2-d space in order to accomodate items, identified by their bounding box (x,y,width,height) on the smallest possible quad (up to a minimum area). My code is based on this implementation (mine is in Lua instead of C#) : http://www.codeproject.com/KB/recipes/QuadTree.aspx I've been able ...

Does LuaCrypto run on Windows?

I need to run LuaCrypto on win platform. Does anyone know how to do it? ...

Lua and Objective C not running script.

I am trying to create an objective c interface that encapsulates the functionality of storing and running a lua script (compiled or not.) My code for the script interface is as follows: #import <Cocoa/Cocoa.h> #import "Types.h" #import "lua.h" #include "lualib.h" #include "lauxlib.h" @interface Script : NSObject<NSCoding> { @public s...

Get the lua command when a c function is called

Supposed I register many different function names in Lua to the same function in C. Now, everytime my C function is called, is there a way to determine which function name was invoked? for example: int runCommand(lua_State *lua) { const char *name = // getFunctionName(lua) ? how would I do this part for(int i = 0; i < functions.siz...

How to I create include files in Lua language.

I want to create a header file in lua (header.lua), then do the "require" function to load it. How do I do require a file that I have created? Thanks ...

lua userdata c++ destructor

In lua, for memory allocated with lua_newuserdata, is it possible to register a destructor, so that the destructor is called when the memory region is garbage collected by lua? Thanks! ...

Lua class instance with nested tables

Hello, Simple lua game with simple class like so: creature = class({ name = "MONSTER BADDY!", stats = { power = 10, agility = 10, endurance = 10, filters = {} }, other_things = ... }) creatureA = creature.new() creatureB = creature.new() creatureA.name = "Frank" creatureB.name = "Zappa" creatureA.stats.agility = 20 creatureB.s...

interactive lua: command line arguments

I wish to do lua prog.lua arg1 arg2 from the command line Inside prog.lua, I want to say, for instance print (arg1, arg2, '\n') Lua doesn't seem to have argv[1] etc and the methods I've seen for dealing with command line arguments seem to be immature and / or cumbersome. Am I missing something? ...

Lua interpreter on Iphone

Is it possible to run Lua interpreter on the iphone? If yes, are there any libraries that have bindings to Iphone's SDK? If its not possible with Lua, what are the other language options? ...