Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = { ... }
- sw, sh = term.getSize()
- thaum = 0
- loggedin = 0
- passa = 0
- pass = ""
- password = "1337"
- function iB(sx, sy, lx, ly, x, y)
- if x >= sx and x <= lx then
- if y >= sy and y <= ly then
- return true;
- else
- return false;
- end
- else
- return false;
- end
- end
- function on(color, side)
- if side == 0 then side = "back" end
- redstone.setBundledOutput(side, color)
- end
- function off(side)
- if side == 0 then side = "back" end
- redstone.setBundledOutput(side, 0)
- end
- function pulse(color, side)
- on(color, side)
- sleep(0.3)
- off(side)
- end
- function dt(x, y, text, tcolor, bg)
- if tcolor == 0 then tcolor = colors.white end
- if bg == 0 then bg = colors.black end
- term.setCursorPos(x, y)
- term.setTextColor(tcolor)
- term.setBackgroundColor(bg)
- term.write(text)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- end
- function db(x, y, xs, ys, bg)
- for f = x, x+xs do
- for g = y, y+ys do
- term.setCursorPos(f, g)
- term.setBackgroundColor(bg)
- term.write(" ")
- end
- end
- term.setBackgroundColor(colors.black)
- end
- function openthaum()
- thaum = 1
- for times = 1,5 do
- pulse(colors.orange, 0)
- sleep(1.5)
- end
- for times = 1,5 do
- pulse(colors.lightBlue, 0)
- sleep(1.5)
- end
- end
- function togglepiston()
- pulse(colors.pink, 0)
- end
- function hidethaum()
- thaum = 0
- for times = 1,5 do
- pulse(colors.magenta, 0)
- sleep(1.5)
- end
- for times = 1,5 do
- pulse(colors.white, 0)
- sleep(1.5)
- end
- end
- function upelev()
- for times = 1, 27 do
- pulse(colors.lime, 0)
- sleep(1)
- end
- end
- function downelev()
- for times = 1, 27 do
- pulse(colors.yellow, 0)
- sleep(1)
- end
- end
- function writepass(number)
- if passa < 4 then
- pass = pass .. tostring(number)
- passa = passa + 1
- end
- end
- function draw()
- shell.run("clear")
- if loggedin == 0 then
- if passa >= 1 then db(4,2,4,3,colors.blue) else db(4,2,4,3,colors.white) end
- if passa >= 2 then db(10,2,4,3,colors.blue) else db(10,2,4,3,colors.white) end
- if passa >= 3 then db(16,2,4,3,colors.blue) else db(16,2,4,3,colors.white) end
- if passa >= 4 then db(22,2,4,3,colors.blue) else db(22,2,4,3,colors.white) end
- dt(9,7," 1 ",colors.cyan, colors.white)
- dt(14,7," 2 ",colors.cyan, colors.white)
- dt(19,7," 3 ",colors.cyan, colors.white)
- dt(9,9," 4 ",colors.cyan, colors.white)
- dt(14,9," 5 ",colors.cyan, colors.white)
- dt(19,9," 6 ",colors.cyan, colors.white)
- dt(9,11," 7 ",colors.cyan, colors.white)
- dt(14,11," 8 ",colors.cyan, colors.white)
- dt(19,11," 9 ",colors.cyan, colors.white)
- dt(9,13," R ",colors.cyan, colors.white)
- dt(14,13," 0 ",colors.cyan, colors.white)
- dt(8, 15, "Enter password!", colors.white, colors.blue)
- else
- dt(9, 1, "Control Panel", colors.cyan, colors.black)
- dt(24, 1, "Logout", colors.red, colors.black)
- dt(12, 19, "Update", colors.lime, colors.black)
- dt(7,4,"Play \"Still Alive\"",colors.lime, colors.black)
- dt(26,4,"X",colors.lime, colors.black)
- dt(6,6,"Play \"Want You Gone\"",colors.lime, colors.black)
- dt(27,6,"X",colors.lime, colors.black)
- if thaum == 1 then
- dt(6,8,"Close Thaumcraft Room",colors.lime, colors.black)
- else
- dt(6,8,"Open Thaumcraft Room",colors.lime, colors.black)
- end
- dt(9,10,"Ride Elevator",colors.lime, colors.black)
- end
- end
- draw()
- while true do
- event, button, xPos, yPos = os.pullEvent("mouse_click")
- if(event == "mouse_click")then
- if loggedin == 0 then
- if iB(9, 7, 12, 7, xPos, yPos) then writepass(1) end
- if iB(14, 7, 17, 7, xPos, yPos) then writepass(2) end
- if iB(19, 7, 21, 7, xPos, yPos) then writepass(3) end
- if iB(9, 9, 12, 9, xPos, yPos) then writepass(4) end
- if iB(14, 9, 17, 9, xPos, yPos) then writepass(5) end
- if iB(19, 9, 21, 9, xPos, yPos) then writepass(6) end
- if iB(9, 11, 12, 11, xPos, yPos) then writepass(7) end
- if iB(14, 11, 17, 11, xPos, yPos) then writepass(8) end
- if iB(19, 11, 21, 11, xPos, yPos) then writepass(9) end
- if iB(14, 13, 17, 13, xPos, yPos) then writepass(0) end
- if iB(9, 13, 12, 13, xPos, yPos) then
- pass = ""
- passa = 0
- end
- draw()
- if passa == 4 then
- if pass == password then
- loggedin = 1
- pass = ""
- passa = 0
- dt(7, 15, "Password correct!", colors.white, colors.lime)
- sleep(3)
- else
- dt(6, 15, "Password incorrect!", colors.white, colors.red)
- passa = 0
- pass = ""
- sleep(3)
- end
- end
- else
- if iB(24, 1, 29, 1, xPos, yPos) then loggedin = 0 end
- if iB(12, 19, 18, 19, xPos, yPos) then shell.run("update") end
- if iB(7, 4, 21, 4, xPos, yPos) then disk.playAudio("right") end
- if iB(26, 4, 26, 4, xPos, yPos) then disk.stopAudio("right") end
- if iB(6, 6, 22, 6, xPos, yPos) then disk.playAudio("left") end
- if iB(27, 6, 27, 6, xPos, yPos) then disk.stopAudio("left") end
- if iB(5, 8, 26, 8, xPos, yPos) then
- if thaum == 1 then
- thaum = 0
- dt(4,16,"Closing Thaumcraft Room",colors.lightBlue, colors.black)
- hidethaum()
- else
- thaum = 1
- dt(4,16,"Opening Thaumcraft Room",colors.lightBlue, colors.black)
- openthaum()
- end
- end
- if iB(9, 10, 16, 10, xPos, yPos) then
- dt(8,16,"Lift operating!",colors.lightBlue, colors.black)
- togglepiston()
- sleep(2)
- downelev()
- sleep(3)
- upelev()
- togglepiston()
- end
- end
- draw()
- sleep(0.2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement