3 posts
Posted 15 April 2012 - 05:51 PM
I am about to start my own server. The code i wrote myself is going to have a password, if the password is correct, the doors open then closes itself. But its easly done to just do Ctrl + T and then Edit startup.
Easier question: How do i prevent Ctrl+T?
Here is the code:
term.clear()
term.setCursorPos(1,1)
print, blalbblabla
moreprint
wirte("Password: ")
input = read("*")
pass = "passhere"
if input == pass then
redstone give signal
sleep for 2 secs..
redstone remove signal..
os.reboot()
else
print moaar
sleep
os.reboot
end
474 posts
Posted 15 April 2012 - 05:57 PM
Easy. Code (Put it at TOP of your program):
os.pullEvent = os.pullEventRaw
And, your code is effed up.
3 posts
Posted 15 April 2012 - 06:02 PM
Easy. Code (Put it at TOP of your program):
os.pullEvent = os.pullEventRaw
And, your code is effed up.
Thank you so much! Your awesome :3
3 posts
Posted 15 April 2012 - 06:08 PM
Easy. Code (Put it at TOP of your program):
os.pullEvent = os.pullEventRaw
And, your code is effed up.
Btw, is it any way to edit that startup again?
474 posts
Posted 15 April 2012 - 06:10 PM
Easy. Code (Put it at TOP of your program):
os.pullEvent = os.pullEventRaw
And, your code is effed up.
Btw, is it any way to edit that startup again?
I'm too lazy to do that atm. xD
63 posts
Location
Amsterdam
Posted 15 April 2012 - 06:29 PM
You could try this
term.clear()
term.setCursorPos(1,1)
print, blalbblabla
moreprint
wirte("Password: ")
input = read("*")
pass = "passhere"
local debug = "debugpass"
if input == pass then
redstone give signal
sleep for 2 secs..
redstone remove signal..
os.reboot()
elseif input == debug then
exit()
else
print moaar
sleep
os.reboot
end
474 posts
Posted 15 April 2012 - 06:32 PM
You could try this
term.clear()
term.setCursorPos(1,1)
print, blalbblabla
moreprint
wirte("Password: ")
input = read("*")
pass = "passhere"
local debug = "debugpass"
if input == pass then
redstone give signal
sleep for 2 secs..
redstone remove signal..
os.reboot()
elseif input == debug then
exit()
else
print moaar
sleep
os.reboot
end
exit() will call nil, and give you an error, use error() instead of exit()
2447 posts
Posted 15 April 2012 - 07:15 PM
You could try this
term.clear()
term.setCursorPos(1,1)
print, blalbblabla
moreprint
wirte("Password: ")
input = read("*")
pass = "passhere"
local debug = "debugpass"
if input == pass then
redstone give signal
sleep for 2 secs..
redstone remove signal..
os.reboot()
elseif input == debug then
exit()
else
print moaar
sleep
os.reboot
end
exit() will call nil, and give you an error, use error() instead of exit()
Or you can do it properly, and exit using "return".