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

rednet:6: string expected

Started by Neon, 27 May 2014 - 08:00 AM
Neon #1
Posted 27 May 2014 - 10:00 AM
Hi :)/>
I'm writing a program to control the number of bookshelves within range of an enchanting bench.
I have two computers, one to control the pistons and one to interface with the user. I managed to get the interface to work, but i can't get the second program to work.

Here is the pastebin link http://pastebin.com/UnPFVgDd

it just returns the error :

rednet:6: string expected

Any help?

Cheers, Neon
Lignum #2
Posted 27 May 2014 - 06:29 PM
rednet.open()
The issue is on this line. You need to specify the side the modem is on as a string (hence "string expected").

e.g:
rednet.open("right")
CCJJSax #3
Posted 27 May 2014 - 10:03 PM
in addition to Lignum's response, you spelled receive wrong on line 3. (i before e except after c)

also, why make input a variable and not just use message?
lines 16-22 should be indented once more. (just for looks and clean looking code)
finally it's good practice to use

local var = 0
-- instead of
var = 0
Neon #4
Posted 29 May 2014 - 09:11 PM
Ok, thankyou very much :)/>