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


Joined: 11 May 2014
Posts: 9

PostPosted: Thu Feb 11, 2021 7:07 pm   

Sending commands from string lists
 
I am trying to send a command to the mud from a string list but when it reaches the command it returns me an error.
for example:

#ad room 1;%item( @DIRS, @room)


DIRS = #echo boo|n|s|

what will be a proper way to do this as the message i get from the mud is 'no reason to #echo here'
my only guess is that the command is sent to the mud and since the mud does not such a thing as '#echo' it returns me the issue is there a way around this?
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Fri Feb 12, 2021 11:33 pm   
 
you need to encapsulate your command

Code:
#ADD moves 1
    Add one to the @moves variable


with your example it should be
#ad room {1;%item( @DIRS, @room)}
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Fri Feb 12, 2021 11:50 pm   
 
I'm sorry but I fail to understand the need for this, as most muds (with few exceptions) will typically have a line after the rooms desc, along the lines of
"Obvious exits : north, south, up, down, etc"

is your goal to capture this kind of info and make it easier to find/read?
Reply with quote
sonic306
Newbie


Joined: 11 May 2014
Posts: 9

PostPosted: Sat Feb 13, 2021 9:51 am   
 
No, I use string lists for a script that walks the path defined in the DIRS variable, the reason I want to be able to use different cmud commands is for debugging, sometimes paths can be 1000 long so i would like to make sure that once the script reaches to a point with an "echo something" it can execute it or activate different aliases rather setting up triggers on key points to activate the aliases.

I have tested your recommendation: #ad room {1;%item( @DIRS, @room)} - using this syntax does not add 1 to the room var as a number but just appends the number 1

this is how my variable looks like after making the change : 01 1 1 1 1
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Sat Feb 13, 2021 11:06 am   
 
ok Now I understand.

I use %additem when appending to a stringlist

Code:
room = %additem("what I want to add", @room)


then to check you can #ECHO {@room} (for this you want to encapsulate or it will just echo @room )
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