|
Rykkan Newbie
Joined: 17 Feb 2016 Posts: 1
|
Posted: 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. |
|
|
|
sergh Newbie
Joined: 15 Feb 2016 Posts: 1
|
Posted: Sun Feb 28, 2016 11:15 am |
I got the same issue. Anyone might help me out?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: 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? |
|
|
|
|
|