Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle Slave Master
- -- By Fenthis
- slave_channel = 6969
- status_channel = 2069
- local modem = peripheral.wrap("right")
- -- Send a command
- local function send_command(message, group)
- x, y, z = gps.locate()
- if x then
- message.location = vector.new(x,y,z)
- end
- message.sender = os.getComputerLabel()
- message.group = group
- modem.transmit(slave_channel, status_channel,
- textutils.serialize(message))
- end
- args = {...}
- if #args < 2 then
- print("Usage: master group command [args...]")
- return
- end
- message = {
- ["message_type"] = "slave_command",
- ["command"] = args[2],
- ["args"] = { select(3, unpack(args)) }
- }
- send_command(message, args[1])
- print("Sent command \"" .. args[2] .. "\" to slave group " .. args[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement