This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mrpoopy345's profile picture

Print To The Middle Of The Screen Accidentaly

Started by mrpoopy345, 23 August 2013 - 03:04 PM
mrpoopy345 #1
Posted 23 August 2013 - 05:04 PM
Sorry if i do something wrong, this is my first topic.

So, i wanted to make a password for a computer, and here is the code:

os.pullEvent = os.pullEventRaw
while true do
term.clear()
term.setCursorPos(1, 1)
print "Mrpoopy Security. Please enter password:"
input = read("*")
if input == "password" then
print "Access granted"
sleep(1)
term.clear()
print "CraftOS 1.5"
break
else
print "Incorrect."
sleep(1)
term.clear()
print "Locked."
sleep(20)
os.reboot()
end
end

But when it prints "CraftOS 1.5" or "Locked" They show up on the fourth line of the screen!
Help!
Thank you.
jay5476 #2
Posted 23 August 2013 - 05:53 PM
after term.clear you should do
term.setCursorPos(1,1)
to set back to very first position on first line
mrpoopy345 #3
Posted 23 August 2013 - 05:56 PM
THANK YOU!!!!