Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- term.clear()
- run=1
- XMin=1
- YMin=1
- YMax=18
- XMax=26
- function Var()
- Menu=true
- DoorSettings=true
- DoorMenu=false
- DoorAuto=true
- DoorManu=false
- TextColor=colors.white
- BackColor1=colors.orange
- BackColor2=colors.orange
- IconOnColor=colors.green
- IconOffColor=colors.red
- IconBack=colors.gray
- end
- function Text()
- YT=0
- while YT < YMax / 2 do
- term.setBackgroundColor(BackColor1)
- print(" ")
- term.setBackgroundColor(BackColor2)
- print(" ")
- YT = YT + 1
- end
- if Menu == true then
- term.setCursorPos(2,2)
- term.setBackgroundColor(BackColor2)
- print("----- Door ") --21,22
- term.setBackgroundColor(IconBack)
- term.setCursorPos(19,2)
- print(" ")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(25,2)
- print("x")
- if DoorSettings == false and Menu == true then
- --term.setTextColor(colors.gray)
- term.setCursorPos(19,2)
- term.setBackgroundColor(IconOffColor)
- print("Off")
- end
- if DoorSettings == true and Menu == true then
- term.setBackgroundColor(IconOnColor)
- term.setCursorPos(20,2)
- print(" On")
- end
- end
- if DoorMenu == true and Menu == false then
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(6,5)
- print(" Door settings ")
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(6,6)
- print(" ")
- term.setCursorPos(6,7)
- print(" ")
- term.setCursorPos(6,8)
- print(" ")
- term.setCursorPos(6,9)
- print(" ")
- term.setCursorPos(6,10)
- print(" ")
- term.setCursorPos(6,11)
- print(" ")
- if DoorAuto == true and DoorManu == false then
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(12,8)
- term.setTextColor(colors.cyan)
- print("Auto.")
- end
- if DoorManu == true and DoorAuto == false then
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(12,8)
- term.setTextColor(colors.cyan)
- print("Manuel")
- end
- if DoorAuto ==false and DoorManu == false or DoorManu == true and DoorAutor == true then
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(12,8)
- term.setTextColor(colors.red)
- print("Error")
- end
- term.setTextColor(colors.white)
- term.setCursorPos(10,8)
- print("<")
- term.setCursorPos(19,8)
- print(">")
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- term.setCursorPos(7,11)
- print("Save")
- term.setCursorPos(16,11)
- print("Close")
- end
- end
- function Touch()
- while run == 1 do
- while true do
- local event, button, X, Y = os.pullEvent("mouse_click")
- XY = X..","..Y
- if X >=18 and X <= 21 and Y ==2 and DoorSettings == false and Menu == true then
- rednet.broadcast("DS")
- term.setCursorPos(0,0)
- print("DS")
- DoorSettings=true
- Text()
- Touch()
- end
- if X >=18 and X <= 21 and Y ==2 and DoorSettings == true and Menu == true then
- rednet.broadcast("DO")
- term.setCursorPos(0,0)
- print("DO")
- DoorSettings=false
- Text()
- Touch()
- end
- if X == 25 and Y == 2 and Menu == true then
- if DoorMenu==false then
- Menu=false
- DoorMenu=true
- Text()
- Touch()
- end
- end
- if DoorMenu == true and Menu == false and Y == 8 and X == 10 or X == 19 and Y == 8 then
- if DoorAuto == true then
- DoorAuto=false
- DoorManu=true
- Text()
- Touch()
- end
- if DoorManu == true then
- DoorAuto=true
- DoorManu=false
- Text()
- Touch()
- end
- end
- if X >= 16 and Y == 11 and X <= 21 then
- Menu=true
- DoorMenu=false
- Text()
- Touch()
- end
- if X >= 7 and Y == 11 and X <= 11 then
- term.setTextColor(colors.cyan)
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(7,11)
- print("Save")
- if DoorAuto == true and DoorManu == false then
- rednet.broadcast("DoorAuto")
- end
- if DoorManu == false and DoorManu == true then
- rednet.broadcast("DoorManu")
- end
- sleep(0.2)
- Text()
- Touch()
- end
- end
- end
- end
- Var()
- Text()
- Touch()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement