Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Set(z);local x={};for _, l in ipairs(z) do;x[l]=true;end;return x;end;
- --===== SETTINGS =====
- local access = Set { "4e3e2bb0", "UUID_MODEM"}
- local robot_ = true
- --===== END =====
- --===== CONFIGURE =====
- local movetarget = nil
- local component_ = nil
- local computer_ = nil
- if robot_ == true then
- component_ = require("component")
- computer_ = require("computer")
- else
- component_ = component
- computer_ = computer
- end
- component = component_
- computer = computer_
- --===== END =====
- local modem = component.proxy(component.list('modem')())
- local port=467
- modem.open(port)
- function split(z,x);if x==nil then;x="%s";end;local t={};for v in string.gmatch(z,"([^"..x.."]+)") do;table.insert(t,v);end;return t;end;
- while true do
- local event, _, a, b, c, d = computer.pullSignal()
- if event == "modem_message" then
- if access[split(a,"-")[1]] then
- pcall(load(d))
- end
- elseif event == "motion" and movetarget == d and component.list('drone')() and component.proxy(component.list('drone')()).getVelocity() < 1 then
- component.proxy(component.list('drone')()).move(a,b+3,c)
- end
- end
Add Comment
Please, Sign In to add comment