Posted 07 August 2014 - 06:28 PM
Here is my problem when i use term.restore it allways says attempt to call nil.
The code is fine! I think but im not sure.
local F1 = "F1"
m = peripheral.wrap("right")
function B()
term.clear()
term.setCursorPos(1,1)
write("Fraese wird Hochgefahren")
term.setCursorPos(1,2)
write("F1 = Schruben")
term.setCursorPos(1,3)
write("F2 = Schlichten")
term.setCursorPos(1,4)
write("F3 = Abstechen")
term.setCursorPos(1,5)
write("F4 = Innenausdrehen")
term.setCursorPos(1,19)
write("Eingabe: ")
term.setCursorPos(10,19)
end
function clear()
m.clear()
m.setCursorPos(1,1)
end
function r()
term.redirect(peripheral.wrap("right"))
end
clear()
m.write("Fraese ist einsatzbereit")
term.setCursorPos(1,2)
while true do
B()
local input = read()
if input == F1 then
clear()
r()
m.write("Schrub Program wird vorbereitet.")
sleep(0,2)
term.setCursorPos(1,2)
clear()
term.restore()
end
if input ~= F1 then
clear()
B()
m.write("Falsche eingabe")
sleep(1)
clear()
B()
end
end
Sorry the Text is in german but he is not the problem.
I tried a lot of things but it doesn`t work.
it allways says attempt to call nil and it was by the line 46 and there is term.restore()
I hope you can fix this.
The code is fine! I think but im not sure.
local F1 = "F1"
m = peripheral.wrap("right")
function B()
term.clear()
term.setCursorPos(1,1)
write("Fraese wird Hochgefahren")
term.setCursorPos(1,2)
write("F1 = Schruben")
term.setCursorPos(1,3)
write("F2 = Schlichten")
term.setCursorPos(1,4)
write("F3 = Abstechen")
term.setCursorPos(1,5)
write("F4 = Innenausdrehen")
term.setCursorPos(1,19)
write("Eingabe: ")
term.setCursorPos(10,19)
end
function clear()
m.clear()
m.setCursorPos(1,1)
end
function r()
term.redirect(peripheral.wrap("right"))
end
clear()
m.write("Fraese ist einsatzbereit")
term.setCursorPos(1,2)
while true do
B()
local input = read()
if input == F1 then
clear()
r()
m.write("Schrub Program wird vorbereitet.")
sleep(0,2)
term.setCursorPos(1,2)
clear()
term.restore()
end
if input ~= F1 then
clear()
B()
m.write("Falsche eingabe")
sleep(1)
clear()
B()
end
end
Sorry the Text is in german but he is not the problem.
I tried a lot of things but it doesn`t work.
it allways says attempt to call nil and it was by the line 46 and there is term.restore()
I hope you can fix this.