term.clear() local basalt = require("basalt") local debugm = false local password = "08212002" local password2 = "ServerR00m" basalt.onEvent(function(event) if(event=="terminate")then if not debugm then return false end end end) local attemdatastore = io.open("datastore", "r") local attempt = attemdatastore:read() attemdatastore:close() local attempt = 1 local mainFrame = basalt.createFrame():setBackground(colors.black) local repet = 0 local input = mainFrame:addInput():setInputType("password"):setPosition(21,9):setSize(13,1):setBackground(colors.red) local submit = mainFrame:addButton():setPosition(25,10):setSize(5,3):setText("- ENTER -"):setForeground(colors.blue):setBackground(colors.black) local lockstat = mainFrame:addLabel():setText("LOCKED"):setFontSize(2):setForeground(colors.red):setPosition(19,14):setBackground(colors.black) local countdown = mainFrame:addLabel():setText("Locking in 5.."):setForeground(colors.red):setPosition(21,17):setBackground(colors.black):hide() submit:onClick(basalt.schedule(function() if( password==input:getValue()) or (password2==input:getValue()) then lockstat:setText("UNLOCKED"):setPosition(15,14):setForeground(colors.green) debugm = true redstone.setOutput("back", true) sleep(1) countdown:setText("Locking in 5.."):show():setPosition(21,17) sleep(1) countdown:setText("Locking in 4..") sleep(1) countdown:setText("Locking in 3..") sleep(1) countdown:setText("Locking in 2..") sleep(1) countdown:setText("Locking in 1..") sleep(1) countdown:setText("Locking..."):setPosition(23,17) sleep(1) redstone.setOutput("back", false) attemptnew = 1 local attemdatastore = io.open("datastore", "w") attemdatastore:write(attemptnew) attemdatastore:close() os.reboot() elseif not ( password==input:getValue()) or not (password2==input:getValue()) then redstone.setOutput("back", false) local attemdatastore = io.open("datastore", "r") attempt = attemdatastore:read() attemdatastore:close() repet = attempt * 5 + 1 attemptnew = attempt + 1 local attemdatastore = io.open("datastore", "w") attemdatastore:write(attemptnew) attemdatastore:close() countdown:setText("Incorrect Password"):show():setPosition(19,17) submit:hide() while repet > 0 do repet = repet - 1 countdown:setText(repet):show():setPosition(27,17) sleep(1) end if repet == 0 then countdown:setText("0"):hide() submit:show() end end end)) basalt.autoUpdate()