i know they are defined like so:
local words = { "word1", "word2" }
but i dont get how to use them. the next thing is in pairs. i see this in code all the time but what does it do?
for k,v in pairs do
what does that mean?. as im sure there are several different ways of using this, im going to state which one i need.im making a rednet login server. he is what i need
you send the user name to the login server. it then checks to make sure the id is approved. if the id and the user exists it sends the password back.
so here is a little code:
users = { "user1", "user2" } usernames
ids = { 1, 2, 3 } -- approved id's
pass = { "pass1", "pass2" }
senderId, message, distance = rednet.receive()
ok so if the message matches user1 it sends pass1. if it matches user2 it sends pass2. it only sends them though if the id of the sender is in the ids table.feel free to add any more uses.
thanks -Cheeky