I'm working on a small project for the iPad and I simply want to run a script that will halt after certain function calls and then let me resume the script from the same place later on. In fact I only do 'threads' one at a time in a queue so it's really only multitasking between the iPhone OS and Lua.
static int yield__ (lua_State *L) {...
I was having a discussion with my friend the other day. I was saying how that, in pure Lua, you couldn't build a preemptive multitasking system. He claims you can, because of the following reason:
Both C and Lua have no inbuilt threading libraries [OP's note: well, Lua technically does, but AFAIK it's not useful for our purposes]. Wind...
The documentation for Lua for Wireshark claims that the Tvp class has a new_real() method.
However, this method seems to not exist when I try to use it in my Lua script.
I'm using Wireshark 1.3.5 (latest dev version) for Windows x64.
Did the method get renamed? If so, to what? Is there a better support forum for this particular question?...
I've been playing around with node.js (nodejs) for the past few day and it is fantastic. As far as I can tell, lua doesn't have a similar integration of libev and libio which let's one avoid almost any blocking calls and interact with the network and the filesystem in an asynchronous manner.
I'm slowly porting my java implementation to ...
I'm creating a game and currently have to deal with some math.randomness.
As I'm not that strong in Lua, how do you think
Can you make an algorithm that uses math.random with a given percentage?
I mean a function like this:
function randomChance( chance )
-- Magic happens here
-- Return either 0 or 1 based on the ...
Seems easy but I just don't get any further:
Take this example:
local myTable = { 'a', 'b', 'c', 'd' }
print( myTable[ math.random( 0, #myTable - 1 ) ] )
Why doesn't it work?
Google seems to have no answers on this either
...
I'm having a huge nightmare with these subclasses and I can't figure out why this isn't working.
I have main class BODY with a subclass RECTANGLE. BODY has a function called SetWorld which does the following
function BODY:SetWorld( worldnum )
self.world = worldnum
end
Now, if I do this:
rect = RECTANGLE:new()
rect:SetWorld(1)...
My script runs fine when I execute it from outside the application (terminal), but when its called from inside the C++ application it shuts down in the require("luasql.mysql") call.
Can anyone help?
...
We're developing some code on Freescale PPC micros (5517 and 5668 at the moment), and I was wondering if we could put Lua on them.
The devices need to be easily programmed/reconfigured in the field, and the current product uses a proprietary interpreted logic language that can be loaded in, and our software (written in C) runs an interp...
What is the point of lua_lock and lua_unlock?
The following implies it's important:
LUA_API void lua_gettable (lua_State *L, int idx) {
StkId t;
lua_lock(L);
t = index2adr(L, idx);
api_checkvalidindex(L, t);
luaV_gettable(L, t, L->top - 1, L->top - 1);
lua_unlock(L);
}
LUA_API void lua_getfield (lua_State *L, int idx, con...
Is it possible to use Lua with Google App Engine? I recognize that there will be a lot of Java glue, but I would like to use Lua for most of the logic.
...
I have a program with 4 threads.
Within each thread, I do a luaL_newstate();
Each thread only has access to it's own lua instance.
Is there anything I need to worry about? [I.e. is there some hidden state that all lua instances share behind my back?]
Thanks!
...
Question: how can I insert a table from C# into 'LuaInterface' script scope using a C# object (preferably anonymous type)?
/// I want to do this, but it does not work
/// (complains that 'test' is userdata and not table
/// when I pass it to pairs() in the script)
//lua["test"] = new { A = 1, B = 2 };
/// another option
/// but build...
Apparently Apple has changed some term in the agreement again.
From http://www.appleoutsider.com/2010/06/10/hello-lua/
section 3.3.2 is now
Unless otherwise approved by Apple in writing, no interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-i...
Background:
I have been working on a platformer game written in C++ for a few months. The game is currently written entirely in C++, though I am intrigued by the possibility of using Lua for enemy AI and possibly some other logic. However, the project was designed without Lua in mind, and I have already written working C++ code for m...
Is it possible for a piece of lua user data to hold reference to a lua object? (Like a table, or another piece of user data?). Basically, what I want to know is:
Can I create a piece of userdata in such a way taht when the gc runs, the user data can say: "Hey! I'm holding references to these other objects, mark them as well."
Thanks!
...
Is there any possibility to connect webservice using Lua Language in Scite editor? Otherwise Please help me how to connect webservice with Lua Language.
...
I'm making a IRC client using LUA. I'm using the the libraries that came with "Lua for Windows ". So I'm using luasocket for the comms and IUP for the UI bits.
The problem I'm having is that I'm getting stuck in a loop when I read the IO. I tried the timer in IUP but that didn't seem to work.
I'm was looking for a way to delay the IO r...
How to iterate through luabind class (in lua or in c++)?
class 'A'
function A:__init()
-- Does not work
-- self is userdata, not a table
for i, v in pairs(self) do
end
end
Thanks
...
How to override luabind class __finalize method?
Trying to do this in such way:
class A
function A:__init()
end
function A:__finalize()
end
local original_finalize_function = A.__finalize
A.__finalize = function(...)
-- some custom logic
if original_finalize_function then
original_finalize_function(unpack(arg))
end
end
local...