This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
FileStriker's profile picture

Rednet don't start after reload the world.

Started by FileStriker, 11 February 2014 - 09:56 AM
FileStriker #1
Posted 11 February 2014 - 10:56 AM
I have some problems with the rednet.
If I restart my sp world the turtles start the startup but don't open the wireless modem on the right side.

I have already use this:

i = rednet.isOpen("right")
while i == false do
	sleep(1)
	i = rednet.open("right")
end

but it don't work correctly :(/> If I restart manually it works.
What is wrong?
CometWolf #2
Posted 11 February 2014 - 01:46 PM
That's a pretty weird way of doing things you got there… I suppose it would work, but it's generally a bad idea, since rednet.open dosen't actually return any values, but false is not the same as nil i suppose. Anyways, give this a try instead.

while not rednet.isOpen"right" do -- forget about the i variable, just check wether it's open or not everytime.
  rednet.open"right"
  sleep(0.1)
end -- if it's open, the loop will end
FileStriker #3
Posted 11 February 2014 - 03:09 PM
It doesn't works correctly, too. :(/> But I have put a sleep(30) comand before the rednet.open("right") command and now it works.
The reason why I don't use the not in the whie loop is, that sometimes it doesn't works correctly.
But thanks anyway. :D/>