Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local name = ""
- local channel = ""
- local channelPassword = ""
- local side = require("sides").left
- --*************Program start*********************
- local component = require("component")
- local tcp = require("tcp")
- client = tcp:connect(name)
- if client:isConnected() then
- client:sendString("createChannel "..channel.." "..channelPassword)
- client:sendString("joinChannel "..channel.." "..channelPassword)
- client:sendString("listenToChannel "..channel)
- while true do
- rcv = client:receiveString()
- tcp:execute(rcv, function(channel, from, label, args)
- if label=="on" then component.redstone.setOutput(side, 15) end
- if label=="off" then component.redstone.setOutput(side, 0) end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement