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

[Error]Too long without yielding

Started by DMKxD, 15 July 2012 - 11:08 AM
DMKxD #1
Posted 15 July 2012 - 01:08 PM
Hey Community,
I'm writing a programm that waits until it gets an input, but i always get this error:


Code(function with error):


function anfang()
  if copper == false and iron == false and gold == false and diamond == false then
   if einmal == true then
    print("Insert a copper ingot, a iron ingot, a gold ingot or a diamond!")
    write("waiting")
    textutils.slowPrint("...")
    einmal = false
   end
  end
  while copper == false and iron == false and gold == false and diamond == false do
   running = true
   if rs.testBundledInput("back", colours.white) then
    copper = true
    weristdran = 1
   elseif rs.testBundledInput("back", colours.blue) then
    iron = true
    weristdran = 1
   elseif rs.testBundledInput("back", colours.green) then
    gold = true
    weristdran = 1
   elseif rs.testBundledInput("back", colours.red) then
    diamond = true
    weristdran = 1
   elseif running == true then
    running = false
   end
  end
  if copper == true or iron == true or gold == true or diamond == true then
   gamemodezuweisen()
   scoreboard()
  end
end

thx. for your help, cya

DMKxD
Pinkishu #2
Posted 15 July 2012 - 02:23 PM
Because you should use os.pullEvent, which has a nice guide in the tutorial section iirc