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

[Lua][Error] startup:27: attempt to call nil

Started by Pricey123, 13 January 2013 - 11:32 AM
Pricey123 #1
Posted 13 January 2013 - 12:32 PM
Im not to sure but i guess that this maybe something linked to another problem im having?
http://www.computercraft.info/forums2/index.php?/topic/8798-luaerror-startup2-attempt-to-call-nil/

os.pullEvent = os.pullEventRaw
local locker = true
local failed = true
local attempted_login = true
local password_server = 0
rednet.open("right")
while locker do
attempted_login = false
term.clear()
term.setCursorPos(1,1)
print("Welcome to a USERS PC : Roaming Profile Enabled")
print("What would you like to do?")
print("[1] Login (*)")
print("[2] Shutdown")
write("> ")
local input = read()
if input == "2" then
  os.shutdown()
elseif input == "1" then
  attempted_login = true
  print("Please login...")
  write("Username: ")
  local username = read()
  write("Password: ")
  local password = read("*")
  rednet.send(password_server, username, true)
  senderId, message, distance = rednet.receive(5)
  if password == message then
   failed = false
   locker = false
   term.clear()
   term.setCursorPos(1,1)
   print("Welcome ", username)
  else
   print("Invalid Username or Password.")
   sleep(3)
  end
else
  print("Command not recognised...")
  sleep(2)
end
end
RunasSudo-AWOLindefinitely #2
Posted 13 January 2013 - 01:56 PM
Odd, there doesn't seem to be any problem in line 27.

senderId, message, distance = rednet.receive(5)
Where are you calling this program? Is this the "startup" program, or is this in some other program you are running?
Pricey123 #3
Posted 13 January 2013 - 08:40 PM
Odd, there doesn't seem to be any problem in line 27.

senderId, message, distance = rednet.receive(5)
Where are you calling this program? Is this the "startup" program, or is this in some other program you are running?
I am using this as startup as i am trying to make a user interferance for my factory
crazyguymgd #4
Posted 13 January 2013 - 09:14 PM
Well I ran your program without any errors so I'm not too sure why you would be having a problem.
And I just spent a little while trying to force the error with no luck so something else you are doing must be wrong.
Sorry I couldn't find the problem, just letting you know I tried.
Pricey123 #5
Posted 14 January 2013 - 01:02 AM
Well I ran your program without any errors so I'm not too sure why you would be having a problem.
And I just spent a little while trying to force the error with no luck so something else you are doing must be wrong.
Sorry I couldn't find the problem, just letting you know I tried.
Are you using tekkit?
because i am using tekkit and im not sure whether it is to be used on a updated version
crazyguymgd #6
Posted 14 January 2013 - 11:27 AM
how old of a version of cc are you using in that tekkit pack?
Pricey123 #7
Posted 15 January 2013 - 07:09 AM
Tekkit uses version 1.33
Lyqyd #8
Posted 15 January 2013 - 07:13 AM
Did you retype the program here or copy and paste it? Be sure the actual program has rednet.receive and not rednet.recieve.
remiX #9
Posted 15 January 2013 - 07:35 AM
Tekkit uses version 1.33

Download Tekkit lite :)/> It has CC 1.4+
Pricey123 #10
Posted 15 January 2013 - 07:35 AM
Did you retype the program here or copy and paste it? Be sure the actual program has rednet.receive and not rednet.recieve.

Hey thanks very much this seems to have fixed the error even on the other post.
Once again thanks
crazyguymgd #11
Posted 15 January 2013 - 07:43 AM
So you retyped the whole program to put it on here? Interesting… well glad it's fixed.
Pricey123 #12
Posted 15 January 2013 - 07:56 AM
But now each time i type in the correct username and passwords it comes up with Invalid Username Or Password? have i done something wrong in the other code?
http://www.computercraft.info/forums2/index.php?/topic/8798-luaerror-startup2-attempt-to-call-nil/
ChunLing #13
Posted 15 January 2013 - 06:21 PM
Have this program (and the other one) print out what they're sending and receiving, so that you can confirm that they match up and so forth.