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

[Error] Locking Doors

Started by Bruno, 10 May 2012 - 10:13 PM
Bruno #1
Posted 11 May 2012 - 12:13 AM
I have an issue. I get a "startup:14: attempt to call nill" issue, and I don't know what's wrong.

I'm just messing around with LUA with no former experience, and there's something wrong and I can't figure out what it is.
_______________________________________

os.pullEvent = os.pullEventRaw
local side = "back"
local opentime = 5
term.clear (1)
term.setCursorPos (1,1)
write ("Enter Your Password: ")
local input = read("*")
if input  == (password) then
  term.clear (1)
  term.setCursorPos (1,1)
  print ("Oh em gee, congratulations!")
  rs,setOutPut (back, true)
  sleep (5)
  rs.setOutPut (back, false)
  os.reboot (1)
else
  term.clear (1)
  term.setCursporPos (1,1)
  print ("FUCK OFF!")
  sleep(2)
  os.reboot (1)
end
_________________________________________




Any ideas?
MysticT #2
Posted 11 May 2012 - 12:19 AM
Try changing rs.setOutPut to rs.setOutput. Also there's a comma that should be a period, but it might be a typo copying it here.
Bruno #3
Posted 11 May 2012 - 12:20 AM
Where at? I typed everything exact from what I've coded.

Also, I changed OutPut to Output, and now I get a different issue.

startup:14: bad argument: string expected, got nil
MysticT #4
Posted 11 May 2012 - 12:23 AM
Here:

rs,setOutPut (back, true)
sleep (5)
rs.setOutPut (back, false)
should be:

rs.setOutput (side, true)
sleep (5)
rs.setOutput (side, false)
Also changed "back" to "side", since that's the variable you are using for the side.
Bruno #5
Posted 11 May 2012 - 12:27 AM
Thanks, that fixed it.

I also have a slightly unrelated topic as well.

Where would I go to see what the usefulness of a floppy disc is?
MysticT #6
Posted 11 May 2012 - 12:44 AM
floppy disks lets you store your files and transfer them between computers, you need a disk drive to access them. Just put a disk drive next to the computer (on any of the six sides) and insert a floppy in it (right-click on the drive and put the disk on the gui), it will be available on the computer to store files like a directory. Just copy anything you want on the "disk" (without quotes) directory and it will be on the floppy.