a
This commit is contained in:
parent
12ffbdc45d
commit
13ddce15ae
15 changed files with 8967 additions and 61 deletions
|
@ -1,4 +1,48 @@
|
|||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
print("Chaos Gremlin Protection System")
|
||||
local secret = "mrrrp"
|
||||
local input = ""
|
||||
write("log in: ")
|
||||
while true do
|
||||
peripheral.call("bottom","turnOn")
|
||||
sleep(0.05)
|
||||
local event, extra = os.pullEventRaw()
|
||||
if event == "terminate" then
|
||||
print("\nnice try")
|
||||
write("log in: ")
|
||||
input = ""
|
||||
elseif event == "char" then
|
||||
input = input .. extra
|
||||
write("*")
|
||||
elseif event == "key" then
|
||||
if extra == 259 and #input > 0 then
|
||||
x, y = term.getCursorPos()
|
||||
x = x - 1
|
||||
term.setCursorPos(x, y)
|
||||
write(" ")
|
||||
term.setCursorPos(x, y)
|
||||
input = string.sub(input, 1, string.len(input) - 1)
|
||||
elseif extra == 257 then
|
||||
if input == secret then
|
||||
break
|
||||
else
|
||||
print("\nbegone, intruder\n\""..input.."\" is wrong")
|
||||
write("log in: ")
|
||||
input = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print()
|
||||
-- w = _G.write
|
||||
-- p = _G.print
|
||||
-- _G.write = function(text)
|
||||
-- return w("meow ")
|
||||
-- end
|
||||
-- _G.print = function (...)
|
||||
-- p("meow ")
|
||||
-- end
|
||||
-- b = term.blit
|
||||
-- term.blit = function(text, fg, bg)
|
||||
-- b("meow", fg, bg)
|
||||
-- end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue