Постоянно выходит в стартовую ОС, когда пишу on или off. не знаю с чем связано.
Я только начал программировать на lua, немного опыта имею. Но не могу понять почему так. Не могу решить проблему уже 4 часа.
Спасибо за помощь.
Вот код:
os.pullEvent = os.pullEventRaw
repeat do
term.clear()
term.setCursorPos(1,1)
term.write("ReactorOS 1.0")
term.setCursorPos(1,2)
term.write("Copyright Bogdikon")
term.setCursorPos(1,4)
term.setCursorPos(1,3)
term.write("Available Commands - On and Off")
term.setCursorPos(1,5)
local a = io.read()
if a == "on" then
return redstone.setAnalogOutput("bottom",15)
else
if a == "off" then
return redstone.setAnalogOutput("bottom",0)
end
end
end
until true