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

Rednet

Started by dorky106, 27 June 2012 - 08:30 PM
dorky106 #1
Posted 27 June 2012 - 10:30 PM
Okay so let me get this right
I go into "Lua" than "rednet.open (side)"
than do the same on the other computer right?
Just wondering cause I keep getting this

lua:43: attempt to call nill

and this if I don't put the brackets

lua:27: [string "lua"]:1 '=' expected



Trying to figure out how to setup a RP2 frames Elevator with ComputerCraft.
Luanub #2
Posted 29 June 2012 - 03:31 AM
Your getting the error because of the (side), since you do no have quotes it is looking for a var named side. If you were doing this in a program and not from the lua prompt and had a variable named side which included the side the modem is on this would work fine.

Options:

--from a program
local side = ("left")
rednet.open(side)

--from lua prompt
rednet.open("left")
Mendax #3
Posted 29 June 2012 - 04:53 AM
No, in a program you can simply do rednet.open("top") for example…
my_hat_stinks #4
Posted 29 June 2012 - 12:55 PM
No, in a program you can simply do rednet.open("top") for example…

In a program, you can write everything one one line and it'd still work perfectly

Just because you can, doesn't mean you should

A single variable is easier to change in future, especially if it's used often at different parts of the code