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

Rednet help

Started by popdog15, 02 January 2013 - 10:38 AM
popdog15 #1
Posted 02 January 2013 - 11:38 AM
So I'm working on a program for my survival world that allows me to check the amount of fuel in my turtles. The problem is, (I'm making this in creative, for testing purposes etc) I don't get an output, unless you count the turtle side of the program stopping. Instead of giving me the output "Hi" it does nothing, except stop the turtle side of the program. Any idea why?
Here is a link to the code. Only edit it with good intentions.
http://notepad.cc/tiekoxu95
Doyle3694 #2
Posted 02 January 2013 - 01:18 PM
I noticed some problems. First of all, write and print should really be given parentheses.

write("test")
Looks so much better, and is so much easier to read than

write "test"

Moving through your code, I see that you are using .. on the side of tnum in the rednet.broadcast(). Though, since you have it all enclosed in "'s, lua thinks it all is a string.
after that, ..'s are only needed when there is a variable on the side. So
(tnum..anothernum)
Would be how to use it between 2 variables.
The last end is also not needed, since you have nothing to end :P/>


Last, the first parameter of rednet.receive is actually, conveniently enough, a number. So change
"1"
to just
1