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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jthomas
Newbie


Joined: 23 Oct 2016
Posts: 5

PostPosted: Sun Jun 24, 2018 1:34 am   

using lua to redirect output to a specific window
 
Using zscript you can just #win Chat @chatstring

but I can't figure out how to do it from lua, zs.window() fails to do anything.

I also can't figure out how to use the gag command in lua.

Any suggestions?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Jun 24, 2018 2:06 pm   
 
Is there a reason you need to be able to do it from lua?
Just to see if you can?
CMUD being able to use other languages was a rather niche idea, fun in theory, but i'm not sure how practical it would be in every circumstance.

They might be able to, but I don't know lua that well.

I would suggest #CATURE and #GAGing with zScript, then stick the stuff that is easier to manipulate with lua inside a #LUA command if both need to be done in the same trigger.
_________________
Discord: Shalimarwildcat
Reply with quote
jthomas
Newbie


Joined: 23 Oct 2016
Posts: 5

PostPosted: Sat Jun 30, 2018 2:11 am   
 
sorry for the long delay, the reason is because lua is just better for scripting. My main issue currently is that lua formatting output is very easy with string.format following most of the rules for printf from C, which is super easy. However, when I try to just save from lua to zscript my nicely formatted output with %ansi in it to make it pretty colors, somewhere in storing the lua string into a zs.var.this_string the white spaces get stripped out :(. and because lua can't print to other windows (that I can find), i'm forced to use zscript for this and gagging.

%format() does a similar job as the lua string.format, except there's no modifier I can find to force showing a + sign if the number is positive. it's not the end of the world, but it's not what I wanted.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Jun 30, 2018 6:40 am   
 
You could always use MXP style color instead of ansi, that might save better.
#SAY {<color red yellow>test</color>}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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