You should rather use sleep(0) to cause a tick delay. But another question, how many computers with active modems do you have on your map? that could cause lag, too.
Ok I will try this. And there is only that one… I have another that temporarily opens to send the login information though.
Try sticking an os.pullEvent(); at the start of each loop. Might solve your slowdown.
Ok forgive me I'm a little confused… I put os.pullEvent() one line before each while and if loop, that just made the computer freeze at those points until I pushed a key.
THATS EXACTLY what should happen, the os.pullEvent() stops everything, and waits for something to happen-in this case your keypress, and then lets the program continue from where it was stopped
and also-do you have SPC? type /killall it kills all animals that could also cause lag
Well I need it to run by itself, the purpose is to logon remotely so the credentials aren't stored on the client computer. But thanks for the idea! :D/>/> I don't have SPC, but I use the most minimal graphic settings.
os.pullEvent() halts the program and waits for an incoming event. These events can be a rednet message, a key stroke, a redstone update, or several other things. It returns the event type, and 6 parameters. For instance, a rednet_message event returns:
event type ("rednet_message"), param1 (id of sending computer), param2 (message), and 4 other params which are useless. You can capture these by putting
event,p1,p2,p3,p4,p5,p6 = os.pullEvent()
in the beginning of a loop. You can then check if the event was a rednet message like this:
if event == "rednet_message" then
code here
end
You can get the content of that message by examining p2.
So, instead of running the loop constantly, which we do NOT want, this will wait until it receives input of the rednet_message type. You should have this in EVERY networking interface application, and in fact, in anything using rednet. It is DESIGNED to stall the computer's program until it receives an event. This is good, as it stops lag.