2 posts
Posted 02 October 2012 - 07:24 PM
The problem I am having is that I got a rednet program from someone else, so it has been tested and I have seen it work for them. When I try to use it, it gives me (redTest:4: attempt to index ? (nil value))
rednet.open("back")
while true do
senderId.message.distance=rednet.recieve()
print(senderId..":(/>/>"..distance..":"..message)
end
(There is a blank line between rednet and while, so the error has to do with rednet.recieve() statement)
please help
3790 posts
Location
Lincoln, Nebraska
Posted 02 October 2012 - 07:27 PM
You want the receive line to be this instead:
senderId, message, distance=rednet.receive() --separated by commas, not periods.
--Also, spell receive right :(/>/>
2 posts
Posted 02 October 2012 - 07:41 PM
Thank you Cranium, I did not realize that I was spelling receive wrong. I had also went on IRC and <FaintSpeaker> noticed the periods. I respelled the rednet.receive() and it worked
3790 posts
Location
Lincoln, Nebraska
Posted 02 October 2012 - 07:43 PM
It's actually a common mistake. I catch myself on it sometimes too. :(/>/>
55 posts
Posted 02 October 2012 - 08:30 PM
Oh man I spell receive wrong all the time. One of my two most frequent errors :(/>/>
2217 posts
Location
3232235883
Posted 02 October 2012 - 08:38 PM
same thing with coroutine.yield, so confusing some times
105 posts
Posted 03 October 2012 - 01:10 PM
While it's generally a stupid rule in my opinion, with far too many exceptions, the "I before E, except after C" rule actually applies in these cases.
1548 posts
Location
That dark shadow under your bed...
Posted 03 October 2012 - 01:47 PM
I hardly write code for myself anymore just because I'm tired of silly mistakes, I have written functions for everything, if I need to do something then that is how I do it