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/>
hopefully you guys understand and are able to help me >.< this is bugging me cause I want to learn so bad haha, thanks again.
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.