Posted 30 September 2012 - 12:28 PM
I have a program that I use to remotely turn off and on computers. When I switched to CC v1.42 i found that the comp.turnOn() functions performance is very flaky, sometimes it will work first try, others it can take 20+ attempts for it to work.
To make sure I put a fresh install of MC 1.32 with Forge 251, and CC 1.42 with nothing else installed, and I still have the problem.
To duplicate connect 2 computers, and run this code on one of them.
It should give you the id about once a second, if it behaves like mine you'll see that its very random on when it will work.
Each dot printed is an attempt to turn the computer on.
To make sure I put a fresh install of MC 1.32 with Forge 251, and CC 1.42 with nothing else installed, and I still have the problem.
To duplicate connect 2 computers, and run this code on one of them.
local sSide = ""
local tSides = {"right","left","front","back","top","bottom"}
for x=1, #tSides do
if peripheral.isPresent(tSides[x]) and peripheral.getType(tSides[x]) == "computer" then
sSide = tSides[x]
break
elseif x == #tSides then
error("No Computers Attached, please attach a computer and try again.")
end
end
local comp = peripheral.wrap(sSide)
while true do
if not comp.getID() then
write("Waiting to get ID from computer.")
repeat
comp.turnOn()
sleep(1)
write(".")
until comp.getID()
local nID = comp.getID()
print("\nID is "..nID)
comp.shutdown()
end
end
It should give you the id about once a second, if it behaves like mine you'll see that its very random on when it will work.
Each dot printed is an attempt to turn the computer on.