2 posts
Posted 31 March 2013 - 10:06 AM
i am trying to make a password server to control all computer passwords wirelessly. On the computer with the password i keep getting the same error when i type the password correctly. The error is
lock:20: attempt to index ? (a number value). If someone could please help me it would be greatly appreciated.
Here is the code:
http://pastebin.com/3AyFRHD3I did not make this code, i copied a video from youtube. All credit goes to him. Here is the link to the video:
http://www.youtube.com/watch?v=NF9RwBBS60QHe posted the source code for the server computer, but did not post the code for the client computers. so i copied his screen from the video.
1852 posts
Location
Sweden
Posted 31 March 2013 - 11:40 AM
Well.. I noticed directly that on line 6
local myId = os.computerID()
Should be
local myId = os.getComputerID()
Or does the first one work?
Since I have never tested it..
But the real error is this
rednet.send(serverId.password)
The error is that you've put a '.' instead of ','
So it should be
rednet.send(serverId,password)
1619 posts
Posted 31 March 2013 - 12:27 PM
Well.. I noticed directly that on line 6
local myId = os.computerID()
Should be
local myId = os.getComputerID()
Or does the first one work?
Since I have never tested it.
Either one works fine. ;)/>
103 posts
Location
Eclipse
Posted 31 March 2013 - 03:32 PM
If you want a good example for how this works and maybe some ideas, check out:
http://www.computercraft.info/forums2/index.php?/topic/11200-151-lnexi-security-system-v7043/page__fromsearch__1. It's something I made and uses the same concept you have.
7508 posts
Location
Australia
Posted 31 March 2013 - 03:42 PM
Well.. I noticed directly that on line 6
local myId = os.computerID()
Should be
local myId = os.getComputerID()
Or does the first one work?
Since I have never tested it..
Stupidly enough the devs have implemented
os.computerLabel()
os.getComputerLabel()
os.computerID()
os.getComputerID()
there is no point what so ever. but they have them.
2 posts
Posted 31 March 2013 - 08:29 PM
But the real error is this
rednet.send(serverId.password)
The error is that you've put a '.' instead of ','
So it should be
rednet.send(serverId,password)
I tried this and now it works perfectly. Thank you so much.