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

Please delete

Started by xxx, 29 December 2012 - 06:06 AM
xxx #1
Posted 29 December 2012 - 07:06 AM
Please delete
Edited on 27 December 2013 - 03:37 PM
NDFJay #2
Posted 29 December 2012 - 07:11 AM
1) your if statement looks for a string so quote on and off like this

if input == "on" then
————————–
if input == "off" then
—————————

2) I dont know much about rednet so hopefully someone else can answer that for you.

hope this help you
~NDFJay
xxx #3
Posted 29 December 2012 - 07:35 AM
Please delete
Edited on 27 December 2013 - 03:37 PM
Viproz #4
Posted 29 December 2012 - 07:35 AM
for rednet api you can go on the wiki http://computercraft.info/wiki/Rednet_(API) but i don't think you'll can do what you want.

you can always have 2 lines with the exact same message :


msg = "hello world"
rednet.send(54, msg)
rednet.send(69, msg)

or even with a for loop and a table
remiX #5
Posted 29 December 2012 - 09:45 AM
you can always have 2 lines with the exact same message :


msg = "hello world"
rednet.send(54, msg)
rednet.send(69, msg)

or even with a for loop and a table

With a table, you can do it like this:

-- Define the tables that we will send the command to
t_IDs = {54, 69, 32, 102, 19, 94}
-- Loop through the table and send the message to each ID
for i = 1, #t_IDs do
    rednet.send(t_IDs[i], msg)
end

That simple :)/>