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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Fri Feb 26, 2021 7:06 pm   

Help getting #read stored into a variable
 
Hello,
I am using #read 5 to move a direction in a zone after I kill a mob. I am in a zone that has agro mobs and sometimes they attack me when I move, so I want to also load the direction into a variable so if I fail to move that direction I will call the variable after an alarm trigger goes off (for when the mob eventually dies). How do I go about loading #read 5 into a variable? I tried defining the variable and adding #read 5 to it but I get illegal token on the variable. Thanks!

#if (@noMovement=0) {#read 5}
Basically I want to add that to a variable as well for the #read 5.
So if #read 5 sent north to the mud
I want to do something to add north to a variable so I can call it later if I got agreed the second #read entered north.


Last edited by Jaiven on Fri Feb 26, 2021 9:52 pm; edited 3 times in total
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Fri Feb 26, 2021 7:43 pm   
 
Create your paths as speedwalks and use the #step and #pause

I have a post here for almost this exact function.
http://forums.zuggsoft.com/forums/viewtopic.php?t=38974
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Fri Feb 26, 2021 7:51 pm   
 
chaossdragon wrote:
Create your paths as speedwalks and use the #step and #pause

I have a post here for almost this exact function.
http://forums.zuggsoft.com/forums/viewtopic.php?t=38974


I appreciate the advice but that would require me to change huge portions of my entire script. If I ever decide to go about building a new script from the ground up I will certainly look into this method instead of using #read to grab my dirs from a text file.
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Fri Feb 26, 2021 8:29 pm   
 
Totally understandable, I dreaded my re-writes for a couple of my settings. After the fact was totally worth it but still highly annoying to scrap and restart everything... still have a few more to clean up from old methods that are just absolute trash by comparison.

#READ is honestly beyond my scope, my only other advice is yet more re-write sadly... using %pop and a stringlist in place of your txt file.
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Fri Feb 26, 2021 11:49 pm   
 
That was painful but figured it out
#if (@noMovement=0) {
#var direction %read(5,0);#var direction %replace(@direction, ";", "|");
#for @direction {%exec(%i)}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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