Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dropdown=0
- login=0
- term.clear()
- function login()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setBackgroundColor(colors.orange)
- term.setCursorPos(10, 6)
- term.write(" ")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(10, 7)
- term.write(" 1 2 3 ")
- term.setCursorPos(10, 8)
- term.write(" 4 5 6 ")
- term.setCursorPos(10, 9)
- term.write(" 7 8 9 ")
- term.setCursorPos(10, 10)
- term.setBackgroundColor(colors.green)
- term.write(" ")
- term.setCursorPos(14, 10)
- term.setBackgroundColor(colors.red)
- term.write(" ")
- end
- function background()
- term.setBackgroundColor(colors.cyan)
- term.clear()
- end
- function t_bar()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(8)
- term.setTextColor(1)
- term.clearLine()
- term.setCursorPos(3, 1)
- print("[OS]")
- end
- function dropDown()
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(1, 2)
- print(" ")
- term.setCursorPos(1, 3)
- print(" Shutdown ")
- term.setCursorPos(1, 4)
- print(" Restart ")
- term.setCursorPos(1, 5)
- print(" Logout ")
- term.setCursorPos(1, 6)
- print(" ")
- end
- function menu()
- term.setCursorPos(1, 4)
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setCursorPos(1, 14)
- print(" ")
- for i=1, 9 do
- term.setCursorPos(1, i+4)
- print(" ")
- term.setCursorPos(10, i+4)
- print(" ")
- end
- --options
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(3, 6)
- print("Devil")
- term.setCursorPos(3, 7)
- print("Teddy")
- end
- login()
- while true do
- --update
- local event, button, X, Y = os.pullEventRaw()
- if button==1 and X==51 and Y==1 then error() end
- if login==0 then
- end
- if login==1 then
- if Y==1 and X>=3 and X<=6 and button==1 then
- if dropdown==0 then dropdown=1
- else dropdown=0 end
- end
- if dropdown==1 then
- if Y==3 and X>=3 and X<=12 and button==1 then os.shutdown() end
- if Y==4 and X>=3 and X<=12 and button==1 then os.reboot() end
- if Y==5 and X>=3 and X<=12 and button==1 then
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- error()
- end
- end
- --draw
- background()
- t_bar()
- menu()
- if dropdown==1 then dropDown() end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement