Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
intoK
Apprentice


Joined: 18 Feb 2007
Posts: 190

PostPosted: Sun Oct 26, 2008 11:19 pm   

[2.36 lua] zs.waitsignal
 
well, understandably waitsignal wont take branch arguments from lua,
but it would be quite simple to implement to have it return true/false depending whether it got signal or not and realize branching from lua, no?

as it is, waitsignal from lua works like wait with interrupt option, btw. it also dosnt clears signal flag
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Oct 27, 2008 4:51 pm   
 
There really isn't any good way to do this. Lua has it's own threading model. Mixing Lua with the CMUD threading model is pretty undefined at the moment. I probably shouldn't even let you call stuff like "waitsignal" from Lua.

#WAITSIGNAL is a command in CMUD. It is not a function and therefore doesn't return any results. In Lua, everything is a function. But calling zs.command where "command" is a #command in CMUD isn't going to return anything.
Reply with quote
intoK
Apprentice


Joined: 18 Feb 2007
Posts: 190

PostPosted: Mon Oct 27, 2008 4:59 pm   
 
idk, you did very nice job with mt engine and lua's mt support wo any extensions is quite limited - would be nice to have it combined somehow Wink
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Oct 27, 2008 5:06 pm   
 
You could try using the #lua command to call routines before and after a #waitsignal.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
intoK
Apprentice


Joined: 18 Feb 2007
Posts: 190

PostPosted: Mon Oct 27, 2008 5:14 pm   
 
yeah, i thank of that but its just nasty to write containers in zscript for lua procs just to use cmuds threading...

another option would be using ltask library and rebuilding whole mt system with it, but taht complicates stuff even more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 28, 2008 4:00 pm   
 
You just need to create some aliases that are called by the #WAITSIGNAL. Have a normal zScript that calls #WAITSIGNAL and then executes an alias for the true/false case. Then make each of those aliases a Lua script.

That's the only way to do it right now. Multithreading is very complex and can cause huge stability problems and I'm not going to be messing around with it for a long time now. Too many other high-priority tasks to get done that will benefit more people. Especially since it's not preventing you from really doing anything. There's no reason to try and completely avoid zscript.
Reply with quote
intoK
Apprentice


Joined: 18 Feb 2007
Posts: 190

PostPosted: Tue Oct 28, 2008 4:51 pm   
 
right-o, ill figure something out, thanks for the tip

absolutely, mapper and then db should be top prio Very Happy
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net