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
hpoonis2010
Wanderer


Joined: 18 Jun 2019
Posts: 86

PostPosted: Tue May 12, 2020 10:21 am   

How to prevent script output echoing to MUD
 
I have an alias which runs a loop.

It ticks down from current level to 1 and performs disabling of portals via the %portalenabled command.

In the main MUD window the actions of the script are shown. Ie., the function returns are sent to the mud.

Loop 130 down to 1 all the following is sent to the mud for some reason.

1
1
1
1
1
1
0
0
-1


How to prevent this from happening? When this gets sent to the mud it obviously tries to perform some actions that do not exist and I just see a bunch of 'There is no such command' type of message.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4156
Location: Pensacola, FL, USA

PostPosted: Wed May 13, 2020 1:52 am   
 
Odds are you have the echo in your own code for the purpose or value-testing somewhere.
Are you using #CALL or #NOOP to run your functions or some other command?

I can't really proofread the code without it being here.
_________________
Discord: Shalimar#3679
Reply with quote
hpoonis2010
Wanderer


Joined: 18 Jun 2019
Posts: 86

PostPosted: Wed May 13, 2020 9:49 am   
 
Code:
#FORALL @portlist {%portalenabled(%i,0);#DELITEM portlist %i}
#LOOP 200,0 {#T- P%i}
#LOOP 1,@curlev {#T+ P%i}


Sorry.

The looped output goes to the command window. Specifically, I believe, it is the return from the %portalenabled function, and that is included in the loop. This is going to happen with EVERY function available in the scripting language, as every function returns a value.

There must be some way of dumping that return value so it does not get sent to the window.
Reply with quote
chaossdragon
Wanderer


Joined: 09 Apr 2008
Posts: 65

PostPosted: Wed May 13, 2020 12:03 pm   
 
I could be wrong but two options I would consider is under Options > General > Scrypting tab, uncheck echo output, or use #SENDRAW {command}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4156
Location: Pensacola, FL, USA

PostPosted: Wed May 13, 2020 12:36 pm   
 
Yea, you want to #CALL your functions, it throws away the results rather than trying to send them to the mud server.

#FORALL @portlist {#CALL %portalenabled(%i,0);#DELITEM portlist %i}
_________________
Discord: Shalimar#3679
Reply with quote
hpoonis2010
Wanderer


Joined: 18 Jun 2019
Posts: 86

PostPosted: Wed May 13, 2020 8:28 pm   
 
Thanks. That worked a treat.
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