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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Mike Begotner
Newbie


Joined: 30 Jun 2002
Posts: 1
Location: USA

PostPosted: Wed Jul 03, 2002 7:23 pm   

Help please!
 
I downloades a script for the mud Achaea. What it's supposed to do is setup different viasl to be looked at, refilled, set by number and type, etc. When I set the type I get a problem with it adding a |1 to the end of the number when I try to use the vial probe it etc. It was orginally written for version 6.1 of Zmud and I'm absolutely cluess as to how the syntax should change for 6.26.It's pretty long but hopefully someone can spot what I can't. Anyway here it is exactly as I d/l it.



#IF (!@czd_scripts) {#ALIAS csver {#EC {};#EC {Cosmo Drazi Scripts};#IF (@czd_scripts) {#FORALL {@czd_scripts} {#IF (%mod(%ismember(%i,@czd_scripts),2)) {#ECHOPROMPT %i v} {#ECHOPROMPT %i;#EC {}}}} {#EC {No scripts are currently loaded.}}};#VAR czd_scripts {VialControl|2.2}} {#ADDITEM czd_scripts {VialControl|2.2}};#CLASS {ingame};#CLASS {vials};#ALIAS apply {#IF (!%ismember(%1,@vapply)) {#t- ingame;apply %0;#t+ ingame} {#IF (%item(@v%1,2)) {#VA salves %additem(v%1,@salves);#IF (%ismember(%3,head|arms|legs|body|torso)) {#VA salves %additem(%3,@salves)} {#VA salves %additem(none,@salves)};#t- ingame;apply %item(@v%1,1) %-2;#t+ ingame} {#EC You have no %upper(%1)}}} "ingame";#ALIAS drink {#IF (!%ismember(%1,@vdrink)) {#t- ingame;drink %0;#t+ ingame} {#IF (%item(@v%1,2)) {#VA drinks %additem(v%1,@drinks);#t- ingame;drink %item(@v%1,1);#t+ ingame} {#EC You have no %upper(%1)}}} "ingame";#ALIAS vout {#IF (%if(%1=empty,%2,%1)) {#IF (%ismember(%insert(v,%if(%1=empty,%2,%1),1),@vials)) {#IF (%if(%1=empty,%ismember(0,@{v%2}),@{v%1})) {#LOOP %if(%1=empty,%eval(%ismember(0,@{v%if(%1=empty,%2,%1)})/2),1),%eval(%numitems(@{v%if(%1=empty,%2,%1)})/2) {get %item(@{v%if(%1=empty,%2,%1)},(2*%i)-1) from pack}}} {#EC %upper(%if(%1=empty,%2,%1)) is not a valid vial type.}} {#VAR temp 1;#UNTIL (@temp > %numitems(@vials)) {#IF (%if(%1,%ismember(0,@{%item(@vials,@temp)}),%numitems(@{%item(@vials,@temp)}))) {#LOOP %if(%1,%eval(%ismember(0,@{%item(@vials,@temp)})/2),1),%eval(%numitems(@{%item(@vials,@temp)})/2) {get %item(@{%item(@vials,@temp)},(2*%i)-1) from pack}};#ADD temp (1)}}} "vials";#ALIAS vin {#IF (%if(%1=empty,%2,%1)) {#IF (%ismember(%insert(v,%if(%1=empty,%2,%1),1),@vials)) {#IF (%if(%1=empty,%ismember(0,@{v%2}),@{v%1})) {#LOOP %if(%1=empty,%eval(%ismember(0,@{v%if(%1=empty,%2,%1)})/2),1),%eval(%numitems(@{v%if(%1=empty,%2,%1)})/2) {put %item(@{v%if(%1=empty,%2,%1)},(2*%i)-1) in pack}}} {#EC %upper(%if(%1=empty,%2,%1)) is not a valid vial type.}} {#VAR temp 1;#UNTIL (@temp > %numitems(@vials)) {#IF (%if(%1,%ismember(0,@{%item(@vials,@temp)}),%numitems(@{%item(@vials,@temp)}))) {#LOOP %if(%1,%eval(%ismember(0,@{%item(@vials,@temp)})/2),1),%eval(%numitems(@{%item(@vials,@temp)})/2) {put %item(@{%item(@vials,@temp)},(2*%i)-1) in pack}};#ADD temp (1)}}} "vials";#ALIAS fillvial {get gold from pack;#FORALL {vhealth|vmana|vimmunity|vcaloric|vspeed|vmending} {#WHILE (%ismember(0,@{%i})) {refill %item(@{%i},%ismember(0,@{%i})-1) with %delete(%i,1,1);#VA %i %additem(%item(@{%i},%ismember(0,@{%i})-1)|1,@{%i});#VA %i %delitem(%item(@{%i},%ismember(0,@{%i})-1)|0,@{%i})}};put gold in pack} "vials";#ALIAS vials {#IF (%1) {#IF (%ismember(%insert(v,%1,1),@vials)) {#EC {};#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@{v%1},@count)) {#IF (%item(@{v%1},@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%1: %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}}} {#EC {};#FORALL {@vials} {#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item(@{%i},@count)) {#IF (%item(@{%i},@count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete(%i,1,1): %eval((@count-1)/2) %if(@vempty,(@vempty Empty))};#VA count 0}}}}} "vials";#ALIAS vp {#VA count 1;#WHILE (@count>0) {#IF (%item(@{v%1},@count)) {p %item(@{v%1},@count);#ADD count (2)} {#VA count 0}}} "vials";#ALIAS vg {#IF (%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) {#IF (%ismember(%insert(v,%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1)),1),@vials)) {#VA temp %eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})/2);#WHILE (@temp>0 & %item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},2*@temp)=%if(%if(%isnumber(%1),%2,%1)=empty,0,1)) {#IF (%item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},2*@temp)=%if(%if(%isnumber(%1),%2,%1)=empty,0,1)) {#ADD temp (1)}};#IF (@temp = 0) {#EC You have no %if(%if(%isnumber(%1),%2,%1)=empty,empty,full) %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) vials.} {#ADD temp (-%eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})/2));#IF (@temp < %if(%isnumber(%1),%1,1)) {#EC You only have @temp %if(%if(%isnumber(%1),%2,%1)=empty,empty,full) %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))) vial%if(@temp=1,,s).} {#IF (%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%4,%3),%if(%isnumber(%1),%3,%2))) {#VA temp %eval(%ismember(%if(%if(%isnumber(%1),%2,%1)=empty,0,1),@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))})-1);#LOOP %if(%isnumber(%1),%1,1) {give %item(@{v%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1))},@temp) to %if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%4,%3),%if(%isnumber(%1),%3,%2));#ADD temp (2)}} {#EC Syntax vg (#) (empty) type person}}}} {#EC %upper(%if(%if(%isnumber(%1),%2,%1)=empty,%if(%isnumber(%1),%3,%2),%if(%isnumber(%1),%2,%1)) is not a valid vial type.}} {#EC Syntax: vg (#) (empty) type person}} "vials";#ALIAS vmove {#IF (%ismember(%insert(v,%1,1),@vials)) {#IF (%ismember(%insert(v,%2,1),@vials)) {#IF (%ismember(0,@{v%1})) {#VAR v%2 %additem(%item(@{v%1},%ismember(0,@{v%1})-1)|0,@{v%2});#VAR v%1 %delitem(%item(@{v%1},%ismember(0,@{v%1})-1)|0,@{v%1});#EC Empty %upper(%1) moved to empty %upper(%2).} {#EC You have no empty %upper(%1) vials to move.}} {#EC %if(%2,%upper(%2) is not a valid vial selection.,Syntax: vmove type1 type2)}} {#EC %if(%1,%upper(%1) is not a valid vial selection.,Syntax: vmove type1 type2)}} "vials";#ALIAS vset {#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%if(%2=empty,%3,%2),1),@vials)) {#IF (%2=empty) {#IF (%ismember(%1,@{v%3})) {#VAR v%3 %delitem(%1|%item(@{v%3},%ismember(%1,@{v%3})+1),@{v%3})};#VAR v%3 %additem(%1|0,@{v%3})} {#IF (%ismember(%1,@{v%2})) {#VAR v%2 %delitem(%1|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2})};#VAR v%2 %additem(%1|1,@{v%2});#IF (%ismember(0,@{v%2})) {#WHILE (%ismember(0,@{v%2}) < %ismember(%1,@{v%2})) {#VAR v%2 %additem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2});#VAR v%2 %delitem(%item(@{v%2},%ismember(0,@{v%2})-1)|0,@{v%2})}}};#EC %1 set to %if(%2=empty,%upper(%3) (empty),%upper(%2)).} {#EC %if(%if(%2=empty,%3,%2),%upper(%if(%2=empty,%3,%2)) is not a valid vial type.,Syntax: vset #vial (empty) type)}} {#EC Syntax: vset #vial (empty) type}} "vials";#ALIAS vdel {#IF (%isnumber(%1)) {#IF (%ismember(%insert(v,%2,1),@vials)) {#IF (%ismember(%1,@{v%2})) {#VA v%2 %delitem(%item(@{v%2},%ismember(%1,@{v%2}))|%item(@{v%2},%ismember(%1,@{v%2})+1),@{v%2});#EC %1 removed from %upper(%2).} {#EC %1 is not a %upper(%2) vial number.}} {#EC %if(%2,%upper(%2) is not a valid vial type.,Syntax: vdel #vial type)}} {#EC Syntax: vdel #vial type}} "vials";#VAR vmana {} {_nodef} "vials";#VAR vhealth {} {_nodef} "vials";#VAR vvenom {} {_nodef} "vials";#VAR vimmunity {} {_nodef} "vials";#VAR vspeed {} {_nodef} "vials";#VAR vpurifying {} {_nodef} "vials";#VAR vmass {} {_nodef} "vials";#VAR vcaloric {} {_nodef} "vials";#VAR vmending {} {_nodef} "vials";#VAR vapply {caloric|mending|restoration|mass|epidermal} {_nodef} "vials";#VAR vdrink {health|mana|immunity|venom|frost|levitation|speed|purifying} {_nodef} "vials";#VAR vials {vhealth|vmana|vimmunity|vvenom|vcaloric|vfrost|vlevitation|vspeed|vpurifying|vepidermal|vmending|vrestoration|vmass} {_nodef} "vials";#VAR vfrost {} {_nodef} "vials";#VAR vlevitation {} {_nodef} "vials";#VAR drinks {} {_nodef} "vials";#VAR vrestoration {} {_nodef} "vials";#VAR salves {} {_nodef} "vials";#VAR vepidermal {} {_nodef} "vials";#VAR count {};#VAR vempty {} {_nodef} "vials";#VAR temp {};#TRIGGER {You take a drink from a} {#VA drinks %delitem(%item(@drinks,1),@drinks)} "vials";#TRIGGER {You down the last drop from a} {#VA temp @%item( @drinks, 1);#VA %item( @drinks, 1) %additem( %item( @temp, 1), @temp);#VA %item( @drinks, 1) %additem( 0, @temp);#VA %item( @drinks, 1) %delitem( %item( @temp, 1), @temp);#VA %item( @drinks, 1) %delitem( %item( @temp, 1), @temp);#IF (%item( @temp, 2) = 0) {#EC You have run out of %upper( %delete( %item( @drinks, 1), 1, 1))} {#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item( @temp, @count)) {#IF (%item( @temp, @count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete( %item( @drinks, 1), 1, 1): %eval( (@count-1)/2) %if( @vempty, (@vempty Empty))};#VA count 0}}};#VA drinks %delitem( %item( @drinks, 1), @drinks)} "vials";#TRIGGER {You take out some salve and quickly rub it on} {#VA salves %delitem(%item(@salves,1)|%item(@salves,2),@salves)} "vials";#TRIGGER {The salve dissolves and quickly disappears after you apply it} {#VA salves %delitem(%item(@salves,1)|%item(@salves,2),@salves)} "vials";#TRIGGER {vial contains nothing that is spreadable.} {#VA temp @%item( @salves, 1);#VA %item( @salves, 1) %additem( %item( @temp, 1), @temp);#VA %item( @salves, 1) %additem( 0, @temp);#VA %item( @salves, 1) %delitem( %item( @temp, 1), @temp);#VA %item( @salves, 1) %delitem( %item( @temp, 1), @temp);#IF (%item( @temp, 2) = 0) {#EC You have run out of %upper( %delete( %item( @salves, 1), 1, 1))} {apply %delete( %item( @salves, 1), 1, 1)%if( %item( @salves, 2) != none, " to "%item( @salves, 2));#VA count 1;#VA vempty 0;#WHILE (@count>0) {#IF (%item( @temp, @count)) {#IF (%item( @temp, @count+1)=0) {#ADD vempty (1)};#ADD count (2)} {#EC {%delete( %item( @salves, 1), 1, 1): %eval( (@count-1)/2) %if( @vempty, (@vempty Empty))};#VA count 0}}};#VA salves %delitem( %item( @salves, 1)|%item( @salves, 2), @salves)} "vials";#TRIGGER {You feel your insides clench as your soul is frozen} {#VA drinks "";#VA salves ""} "vials";#TRIGGER {You have been slain} {#VA drinks "";#VA salves ""} "vials"
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jul 03, 2002 7:59 pm   
 
Usually a problem seen with additem.

However I see concepts like this line:

#VA %i %additem(%item(@{%i},%ismember(0,@{%i})-1)|1,@{%i})

Sounds like that concept isn't processing
properly. Perhaps %ismember(0,@{%i}) fails
to yield a value if @{%i} doesn't exist.

But I'd point my finger for examination there.

Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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