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

Wi-fi reciever

Started by arthurdog, 04 July 2014 - 06:27 AM
arthurdog #1
Posted 04 July 2014 - 08:27 AM
print("online")
while true do
rednet.open(3)
message == "1"
then
redstone.setOutput("back",true)
sleep(30)
redstone.setOutput("back", false)
end
print("off")
end

Please correct my code

note this is 1.6.4
Obnoxious_Ninja #2
Posted 04 July 2014 - 04:54 PM
What exactly are you trying to do? Your title is vague, and you code is not much better.

Are you trying to make a rednet chat system or something of the sort?
Edited on 04 July 2014 - 02:54 PM
KingofGamesYami #3
Posted 04 July 2014 - 05:23 PM
I think he is trying to emulate wireless redstone.
corrected ( i think ) code

print( "online" )
rednet.open( "side" ) --#note, sides are not numaric.  "right", "left", "top", etc.
while true do
 local id, message = rednet.receive() --#recieve a message from the rednet
 if message == "1" then  --#I assume you sent "1", not 1, since 1 ~= "1"
  print( "on" )
  rs.setOutput("back", true)
  sleep( 30 ) --#pause for 30 seconds
  rs.setOutput("back", false)
 end
 print( "off" )
end