@program fmlrps-econ.muf 1 10000 d i $include $lib/alynna $include $lib/rp $include $lib/rps $def writeln "FMLRPS" pretty tellme $def coffer "$RPSYSTEM" match { "primary/coffers/" 4 rotate "/" }cat $def neg 0 swap - lvar param : withdraw var target var amount var available param @ not if "Syntax: +coffer/withdraw =" writeln exit then param @ "=" split tofloat amount ! target ! target @ coffer "name" strcat getprop not if "That coffer does not exist." writeln exit then me @ target @ coffer "access" strcat getprop testlock not if "You cant access that coffer." writeln exit then target @ coffer "value" strcat getprop available ! amount @ 0 available @ limit amount ! amount @ not if "You MUST specify a positive amount of gil!" writeln exit then available @ amount @ - available ! me @ amount @ adjustgp target @ coffer "value" strcat over over getprop amount @ - setprop { me @ " just withdrew " amount @ "gp from the " target @ " coffer." }cat "FMLRPS" pretty tellhere ; : deposit var target var amount var available param @ not if "Syntax: +coffer/withdraw =" writeln exit then param @ "=" split tofloat amount ! target ! target @ coffer "name" strcat getprop not if "That coffer does not exist." writeln exit then me @ target @ coffer "access" strcat getprop testlock not if "You cant access that coffer." writeln exit then me @ gp available ! amount @ 0 available @ limit amount ! amount @ not if "You MUST specify a positive amount of gil!" writeln exit then me @ amount @ neg adjustgp target @ coffer "value" strcat over over getprop amount @ + setprop { me @ " just deposited " amount @ "gp to the " target @ " coffer." }cat "FMLRPS" pretty tellhere ; : main param ! command @ case "+coffer/withdraw" smatch when withdraw end "+coffer/deposit" smatch when deposit end endcase ; . c q