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
Rykkan
Newbie


Joined: 17 Feb 2016
Posts: 1

PostPosted: Sun Feb 21, 2016 4:17 am   

Converting Zscript to Lua
 
I don't have any experience with LUA so I figured I see if anyone could help me convert my triggers in zscript to LUA.

#CLASS {Boxes}
#ALIAS boxon {#T+ Boxes|boxpick}
#ALIAS setbox {#VAR Box %1}
#ALIAS setcon {#VAR Container %1}
#ALIAS boxoff {#T- Boxes|boxpick;#RES Boxes|boxpick}
#VAR Container {none} {none}
#VAR Box {trunk} {trunk}
#TRIGGER {Remember to read Help Policy to see if anything has changed.} {#T- Boxes|boxpick}
#CLASS 0
#CLASS {Boxes|boxpick}
#ALIAS pb {get @Box @container;#if (@hp < @boxes.limitHP OR @mana < @boxes.limitMa) {#echo "";#echo Sorry, HP or stamina is too low to start picking..;#echo The limits are set at @boxes.limitHP for HP and @boxes.limitMa for stamina.;#echo ""} {unarm @Box}}
#ALIAS boxlimit {#VAR boxes.limitHP {%1};#VAR boxes.limitMa {%2};#ECHO "";#ECHO Limit for HP set to: %1;#ECHO Limit for Stamina set to: %2;#ECHO ""}
#VAR missing {0} {0}
#TRIGGER {I see nothing like that in the @container.} {#ADD missing 1;#IF {@missing = "1"} {#VAR Box chest};#IF {@missing = "2"} {#VAR Box coffer};#IF {@missing = "3"} {#VAR Box coin};#IF {@missing = "4"} {#VAR Box strong};#IF {@missing = "5"} {#VAR Box safe};pb}
#TRIGGER {but manage to spring it instead!} {pick @Box}
#TRIGGER {but fail.} {pick @Box}
#TRIGGER {doesn't appear to be trapped.} {pick @Box}
#TRIGGER {until you manage to render the mechanism useless!} {pick @Box}
#TRIGGER {You failed.} {pick @Box}
#TRIGGER {You pick the lock on a} {open @box;get all @box;pawn @box;pb}
#TRIGGER {I see no} {pb}
#TRIGGER {but can't quite figure out the mechanism.} {unarm @Box}
#CLASS 0
#VAR hp {4050}
#VAR mana {4050}
#TRIGGER {-=(%d)hp (%d)m mv <L(%d)> TNL (%d)=- Held:(%d) Bank:(%d) } {#var hp %1;#var mana %2;#var level %3;#var exp %4;#var gold %5;#var bank %6}

Any help would be appreciated.
Reply with quote
sergh
Newbie


Joined: 15 Feb 2016
Posts: 1

PostPosted: Sun Feb 28, 2016 11:15 am   
 
I got the same issue. Anyone might help me out?
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 28, 2016 12:47 pm   
 
I can't help you with Lua itself, but if you tell me what it is you think lua can do that zscript can't...
Perhaps I could show you how it can.

This site is specifically for help in getting the native commands for zuggsoft products to work.
A lua site would be better for lua coding help
_________________
Discord: Shalimarwildcat
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Wed Mar 02, 2016 2:32 am   
 
Lua is a scripting language.

It doesn't have things like triggers built in; that would be part of the client which then runs Lua scripts.

So are you asking how to translate the "action" portion of things to Lua because you'd like to work with that inside CMUD?
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