Posted 16 March 2014 - 09:53 PM
Hi!
I just started with computercraft and have been trying to make a program that activates/deactivates a Big Reactor depending in its level of power stored.
I dont know how to keep the program looping and get around the "peripheral :62: Too long without yielding", but here is what i have so far:
I just started with computercraft and have been trying to make a program that activates/deactivates a Big Reactor depending in its level of power stored.
I dont know how to keep the program looping and get around the "peripheral :62: Too long without yielding", but here is what i have so far:
local reactor
reactor = peripheral.wrap("back")
reactor.getEnergyStored()
while reactor.getEnergyStored() < 9900000
do reactor.setActive (true)
end
while reactor.getEnergyStored() > 9900000
do reactor.setActive (false)
end