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


Joined: 04 Mar 2002
Posts: 1

PostPosted: Mon Mar 18, 2002 11:27 am   

%replace, @word problem
 
Can anyone help? This triggers off:

"You create &tempvar1"

and does:

#echo |@tempvar1|
#VAR tempvar1 %replace( @tempvar1, ".", " ")
#echo |@tempvar1|
#var word6 %word( @tempvar1, 6, " ")
#var word4 %word( @tempvar1, 5, " ")
#var word4 %word( @tempvar1, 4, " ")
#var word3 %word( @tempvar1, 3, " ")
#var word2 %word( @tempvar1, 2, " ")
#var word1 %word( @tempvar1, 1, " ")
#echo |@word1|@word2|@word3|@word4|@word5|@word6|

the point of this is to create a list of words from the output of You create, ie if I load object 234 and the mud echoes to me "You create a brown piece of bacon." I would be able to access a list of words to stat and build an item database.

Thing is it's not reliable. For some reason the above script occasionally fails on the last but 1 word, returning an empty value. Any thoughts??

UPDATE ==> OK we just had a reboot and it works now. *confused*
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Mar 18, 2002 1:28 pm   
 
You assign the fifth word to @word4 and then assign the fourth word to the same variable:
#VAR word4 %word( @tempvar1, 5, " ")
#VAR word4 %word( @tempvar1, 4, " ")

Kjata
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