Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---wanna put up the password? well change false to true--
- shell.run("pastebin get cahDmkZD _Ep")
- shell.run("pastebin get pnzdr8FB filebrowseros")
- shell.run("pastebin get GCvQSFS0 test")
- shell.run("pastebin get Y77q7RnS painter ")
- shell.run("pastebin get PjTj9kEk _window")
- shell.run("pastebin get bUeXqDnQ _timer")
- shell.run("pastebin get ZUvcfnC8 _BootUp")
- shell.run("pastebin get 0Trs8n1f _password")
- shell.run("pastebin get b00Ji592 _em")
- shell.run("pastebin get 4x0a1G9H _dt")
- passwordOn = false
- ---dont change anything else unless you know what your doing------------------------------------------------------------------------------------------------------sup---------------------------------------------------------TINCAN---------------------------------------------------------------------------------------tincans :D--
- _window = paintutils.loadImage("_window")
- _timer = paintutils.loadImage("_timer")
- _BootUp = paintutils.loadImage("_BootUp")
- _password = paintutils.loadImage("_password")
- _em = paintutils.loadImage("_em")
- _dt = paintutils.loadImage("_dt")
- running = true
- version = "1.0"
- time = os.time()
- _cm = 0
- _ms = 0
- _ee = 0
- _oo = 0
- ex = 0
- ey = 0
- contextX = 0
- contextY = 0
- alarm = 50
- _tb = 0
- _tmb = 0
- etm = 0
- tcX = 0
- tcY = 0
- ---------------------------------------------
- function ie()
- term.setCursorPos(46, 3)
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.red)
- print("X")
- while true do
- event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" and x == 46 and y == 3 and button == 1 then
- term.setCursorPos(46,3)
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.pink)
- print("X")
- buttonSound()
- term.setBackgroundColour(colours.red)
- term.setCursorPos(46,3)
- print("X")
- sleep(0.1)
- Init()
- elseif event == "mouse_click" and x >= 9 and x <= 43 and y == 6 and button == 1 then
- term.setBackgroundColour(colours.lightGrey)
- term.setTextColour(colours.black)
- term.setCursorPos(9, 6)
- searchb = read()
- if searchb == "youtube" then
- youtube()
- end
- end
- end
- end
- function youtube()
- end
- function window()
- paintutils.drawImage(_window, 1, 1)
- ie()
- end
- function pinon()
- term.setCursorPos(7,1)
- term.setBackgroundColour(colours.cyan)
- term.setTextColour(colours.blue)
- print("EE")
- term.setCursorPos(7,19)
- end
- function buttonSound()
- redstone.setOutput("back", true)
- sleep(0.3)
- redstone.setOutput("back", false)
- end
- function toggleOn(text)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.lightGrey)
- print(text)
- sleep(0.1)
- end
- function toggleOff(text)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.white)
- print(text)
- buttonSound()
- end
- Alarm = function()
- rednet.open("right")
- rednet.broadcast("clock")
- sleep(3)
- rednet.broadcast("CO")
- end
- drawMenu6 = function()
- term.setCursorPos(tcX, tcY)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- print("Exit ")
- term.setCursorPos(tcX,tcY+1)
- print("Reboot ")
- term.setCursorPos(tcX, tcY-1)
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.blue)
- print("Slide-out Menu")
- end
- drawMenu5 = function()
- term.setCursorPos(1,2)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- print("1 min. ")
- print("15 mins. ")
- print("30 mins. ")
- print("1 hour ")
- print("Other ")
- term.setCursorPos(1,7)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.white)
- print("Select Time")
- end
- Timer = function()
- _tmb = 0
- term.setBackgroundColour(colours.lightBlue)
- clear()
- term.setBackgroundColour(colours.blue)
- term.setCursorPos(1,1)
- term.clearLine()
- term.setCursorPos(1,1)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.grey)
- print("TIME ")
- while true do
- event, button, x, y = os.pullEventRaw()
- if _tmb == 0 and event == "mouse_click" and x < 6 and y == 1 and button == 1 then
- term.setCursorPos(1,1)
- toggleOn("TIME ")
- buttonSound()
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.grey)
- print("TIME ")
- sleep(0.1)
- drawMenu5()
- _tmb = _tmb + 1
- elseif event == "mouse_click"and button == 1 and _tmb == 1 and x < 12 and y == 2 then
- term.setCursorPos(1,2)
- toggleOn("1 min. ")
- term.setCursorPos(1,2)
- toggleOff("1 min. ")
- tm = 60
- _tmb = 0
- gTime()
- elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 3 and button == 1 then
- term.setCursorPos(1,3)
- toggleOn("15 mins. ")
- term.setCursorPos(1,3)
- toggleOff("15 mins. ")
- tm = 900
- _tmb = 0
- gTime()
- elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 4 and button == 1 then
- term.setCursorPos(1,4)
- toggleOn("30 mins. ")
- term.setCursorPos(1,4)
- toggleOff("30 mins. ")
- tm = 1800
- _tmb = 0
- gTime()
- elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 5 and button == 1 then
- term.setCursorPos(1,5)
- toggleOn("1 hour ")
- term.setCursorPos(1,5)
- toggleOff("1 hour ")
- tm = 3600
- _tmb = 0
- gTime()
- elseif event == "mouse_click" and _tmb == 1 and x < 12 and y == 6 and button == 1 then
- term.setCursorPos(1,6)
- toggleOn("Other ")
- term.setCursorPos(1,6)
- toggleOff("Other ")
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.white)
- term.clear()
- term.setCursorPos(10,1)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.white)
- print("Seconds.")
- term.setCursorPos(1,1)
- tm = read()
- _tmb = 0
- gTime()
- elseif event == "mouse_click" and _tmb < 2 and x < 38 and y < 15 and x > 0 and y > 1 and button == 2 then
- tcX = x
- tcY = y
- drawMenu6()
- _tmb = 2
- elseif event == "mouse_click" and x >tcX-1 and x < tcX + 15 and y == tcY and button == 1 and _tmb == 2 then
- term.setCursorPos(tcX, tcY)
- toggleOn("Exit ")
- term.setCursorPos(tcX, tcY)
- toggleOff("Exit ")
- _tmb = 0
- _ms = 0
- Init()
- elseif event == "mouse_click" and x >tcX-1 and x <tcX + 15 and y == tcY + 1 and button == 1 and _tmb == 2 then
- term.setCursorPos(tcX, tcY + 1)
- toggleOn("Reboot ")
- term.setCursorPos(tcX, tcY + 1)
- toggleOff("Reboot ")
- os.reboot()
- else
- Timer()
- _tmb = 0
- end
- end
- end
- gTime = function()
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.white)
- clear()
- paintutils.drawImage(_timer, 1, 1)
- term.setCursorPos(4,1)
- term.setBackgroundColour(colours.lightGrey)
- term.setTextColour(colours.black)
- print(" Seconds")
- flashOn()
- term.setCursorPos(12,1)
- print("GO>")
- term.setCursorPos(1,1)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.lightGrey)
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.lightGrey)
- term.setTextColour(colours.black)
- print(tm)
- event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" and x > 11 and x < 15 and y == 1 and button == 1 then
- flashOff()
- term.setCursorPos(12,1)
- print("GO>")
- buttonSound()
- flashOn()
- term.setCursorPos(12,1)
- print("GO>")
- sleep(0.1)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- while true do
- term.setCursorPos(25,1)
- print("-"..tm.."-")
- sleep(1)
- tm = tm - 1
- if tm < 1 then
- clear()
- term.setCursorPos(25,1)
- print("0")
- sleep(1)
- term.setBackgroundColour(colours.white)
- clear()
- OriginCoords()
- print("FINISHED")
- Alarm()
- sleep(1)
- _ms = 0
- _tb = 0
- Init()
- end
- end
- end
- end
- flashOn = function()
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.lime)
- end
- flashOff = function()
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.green)
- end
- BootUp = function()
- term.setBackgroundColour(colours.white)
- term.clear()
- term.setCursorPos(8,9)
- term.setTextColour(colours.black)
- print("Booting up OS - this won't take long")
- term.setBackgroundColour(colours.white)
- paintutils.drawImage(_BootUp, 1, 1)
- term.setCursorPos(12,10)
- term.setBackgroundColour(colours.lime)
- term.setTextColour(colours.lime)
- textutils.slowPrint("a;klsjfdlkajsfkdja;lskdjflkajs")
- end
- OriginCoords = function()
- term.setCursorPos(1,1)
- end
- clear = function()
- term.clear()
- end
- OnKeyPressed = function()
- event, key = os.pullEvent("key")
- end
- ---------------------------------------------
- password = function()
- if passwordOn == true then
- password2()
- else
- Init()
- end
- end
- password2 = function()
- term.setBackgroundColour(colours.cyan)
- term.clear()
- paintutils.drawImage(_password, 1, 1)
- term.setCursorPos(30,17)
- term.setTextColour(colours.white)
- print("OK")
- term.setCursorPos(18, 17)
- print("CANCEL")
- term.setCursorPos(18, 14)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- v = read()
- if v == "12547" then
- while true do
- _oo = 1
- event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" and _oo == 1 and x > 27 and x < 34 and y == 17 and button == 1 then
- term.setCursorPos(28,17)
- term.setTextColour(colours.white)
- term.setBackgroundColour(colours.green)
- print(" OK ")
- buttonSound()
- term.setBackgroundColour(colours.lime)
- term.setTextColour(colours.white)
- term.setCursorPos(28,17)
- print(" OK ")
- sleep(0.1)
- Init()
- elseif event == "mouse_click" and _oo == 1 and x > 16 and x < 24 and y == 17 and button == 1 then
- term.setCursorPos(17,17)
- flashOff()
- print(" CANCEL")
- buttonSound()
- flashOn()
- term.setCursorPos(17,17)
- print(" CANCEL")
- sleep(0.1)
- password()
- end
- end
- else
- while true do
- event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" then
- if _oo == 0 and x > 27 and x < 34 and y == 17 and button == 1 then
- flashOff()
- term.setCursorPos(28,17)
- print(" OK ")
- buttonSound()
- flashOn()
- term.setCursorPos(28,17)
- print(" OK ")
- sleep(0.1)
- password()
- elseif _oo == 0 and x > 16 and x < 24 and y == 17 and button == 1 then
- term.setCursorPos(17,17)
- flashOff()
- print(" CANCEL")
- buttonSound()
- flashOn()
- term.setCursorPos(17,17)
- print(" CANCEL")
- sleep(0.1)
- password()
- end
- end
- end
- end
- end
- email = function()
- term.setBackgroundColour(colours.white)
- term.clear()
- term.setCursorPos(1,1)
- paintutils.drawImage(_em, 1, 1)
- term.setCursorPos(1,1)
- rednet.open("right")
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.white)
- input = read()
- rednet.broadcast(input)
- _ms = 0
- Init()
- end
- function exit(x, y)
- term.setCursorPos(x, y)
- term.setBackgroundColour(colours.red)
- term.setTextColour(colours.white)
- print("X")
- ex = x
- ey = y
- while true do
- event, button, x, y = os.pullEvent("mouse_click")
- if button == 1 and ex == x and ey == y then
- term.setCursorPos(ex, ey)
- term.setBackgroundColour(colours.pink)
- term.setTextColour(colours.white)
- print("X")
- buttonSound()
- term.setBackgroundColour(colours.red)
- term.setTextColour(colours.white)
- term.setCursorPos(ex, ey)
- print("X")
- sleep(0.1)
- Init()
- end
- end
- end
- drawMenu1 = function()
- term.setCursorPos(1,2)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.white)
- print("Power ")
- print("Reboot ")
- print("Email ")
- print("Code ")
- print("Timer ")
- print("Other >")
- term.setBackgroundColour(colours.red)
- term.setTextColour(colours.white)
- term.setCursorPos(11,8)
- print("X")
- term.setCursorPos(1, 8)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.white)
- print("Welcome ")
- term.setTextColour(colours.white)
- end
- drawTaskbar = function()
- term.setBackgroundColour(colours.blue)
- term.setCursorPos(1,1)
- term.clearLine()
- term.setCursorPos(1,1)
- term.setBackgroundColour(colours.lime)
- term.setTextColour(colours.white)
- term.setCursorPos(1,1)
- write("START")
- end
- drawMenu2 = function()
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- term.setCursorPos(contextX, contextY)
- print("Background ")
- term.setCursorPos(contextX, contextY + 1)
- print("OS code ")
- term.setCursorPos(contextX, contextY + 2)
- print("Time ")
- term.setCursorPos(contextX, contextY - 1)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.white)
- print("Shack-os V"..version)
- end
- function xToggleOn(text)
- term.setBackgroundColour(colours.pink)
- print(text)
- buttonSound()
- end
- function xToggleOff(text)
- term.setBackgroundColour(colours.red)
- print(text)
- sleep(0.1)
- end
- drawDesktop = function()
- term.setBackgroundColour(colours.lightBlue)
- clear()
- OriginCoords()
- paintutils.drawImage(_dt, 1, 1)
- end
- drawMenu3 = function()
- term.setCursorPos(27,9)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.white)
- print("Other-Games")
- term.setCursorPos(27,10)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- print(" Worm ")
- term.setCursorPos(27,11)
- print(" Adventure ")
- end
- -----------------THIS is the function that runs the whole prog.----
- Init = function()
- _ms = 0
- drawDesktop()
- drawTaskbar()
- term.setCursorPos(1,17)
- term.setBackgroundColour(colours.green)
- term.clearLine()
- term.setCursorPos(1,18)
- term.clearLine()
- term.setCursorPos(1,19)
- term.clearLine()
- pinon()
- term.setCursorPos(35,1)
- print("Shack-OS V"..version)
- runTime()
- end
- ---------------------------------------------------------------------------
- drawMenu4 = function()
- term.setCursorPos(12,6)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.white)
- print("Other ")
- term.setCursorPos(12,7)
- term.setBackgroundColour(colours.white)
- term.setTextColour(colours.black)
- print("Paint a Picture")
- term.setCursorPos(12,8)
- print("File-Browser ")
- term.setCursorPos(12,9)
- print("test3 ")
- term.setCursorPos(12,10)
- print("Games >")
- end
- runTime = function()
- while running do
- event, button, x, y = os.pullEventRaw()
- if event == "mouse_click" then
- if _ms == 0 and button == 1 and x < 6 and y == 1 then
- term.setCursorPos(1,1)
- flashOff()
- term.setCursorPos(1,1)
- print("START")
- buttonSound()
- term.setCursorPos(1,1)
- flashOn()
- term.setCursorPos(1,1)
- print("START")
- drawMenu1()
- _ms = _ms + 1
- elseif _ms == 1 and button == 1 and x < 12 and y == 2 then
- term.setCursorPos(1,2)
- toggleOn("Power ")
- term.setCursorPos(1,2)
- toggleOff("Power ")
- os.shutdown()
- elseif _ms == 1 and button == 1 and x < 12 and y == 3 then
- term.setCursorPos(1,3)
- toggleOn("Reboot ")
- term.setCursorPos(1,3)
- toggleOff("Reboot ")
- os.reboot()
- elseif _ms == 1 and button == 1 and x < 12 and y == 4 then
- term.setCursorPos(1,4)
- toggleOn("Email ")
- term.setCursorPos(1,4)
- toggleOff("Email ")
- email()
- elseif _ms == 1 and button == 1 and x < 12 and y == 5 then
- term.setCursorPos(1,5)
- toggleOn("Code ")
- term.setCursorPos(1,5)
- toggleOff("Code ")
- shell.run("test")
- elseif _ms == 1 and button == 1 and x < 12 and y == 6 then
- term.setCursorPos(1,6)
- toggleOn("Timer ")
- term.setCursorPos(1,6)
- toggleOff("Timer ")
- Timer()
- elseif _ms == 1 and button == 1 and x < 12 and y == 7 then
- term.setCursorPos(1,7)
- toggleOn("Other >")
- term.setCursorPos(1,7)
- toggleOff("Other >")
- drawMenu4()
- _ms = 4
- elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 7 then
- term.setCursorPos(12,7)
- toggleOn("Paint a Picture")
- term.setCursorPos(12,7)
- toggleOff("Paint a Picture")
- shell.run("painter")
- elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 8 then
- term.setCursorPos(12,8)
- toggleOn("File-Browser ")
- term.setCursorPos(12,8)
- toggleOff("File-Browser ")
- shell.run("filebrowseros")
- shell.run("gui")
- elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 9 then
- term.setCursorPos(12,9)
- toggleOn("test3 ")
- term.setCursorPos(12,9)
- toggleOff("test3 ")
- elseif _ms == 4 and button == 1 and x > 11 and x < 28 and y == 10 then
- term.setCursorPos(12,10)
- toggleOn("Games >")
- term.setCursorPos(12,10)
- toggleOff("Games >")
- drawMenu3()
- _ms = 5
- elseif _ms == 5 and button == 1 and x >= 27 and x <=38 and y == 10 and event == "mouse_click" then
- term.setCursorPos(27,10)
- toggleOn(" Worm ")
- term.setCursorPos(27,10)
- toggleOff(" Worm ")
- term.setBackgroundColour(colours.black)
- term.setTextColour(colours.white)
- shell.run("worm")
- elseif _ms == 5 and button == 1 and x >= 27 and x <= 38 and y == 11 and event == "mouse_click" then
- term.setCursorPos(27,11)
- toggleOn(" Adventure ")
- term.setCursorPos(27,11)
- toggleOff(" Adventure ")
- term.setBackgroundColour(colours.black)
- term.setTextColour(colours.white)
- term.clear()
- shell.run("adventure")
- elseif _ms == 1 and button == 1 and x < 12 and x > 10 and y == 8 then
- term.setCursorPos(11,8)
- xToggleOn("X")
- term.setCursorPos(11,8)
- xToggleOff("X")
- clear()
- _ms = _ms - 1
- Init()
- elseif button == 1 and x >= 7 and x < 9 and y == 1 then
- term.setCursorPos(7,1)
- term.setBackgroundColour(colours.blue)
- term.setTextColour(colours.cyan)
- print("EE")
- buttonSound()
- term.setCursorPos(7,1)
- term.setBackgroundColour(colours.lightBlue)
- print("EE")
- sleep(0.1)
- window()
- elseif _ms>=0 and _ms<3 and x > 0 and x < 38 and y < 17 and y > 1 and button == 2 then
- contextX = x
- contextY = y
- term.setCursorPos(contextX, contextY)
- drawMenu2()
- _ms = 3
- elseif button==1 and _ms==3 and x >= contextX and x <= contextX+13 and y==contextY then
- term.setCursorPos(contextX, contextY)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.lightGrey)
- print("Background ")
- buttonSound()
- term.setCursorPos(contextX, contextY)
- term.setBackgroundColour(colours.white)
- print("Background ")
- sleep(0.1)
- shell.run("paint _dt")
- _ms = 0
- Init()
- elseif button==1 and _ms==3 and x >= contextX and x <= contextX+13 and y==contextY+1 then
- term.setCursorPos(contextX, contextY+1)
- term.setTextColour(colours.black)
- term.setBackgroundColour(colours.lightGrey)
- print("OS code ")
- buttonSound()
- term.setBackgroundColour(colours.white)
- term.setCursorPos(contextX, contextY+1)
- print("OS code ")
- sleep(0.1)
- shell.run("edit gui")
- _ms = 0
- Init()
- elseif button == 1 and _ms == 3 and x >= contextX and x <= contextX + 13 and y == contextY+2 then
- term.setCursorPos(contextX, contextY+2)
- toggleOn("Time ")
- term.setCursorPos(contextX, contextY+2)
- toggleOff("Time ")
- term.setCursorPos(23,10)
- term.setBackgroundColour(colours.black) --black and yellow black and yellow black and yellow
- term.setTextColour(colours.yellow)
- tincan = os.time()
- tincanreturns = textutils.formatTime(time, false)
- print(tincanreturns)
- sleep(3)
- Init()
- else
- _ms = 0
- Init()
- end
- end
- end
- end
- --------------------------------------------------------
- password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement