Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("back")
- mon.setTextScale(5)
- mon.clear()
- file = fs.open("status", "r")
- local inhalt = file.readLine()
- file.close()
- if inhalt == "aus" then
- rs.setOutput("bottom", true)
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(16384)
- mon.write(" ")
- print(1)
- elseif inhalt == "an" then
- rs.setOutput("bottom", false)
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(32)
- mon.write(" ")
- print(2)
- end
- while true do
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X == 1 and Y == 1 and side == "back" and inhalt == "aus" then
- file = fs.open("status", "w")
- file.write("an")
- file.close()
- shell.run("startup")
- print(3)
- elseif X == 1 and Y == 1 and side == "back" and inhalt == "an" then
- file = fs.open("status", "w")
- file.write("aus")
- file.close()
- shell.run("startup")
- print(4)
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement