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


Joined: 03 Dec 2004
Posts: 3

PostPosted: Fri Dec 03, 2004 5:47 pm   

repeat and loop
 
Ok I'm having a problem with repeat. When I try to execute a command about 2 or 3 hundred times zmud hangs up and disconnects from the mud.
The problem is that I need to execute it a thousand times. I tried it with many
zmud versions including the most up to date and it's the same every time.
Is there any way to fix it, or can someone just tell be what;s causing it?
Note: It's not the mud that disconnects me it's related to zmud or something on my computer.
Thanks in advance
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Dec 03, 2004 7:29 pm   
 
Are you sure its not the mud disconnecting you? Many muds have a *spam* limit on how many times/how fast a command can be repeated? It could also be the connection isn't able to handle that much info at one time.

#LOOP 10000 {whap self}
and are prolly gonna lose your connection and quit possible get frozen by an Imm :P

#LOOP 1000 {whap self;#WAIT 500}
will put a short 500ms delay between your loop iterations, This is the correct use of #WAIT inside a #LOOP/FORALL/UNTIL etc.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
juhziz
Newbie


Joined: 03 Dec 2004
Posts: 3

PostPosted: Fri Dec 03, 2004 11:10 pm   
 
I'm 100% sure that there is no spam protection on that mud and my connection has good upload bandwich. It works with this wait syntax but it should work w/o it, and those waits would cost into my life. Any other ideas?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Dec 04, 2004 12:09 pm   
 
Simply put this is NOT a zmud problem you are flooding the mud server which in turn is disconnecting you because it can't handle that much data all at once. The specifics I won't get into, the only way to avoid this is to use #WAIT inside your loop Adjust the param to something smaller, And spamming anything 1000 times could cost you your life because how are you supposed to stop it quickly if something changes I.E diff target enters etc
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
juhziz
Newbie


Joined: 03 Dec 2004
Posts: 3

PostPosted: Sun Dec 05, 2004 7:30 pm   
 
OK to make it simple there is no spam protection on the mud as if I do this:
#loop 8000 {say %i;#echo %i} than it works perfectly, but w/o the echo stuff it hangs.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Dec 07, 2004 6:57 pm   
 
That would be because having 2 commands in there makes it take twice as long to send all 8000 says. As nexela said, it'll be a simple disconnect because you're flooding the mud with information.

The reason why: Each character on a MUD is assigned a memory space of certain size. Information to be sent to you gets stored in this buffer, and when it gets sent, its gets removed from the buffer. Too much information at once, will overflow the buffer, and cause you to disconnect. This is built-in to most MUD code, not as a spam protection per-se, but to prevent a user from crashing/hanging/lagging the MUD by using too much memory.

There's no way to prevent this, except by slowing down the rate at which you send the say command to the MUD, Nexela has provided an example of how it may be done.
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