Posted 19 March 2013 - 05:57 AM
I get this Error when i use this Code: "Too long without Yielding".
function Menue()
local Angabe1 = "1.Stock"
local Angabe2 = "2.Stock"
local Message1 = "Der Aufzug wird nun in den 1. Stock fahren"
local Message2 = "der Aufzug wird nun in den 2.Stock fahren"
local l = 1
while true do
if l == 1 then
shell.run(clear)
term.setCursorPos(1,2)
print("[",Angabe1,"]")
term.setCursorPos(1, 4)
print(Angabe2)
else
shell.run(clear)
term.setCursorPos(1, 2)
print(Angabe1)
term.setCursorPos(1, 4)
print("[",Angabe2,"]")
end
end
a, b = os.pullevent()
while a ~= "key" do
sleep(0.1)
a, b = os.pullevent()
end
if b == 208 and l == 1 then l = 2 end
if b == 200 and l == 2 then l = 1 end
if b == 28 then print() end
if l == 1 then
shell.run(clear)
term.setCursorPos(1,1)
print(Message1)
end
if l == 2 then
shell.run(clear)
term.setCursorPos(1,1)
print(Message2)
end
end
shell.run(clear)
Menue()