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


Joined: 25 Jun 2003
Posts: 2
Location: USA

PostPosted: Wed Jun 25, 2003 7:38 am   

Problem with Code/Script (HELP!!)
 
I have a script that worked fine in zmud 5.55 and now it doesnt work in the new version that i just got, will you please look at the errors and see if you can see how to fix them I will post the trigger/variable and the error message. I am hoping its just how the code is layed out that needs to be changed or something. Please help if you can this looks really complex to me, hope someone out there knows whats up

Variable:
aux_f
Value:
%if(%1=,,%if(%1=x,,%if(%1=y,,%if(%1=z,,%1))))
Error:
%if(%1=,,%if(%1=x,,%if(%1=y,,%if(%1=z,,%1))))
^ syntax error

Variable:
aux_str

Value:
%if(%ismember(%1,@p2p_aux_code),%item(@p2p_aux_string,%ismember(%1,@p2p_aux_code))" ",)

Error:
%if(%ismember(%1,@p2p_aux_code),%item(@p2p_aux_string,%ismember(%1,@p2p_aux_code))" ",)

Trigger:
%e[1;33m(*)%e[0m.

Value:
#if (@num_to_ignore) {#add num_to_ignore -1} {#var curloc_string {%1}; #var a %item(@p2p_locs,%ismember(%1,@p2p_strings)); #if (@a) {#var p2p_curloc @a; #sayp (@p2p_curloc)}}

Error:
#sayp (@p2p_curloc)}}
^ expression not allowed here

Alias:
p2p_path

Value:
#if (%iskey(@{p2p_paths_%1},%2)) {} {#sayp .;#var forwardsp "";#var forward "";#var backwardsp "";#var backward "";#loop %numwords(%3) {#if (%word(%3,%i) =~ "&%d{n}&%w{d}") {} {n=1;d=%word(%3,%i)} ;p2p_separate @d;#xsay (@a);postpend forward @n @d @aux_f(@a) ;postpend forwardsp @n @d @aux_fsp(@a) ;prepend backward @n @reversedir(@d) @aux_b(@a);prepend backwardsp @n @reversedir(@d) @aux_bsp(@a) } ; #addkey p2p_paths_%2 %1 {%replace(%delete(@backward,%len(@backward),1),"_",%{cr})}; #addkey p2p_paths_%2 sp%1 {%replace(%delete(@backwardsp,%len(@backwardsp),1),"_",%{cr})}; #addkey p2p_paths_%1 %2 {%replace(%delete(@forward,1,1),"_",%{cr})}; #addkey p2p_paths_%1 sp%2 {%replace(%delete(@forwardsp,1,1),"_",%{cr})}}

Error:
#xsay (@a);postpend forward @n @d @aux_f(@a) ;postpend forwardsp @n @d @aux_fsp(@a) ;prepend backward @n @reversedir(@d) @aux_b(@a);prepend backwardsp @n @reversedir(@d) @aux_bsp(@a) } ; #addkey p2p_paths_%2 %1 {%replace(%delete(@backward,%len(@backward),1),"_",%{cr})}; #addkey p2p_paths_%2 sp%1 {%replace(%delete(@backwardsp,%len(@backwardsp),1),"_",%{cr})}; #addkey p2p_paths_%1 %2 {%replace(%delete(@forward,1,1),"_",%{cr})}; #addkey p2p_paths_%1 sp%2 {%replace(%delete(@forwardsp,1,1),"_",%{cr})}}
^ syntax error

Alias:
p2p_search

Value:
notfound=1;#var p2p_v "";#addkey p2p_v 1 %1;#var p2p_i "";#addkey p2p_i 1 0; #var t 1; #var b 2; #while (@t < @b) { #if (@p2p_stop) {#abort 1} {#loopdb @{p2p_paths_%db(@p2p_v,@t)} {#if (not %key) {#abort 1}; #xsay ==> %key; #if (@p2p_isin(%key,@t)) { #xsay (skipping)} {#if (%key=@p2p_dest) {notfound=0;#var p2p_solution @p2p_trav(@t)|%key; #xsay found @p2p_solution; #var b 0} {#if (@notfound) {#xsay (@t,@b); #addkey p2p_v @b %key; #addkey p2p_i @b @t; #add b 1}}} };#add t 1 }}

Error:

#xsay ==> %key; #if (@p2p_isin(%key,@t)) { #xsay (skipping)} {#if (%key=@p2p_dest) {notfound=0;#var p2p_solution @p2p_trav(@t)|%key; #xsay found @p2p_solution; #var b 0} {#if (@notfound) {#xsay (@t,@b); #addkey p2p_v @b %key; #addkey p2p_i @b @t; #add b 1}}} };#add t 1 }}
^ syntax error

Alias:
p2p

Value:
p2p_continue=1;#sayp (%1 to %2);#var p2p_solution %db(@{p2p_solutions_%1},%2);#if (@p2p_solution) {} {p2p_precalc %1 %2};#say solution => @p2p_solution;#loop %eval(%numitems(@p2p_solution)-1) {p2p_showres %item(@p2p_solution,%i) %item(@p2p_solution,%eval(%i+1))}

Error:
#sayp (%1 to %2);#var p2p_solution %db(@{p2p_solutions_%1},%2);#if (@p2p_solution) {} {p2p_precalc %1 %2};#say solution => @p2p_solution;#loop %eval(%numitems(@p2p_solution)-1) {p2p_showres %item(@p2p_solution,%i) %item(@p2p_solution,%eval(%i+1))}
^ expression not allowed here

Alias:
g

Value:
#if (%1) {#if (%1=stop) {p2p_continue=0} {#if (%1=walk) {walking %2} {#if (%1=sprint) {sprinting} {#if (%2) {source=%1;dest=%2} {source=@p2p_curloc;dest=%1};#if (@source!=@dest) {checkloc @source;checkloc @dest;p2p @source @dest}}}}} {#say @curloc_string (@p2p_curloc)}

Error:
e @dest}}}}} {#say @curloc_string (@p2p_curloc)}
^ expression not allowed here
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 26, 2003 5:19 am   
 
Most of these are just simple errors. It took me a minute or less of experimentation to come up with fixes for each of the first three. I don't expect the rest would be any harder.

%if(%1=,,%if(%1=x,,%if(%1=y,,%if(%1=z,,%1))))
You need something on BOTH sides of the = sign!
%if(%1="",,%if(%1=x,,%if(%1=y,,%if(%1=z,,%1))))

%if(%ismember(%1,@p2p_aux_code),%item(@p2p_aux_string,%ismember(%1,@p2p_aux_code))" ",)
Either put in SOMETHING as the false return value or DON'T use it!
%if(%ismember(%1,@p2p_aux_code),%item(@p2p_aux_string,%ismember(%1,@p2p_aux_code))" ","")
%if(%ismember(%1,@p2p_aux_code),%item(@p2p_aux_string,%ismember(%1,@p2p_aux_code))" ")

#if (@num_to_ignore) {#add num_to_ignore -1} {#var curloc_string {%1}; #var a %item(@p2p_locs,%ismember(%1,@p2p_strings)); #if (@a) {#var p2p_curloc @a; #sayp (@p2p_curloc)}}
You can't use an EXPRESSION (something enclosed in parentheses) as the text for #SAYPROMPT. Use braces {} instead.
#if (@num_to_ignore) {#add num_to_ignore -1} {#var curloc_string {%1}; #var a %item(@p2p_locs,%ismember(%1,@p2p_strings)); #if (@a) {#var p2p_curloc @a; #sayp {@p2p_curloc}}}
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