lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Nope. Read the section in the manual on coroutines; it'll explain most of what 
you need to know. Searching on "coroutines" in the list archives on 
lua-users.org, and the wiki there, will also be helpful. 

Ben

On Thursday 27 February 2003 03:27 am, teranwong <teranwong@yahoo.com> wrote:
> Thx Ben,
>
> So how to do the sleeping and pass out the control to the main game??
> ^^
> is this function
>         int lua_ref(lua_State *L, int Lock)
> can do that?? thxthx
>
> Teran
>
> --- In lua-l@yahoogroups.com, bsunshin <bsunshin@a...> wrote:
> > It sounds like you'd be most interested in coroutines in Lua 5.0.
>
> They'll
>
> > allow a thread to put itself to sleep during execution, returning
>
> control
>
> > back to C++. Then, you can just wake it up again when a mouse click
>
> comes
>
> > in.
> >
> > Ben
> >
> > On Thu, 27 Feb 2003, teranwong <teranwong@y...> wrote:
> > > Dear All,
> > >
> > > I am new to Lua and also game industry... now I am writing a
> > > scripting server... and stuck in some area... hope some of you can
> > > give me some idea ^^
> > >
> > > when running a script in an Online game and waiting for a mouse
>
> click
>
> > > from user in order to run the next line... I think I should not
>
> keep
>
> > > waiting for the mouse click packet since there are many packets
> > > arrive... and so I want to pass out a pointer or a reference so
>
> that
>
> > > when I get the mouse click packet in next game loop, I can process
> > > the rest of the script... sounds like make sence... but how to do
>
> it
>
> > > with Lua and C++?? is the 5.14 Reference to Lua Objects from the
> > > manual is a way to solve this? pls give me advice ^^ thxthx