Posted 21 September 2012 - 02:49 PM
okay, so I have a computer thats running as a bank server now, and it needs to ensure that only authorised computers can do stuff.
so, there's a script in there that does:
now I have a file on the server at "\ids" that is just a list of authorised computer ids, like:
278
295
445
end
and now here's my code for seeing if the communicating computer is on the list:
And I keep getting access denied. This is the first time I've tried using return. help please!
so, there's a script in there that does:
checkID, message = rednet.receive()
now I have a file on the server at "\ids" that is just a list of authorised computer ids, like:
278
295
445
end
and now here's my code for seeing if the communicating computer is on the list:
local function auth()
authID = fs.open("\ids", "r")
while true do
IDA = authID.readLine()
if IDA == checkID then
return true
elseif IDA == "end" then
return false
end
end
end
if auth then
--whatever happens when its permitted.
else
--access denied.
end
And I keep getting access denied. This is the first time I've tried using return. help please!