This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
joatoche's profile picture

Attempt to call nil when trying to call a function

Started by joatoche, 20 January 2014 - 02:24 PM
joatoche #1
Posted 20 January 2014 - 03:24 PM
Hello,

Today I was trying to create a simple program to test wireless modems. I set up two Advanced Computers and equipped both with Wireless Modems.

I created two programs, TestSend (for the first PC), and TestRec(ieve) (for the second one). The first one works fine, I loaded both on each computer with os.loadAPI at the Lua prompt, but whenever I try to call the function "recieveMessage" on TestRec, it says: "Attempt to call nil".

Here's the code of both programs.


TestSend: http://pastebin.com/7JzLZyCr
TestRec: http://pastebin.com/vEFPi423

Any help is appreciated :)/>

-joatoche (Joaquin Montero)
CometWolf #2
Posted 20 January 2014 - 05:32 PM
You misspelled "recieve" Therefore you get attempt to call nill on

senderID,message = rednet.recieve()
It's spelled receive.
joatoche #3
Posted 20 January 2014 - 10:59 PM
Thanks a lot :)/>

I do not speak English natively, so my orthography is not perfect.

Thanks again :)/>