Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("bottom")
- mon.clear()
- mon.setTextScale(0.5)
- keyBreak = false
- selected = false
- choice = ""
- function initializeMain()
- term.redirect(mon)
- image = paintutils.loadImage(".background")
- paintutils.drawImage(image, 1,1)
- term.native()
- mon.setCursorPos(2,2)
- mon.setBackgroundColor(colors.gray)
- mon.setTextColor(colors.white)
- mon.write("ACTIVE")
- mon.setCursorPos(2,7)
- mon.write("ASLEEP")
- mon.setCursorPos(9, 9)
- mon.setBackgroundColor(colors.lightBlue)
- mon.setTextColor(colors.black)
- mon.write("SEND OUT")
- mon.setCursorPos(29,9)
- mon.write("RETURN")
- mon.setCursorPos(20,9)
- mon.setBackgroundColor(colors.orange)
- mon.write("REBOOT")
- --temp
- mon.setCursorPos(2,8)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.red)
- mon.write("t0001a")
- mon.setCursorPos(2,9)
- mon.write("t0002b")
- ----------------------
- end
- function buttonReboot()
- os.reboot()
- end
- function buttonSendOut()
- mon.clear()
- term.redirect(mon)
- image = paintutils.loadImage(".backgroundSend")
- paintutils.drawImage(image, 1,1)
- term.native()
- mon.setCursorPos(30, 8)
- mon.setBackgroundColor(colors.orange)
- mon.setTextColor(colors.black)
- mon.write("BACK")
- mon.setCursorPos(2,6)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("0")
- mon.setCursorPos(6,6)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("2")
- mon.setCursorPos(10,6)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("4")
- mon.setCursorPos(2,8)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("5")
- mon.setCursorPos(6,8)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("7")
- mon.setCursorPos(10,8)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write("9")
- mon.setCursorPos(4,6)
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("1")
- mon.setCursorPos(8,6)
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("3")
- mon.setCursorPos(4,8)
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("6")
- mon.setCursorPos(8,8)
- mon.setBackgroundColor(colors.green)
- mon.setTextColor(colors.black)
- mon.write("8")
- mon.setCursorPos(2,2)
- mon.setBackgroundColor(colors.gray)
- mon.setTextColor(colors.white)
- mon.write("CHOICE")
- mon.setCursorPos(2,3)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(choice)
- while(keyBreak == false) do
- local event, side, xPos, yPos = os.pullEvent("monitor_touch")
- --BUTTON EVENTS
- if(yPos == 8 and xPos >= 30 and xPos < 38) then
- mon.setCursorPos(30, 8)
- mon.setBackgroundColor(colors.yellow)
- mon.setTextColor(colors.black)
- mon.write("BACK")
- os.sleep(1)
- keyBreak = true
- run()
- end
- end
- end
- function buttonReturn()
- end
- function run()
- while(true) do
- initializeMain()
- while(true) do
- local event, side, xPos, yPos = os.pullEvent("monitor_touch")
- --BUTTON EVENTS
- if(yPos == 9 and xPos >= 9 and xPos < 17) then
- mon.setCursorPos(9, 9)
- mon.setBackgroundColor(colors.yellow)
- mon.setTextColor(colors.black)
- mon.write("SEND OUT")
- os.sleep(1)
- if(selected == true) then
- buttonSendOut()
- end
- end
- if(yPos == 9 and xPos >= 20 and xPos < 26) then
- mon.setCursorPos(20,9)
- mon.setTextColor(colors.black)
- mon.setBackgroundColor(colors.yellow)
- mon.write("REBOOT")
- os.sleep(1)
- buttonReboot()
- end
- if(yPos == 9 and xPos >= 29 and xPos < 35) then
- mon.setCursorPos(29,9)
- mon.setBackgroundColor(colors.yellow)
- mon.setTextColor(colors.black)
- mon.write("RETURN")
- os.sleep(1)
- buttonReturn()
- os.sleep(1)
- mon.setCursorPos(29,9)
- mon.setBackgroundColor(colors.lightBlue)
- mon.setTextColor(colors.black)
- mon.write("RETURN")
- end
- if(yPos == 8 and xPos >= 2 and xPos < 8) then
- mon.setCursorPos(2,8)
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.red)
- mon.write("t0001a")
- os.sleep(1)
- selected = true
- choice = "t0001a"
- end
- end
- end
- end
- run()
Advertisement
Add Comment
Please, Sign In to add comment