Posted 11 June 2014 - 07:09 PM
Hello again,
i got one more question using my little logfile.
Everytime, when a computer sends a command to my computer and it is not the authorized one, the program should save the senderId in a logfile.
My Program so far:
The Progam itself doesnt give any errors, but if it get's a command from a computer which is not authorized, it says:
"startup: 15: attempt to index ? (a nil value)"
I dont get it - what's wrong?
i got one more question using my little logfile.
Everytime, when a computer sends a command to my computer and it is not the authorized one, the program should save the senderId in a logfile.
My Program so far:
term.clear()
term.setCursorPos(1,1)
write("I'm your Server with ID: ")
write(os.getComputerID())
rednet.open("bottom")
local senderId, message, protocol = rednet.receive()
if senderId == 1 then
shell.run(message)
else
local file = fs.open("log", "a")
file.writeLine("BadBoy with ID: ") -- Line 15 (see below)
file.write(senderId)
file.close()
end
The Progam itself doesnt give any errors, but if it get's a command from a computer which is not authorized, it says:
"startup: 15: attempt to index ? (a nil value)"
I dont get it - what's wrong?