Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local protocol = "doorOpener"
- local hostname = "doorLock"
- if args[1] == "update" then
- if args[2] == "run" then
- shell.run("pastebin", "run", "FuQ3WvPs 3iLiWjzs doorOpener run")
- else
- shell.run("pastebin", "run", "FuQ3WvPs 3iLiWjzs doorOpener")
- end
- else
- rednet.open("back")
- local hosts = rednet.lookup(protocol, hostname)
- if tonumber(hosts) then
- local tmpHosts = hosts
- hosts = {}
- hosts[1] = tmpHosts
- end
- for i = 1, 2, 1 do
- local m = {}
- m.x, m.y, m.z = gps.locate()
- for i = 1, #hosts, 1 do
- if not rednet.send(hosts[i], textutils.serialize(m), protocol) then
- error("Could not send message.")
- else
- -- print("Send: " .. textutils.serialize(m))
- end
- end
- sleep(1)
- end
- rednet.close("back")
- end
Add Comment
Please, Sign In to add comment