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

Too long without yelding

Started by Mr_Programmer, 08 April 2016 - 06:07 PM
Mr_Programmer #1
Posted 08 April 2016 - 08:07 PM
I have this RF tracker program that i have been tinkering with (as i remebered i had it) but when i run it, it runs then errors saying too long without yelding, how do i stop this

cell1 = "powered_tile_1"
cell2 = "powered_tile_2"
cell3 = "powered_tile_3"
cell4 = "powered_tile_4"
cell5 = "powered_tile_5"

mon = peripheral.wrap("monitor_25")

while true do
		energy1 = peripheral.call(cell1, "getEnergyStored")
				mon.setCursorPos(1,1)
				mon.write("EnergyCell #1".." : "..energy1.." RF")
end
Edited on 08 April 2016 - 06:08 PM
COOLGAMETUBE #2
Posted 08 April 2016 - 08:08 PM
you need to use sleep to yield in the while.
Mr_Programmer #3
Posted 08 April 2016 - 08:10 PM
you need to use sleep to yield in the while.

Cheers