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

Title: Door lock is not working?

Started by DannySMc, 13 April 2013 - 05:43 AM
DannySMc #1
Posted 13 April 2013 - 07:43 AM
My simple door lock program keeps making an error, what am I missing?!
The Door Lock Code:

term.clear()
term.setCursorPos(1,1)
password = "nothing"
print [[
Danny's House (Emergency Entrance)
----------------------------------------------
Please enter password:
]]
sleep(1)
input = read("*")
if input == password then
  textutil.slowPrint("Verrifying Password..........")
  print("Password Accepted!")
  sleep(2)
  print("Access Granted for 8 Seconds")
  rs.setOutput("back",true)
  sleep(8)
  rs.setOutput("back",false)
  os.shutdown()
else
  textutils.slowPrint("Verrifying Password..........")
  print("Password Denied!")
  sleep(2)
  os.shutdown()
end

the error:

bios:338: [string "startup"]:16: unfinished string
SadKingBilly #2
Posted 13 April 2013 - 07:58 AM
textutil.slowPrint("Verifying Password….") on line 12 should be textutils.slowPrint("Verifying Password….")
DannySMc #3
Posted 13 April 2013 - 08:08 AM
textutil.slowPrint("Verifying Password….") on line 12 should be textutils.slowPrint("Verifying Password….")

did that still doesn't work….
PixelToast #4
Posted 13 April 2013 - 08:08 AM
you might also want to put this on the top:

local oldPull=os.pullEvent
os.pullEvent=os.pullEventRaw
and this on the bottom

os.pullEvent=oldPull
to prevent ctrl-t

EDIT:

textutil.slowPrint("Verifying Password….") on line 12 should be textutils.slowPrint("Verifying Password….")

did that still doesn't work….
what is the error?
and give us the full code
because theres nothing on line 16 to make a unfinished string error :(/>