Code:
Images:
u want pastebin?
Posted 23 March 2012 - 10:59 PM
Posted 24 March 2012 - 01:41 AM
Posted 24 March 2012 - 01:52 AM
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.Edited by Espen, 24 March 2012 - 01:59 AM.
Posted 24 March 2012 - 02:10 AM
Espen, on 24 March 2012 - 01:52 AM, said:
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.Posted 24 March 2012 - 02:25 AM
Zer0t3ch, on 24 March 2012 - 02:10 AM, said:
Espen, on 24 March 2012 - 01:52 AM, said:
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.nos.pullEvent = os.pullEvent os.pullEvent = os.pullEventRaw Yourcodehere os.pullEvent = nos.pullEvent --Resets it back to normal after you're done.
Posted 24 March 2012 - 02:26 AM
Edited by Espen, 24 March 2012 - 02:27 AM.
Posted 24 March 2012 - 02:31 AM
Posted 24 March 2012 - 02:42 AM
coolblockj, on 24 March 2012 - 02:25 AM, said:
Zer0t3ch, on 24 March 2012 - 02:10 AM, said:
Espen, on 24 March 2012 - 01:52 AM, said:
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.nos.pullEvent = os.pullEvent os.pullEvent = os.pullEventRaw Yourcodehere os.pullEvent = nos.pullEvent --Resets it back to normal after you're done.
Posted 24 March 2012 - 04:18 AM
Zer0t3ch, on 24 March 2012 - 02:42 AM, said:
coolblockj, on 24 March 2012 - 02:25 AM, said:
Zer0t3ch, on 24 March 2012 - 02:10 AM, said:
Espen, on 24 March 2012 - 01:52 AM, said:
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.nos.pullEvent = os.pullEvent os.pullEvent = os.pullEventRaw Yourcodehere os.pullEvent = nos.pullEvent --Resets it back to normal after you're done.
Posted 24 March 2012 - 04:44 AM
while true do pullEvent = os.pullEvent() os.pullEvent = os.pullEventRaw() os.pullEvent = pullEvent endAfter key press it instantly crashes, I have tried multiple variations, with and without parens, and this is what it is now. Any ideas?
Posted 24 March 2012 - 11:58 AM
local oldPullEvent = os.pullEvent -- Creates a copy of the function pullEvent under the local variable oldPullEvent os.pullEvent = pullEventRaw -- Overwrite the global function os.pullEvent with os.pullEventRaw -- From now on every call to os.pullEvent() is essentially the same as a call to os.pullEventRaw(). -- This effectively prevents program termination, because os.pullEventRaw does not stop the program when the 'terminate' event occurs. -- After you are done with your program we restore the global function os.pullEvent again with the backup we made at the beginning. os.pullEvent = oldPullEvent
Posted 24 March 2012 - 01:21 PM
Espen, on 24 March 2012 - 01:52 AM, said:
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
clear()
write("Kolpa s Privacy Terminal")
term.setCursorPos(2, 5)
write("Password: ")
while true do
local pass = read("*")
if pass == "test" then
clear()
write("acces granted")
os.sleep(2)
break; -- Break out of loop.
else
clear()
write("acces denied")
os.sleep(2)
os.reboot()
end
end
Note: Didn't test it ingame, but should work. If it doesn't, give me a holler.Posted 24 March 2012 - 08:33 PM
Espen, on 24 March 2012 - 11:58 AM, said:
local oldPullEvent = os.pullEvent -- Creates a copy of the function pullEvent under the local variable oldPullEvent os.pullEvent = pullEventRaw -- Overwrite the global function os.pullEvent with os.pullEventRaw -- From now on every call to os.pullEvent() is essentially the same as a call to os.pullEventRaw(). -- This effectively prevents program termination, because os.pullEventRaw does not stop the program when the 'terminate' event occurs. -- After you are done with your program we restore the global function os.pullEvent again with the backup we made at the beginning. os.pullEvent = oldPullEvent
Posted 04 April 2012 - 01:23 AM
0 members, 1 guests, 0 anonymous users