Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("left")
- modem = peripheral.wrap("back")
- modem.open(55001)
- status = 0
- -- -------------Wej?cie-----------------------------
- m.setCursorPos(6,7)
- m.setTextScale(2)
- m.setBackgroundColour(colors.black)
- m.setTextColour(colors.white)
- m.clear()
- m.write("Touch monitor to continue")
- os.pullEvent("monitor_touch")
- -- ----------------------------MENU-----------------------------------
- m.clear()
- m.setCursorPos(2,18)
- m.setTextColour(colors.lightBlue)
- m.setTextScale(1)
- m.write("log out")
- win = window.create(m ,23,1,27,3)
- win.setBackgroundColour(colors.lightBlue)
- win.setTextColour(colors.red)
- win.clear()
- win.setCursorPos(8,2)
- win.write("ASTIOMAT 3000")
- event, side, port, respPort, msg = os.pullEvent("modem_message")
- print("Pos x:" .. msg[1])
- print("Pos y:" .. msg[2])
- if posx >= 1 and posx <= 8 and posy >= 17 and posy <= 19 then
- os.reboot()
- end
- win.setVisible(false)
- -- ---------------------------------------------------------------
- m.setCursorPos(5,3)
- m.setTextScale(4)
- m.setBackgroundColour(colors.green)
- m.setTextColour(colors.blue)
- m.clear()
- m.write("[INACTIVE]")
- -- ---------------Funkcja Zapasowaj energi-------------------------
- --local function reserv()
- while true do
- os.pullEvent("monitor_touch")
- status = status + 1
- if status >= 2 then
- status = 0
- end
- if status == 1 then
- m.setCursorPos(6,3)
- m.setTextScale(4)
- m.setTextColour(colors.blue)
- m.setBackgroundColour(colors.red)
- m.clear()
- m.write("[ACTIVE]")
- peripheral.call("back", "transmit", 55000, 1, "POWER")
- end
- if status == 0 then
- m.setCursorPos(5,3)
- m.setBackgroundColour(colors.green)
- m.clear()
- m.write("[INACTIVE]")
- peripheral.call("back", "transmit", 55000, 1, "STOP")
- end
- end
- --end
- -- ----------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement