Posted 12 October 2012 - 12:22 AM
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
[ERROR] function arguments expected
Started by dcleondc, 11 October 2012 - 10:22 PMPosted 12 October 2012 - 12:31 AM
the variable 'timeout' is not being declared.
Posted 12 October 2012 - 12:33 AM
Id, Name, Dis = rednet.recieve(timeout)
Id, Code, Dis = rednet.redieve(timeout)
it's rednet.receive, and the timeout it's only useful if you actually have a timeout, not just an undefined variable.
file:close
missing brackets.Fixed code:
local id, name, code
id, name = rednet.receive()
id, code = rednet.receive()
print("Code from ID: ", id)
print("Code will be saved as ", name)
sleep(0.5)
local file = fs.open(name, "w")
if file then
file.write(code)
file.close()
print("Saved as ", name)
else
print("Error saving to ", name)
end