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

Computer wont pick up rednet signal

Started by boongfoot, 30 January 2013 - 05:35 PM
boongfoot #1
Posted 30 January 2013 - 06:35 PM
Unable to post a topic, need help with lua pretty bad iv got 2 computers just for a test so i can learn, trying to talk to each other

the main "control" computer and the "listener"

i want the control to send the listener a command to activate redstone on the left side. ill put in my code that i have already.

be warned im 2 days old to lua and coding in general so dont rage if its bad :P/>


-- "control" computer
rednet.open("top")
rednet.send(12,"on")
print("Lights are now; On")
sleep(3)
rednet.close("top")
-- "listerner" computer
rednet.open("top")
local side = "left"
while true do
  senderId,message,distance=rednet.receive()
if message == "on" then
rs.setOutput(left,true)
elseif message == "off" then
rs.setOutput(left,false)
end
end

hopefully you guys understand and are able to help me >.< this is bugging me cause I want to learn so bad haha, thanks again.
Cranium #2
Posted 30 January 2013 - 06:52 PM
Please read Stickies all the way through. Generic topic title added, as you didn't provide one.
boongfoot #3
Posted 30 January 2013 - 10:21 PM
Please read Stickies all the way through. Generic topic title added, as you didn't provide one.

Sorry about that, wont happen again, thanks for posting this though (or who ever did)
Doyle3694 #4
Posted 30 January 2013 - 10:45 PM
rs.setOutput(left, true)

You forgot the quotes around left ;)/> Same for the other line turning it off :)/>
While reading through your code however, I suspect you ment

rs.setOutput(side, true)
There should be no quotes around side (Just pointing out so I don't confuse you) if it's a variable rather than a direct string :)/>
boongfoot #5
Posted 30 January 2013 - 11:40 PM
rs.setOutput(left, true)

You forgot the quotes around left ;)/> Same for the other line turning it off :)/>
While reading through your code however, I suspect you ment

rs.setOutput(side, true)
There should be no quotes around side (Just pointing out so I don't confuse you) if it's a variable rather than a direct string :)/>


Thank you so much mate, it worked and i'm liking both this mod and this language more and more. This has been a more than pleasant start to my time on the forums here and a really good outcome.

thanks for showing me and explaining where I went wrong.