23 posts
Location
In A Computer
Posted 27 June 2016 - 01:05 AM
Every time I try to send a file to my other computer with rednet it fails due to rednet:87: Expected number. And yes, I have tried using tonumber to convert the string value. Here are the links to the programs: Sendfile:
http://pastebin.com/fj5wxhNi Getfile:
http://pastebin.com/5iTL2hZu
1220 posts
Location
Earth orbit
Posted 27 June 2016 - 01:13 AM
You have your arguments reversed on lines 8 and 9. It's rednet.send(id, message), not rednet.send(message, id)
Edited on 26 June 2016 - 11:15 PM
23 posts
Location
In A Computer
Posted 27 June 2016 - 01:15 AM
You have your arguments reversed on lines 8 and 9. It's rednet.send(id, message), not rednet.send(message, id)
Well now I feel stupid…. Thanks! :)/>
23 posts
Location
USA
Posted 27 June 2016 - 01:25 AM
It's because you got the rednet arguments confused. Its…
rednet.send(id, msg)
This should work for the sending.
rednet.open("top")
tArgs = {...}
id = tonumber(tArgs[2])
if fs.exists(tArgs[1]) then
textutils.slowPrint("Sending File "..tArgs[1].."...")
rednet.send(id, "FileTransfer")
print("Sent File Transfer")
rednet.send(id, tArgs[1])
file = fs.open(tArgs[1], "r")
rednet.send(id, file.readAll())
else
print(tArgs[1].." does not exist.")
end
Edited on 26 June 2016 - 11:27 PM
23 posts
Location
In A Computer
Posted 27 June 2016 - 01:33 AM
Thanks, I just realized I accidentally posted two threads so I don't really know what to do about that….
Some how they merged?
2427 posts
Location
UK
Posted 27 June 2016 - 02:42 PM
Some how they merged?
moderators are stealthy