Jump to content




Print To The Middle Of The Screen Accidentaly


  • You cannot reply to this topic
2 replies to this topic

#1 mrpoopy345

  • Members
  • 148 posts
  • LocationMy Computer

Posted 23 August 2013 - 04: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.

#2 jay5476

  • Members
  • 289 posts

Posted 23 August 2013 - 04:53 PM

after term.clear you should do
term.setCursorPos(1,1)
to set back to very first position on first line

#3 mrpoopy345

  • Members
  • 148 posts
  • LocationMy Computer

Posted 23 August 2013 - 04:56 PM

THANK YOU!!!!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users