Posted 18 March 2015 - 08:04 PM
Hi, i copied a program that i saw on youtube, but when im trying to start the program it said this error : "startup:5: attempt to call nil", in the movie, it's exactly the same program but it works ! Help me please :(/>
reactor = peripheral.wrap("back")
cell = peripheral.wrap("left")
actif = reactor.getActive()
maxCell = cube.getMaxEnergy()
while true do
energystore = cell.getStored()
level = (energystore*100)/maxCell
if actif then
if level >= 75 then reactor.setActive(false) end
else
if level <= 25 then reactor.setActive(true) end
end
sleep(1)
end
reactor = peripheral.wrap("back")
cell = peripheral.wrap("left")
actif = reactor.getActive()
maxCell = cube.getMaxEnergy()
while true do
energystore = cell.getStored()
level = (energystore*100)/maxCell
if actif then
if level >= 75 then reactor.setActive(false) end
else
if level <= 25 then reactor.setActive(true) end
end
sleep(1)
end