Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = { ... }
- -- turtleid unload|finish|pause|restart [top|left|right|back]
- local turtleId = 0
- local cmd = ""
- local position = "top"
- local ack = nil
- if args[1] == nil or args[2] == nil then
- print("turtleId unload|finish|pause|restart [top|left|right|back]")
- return
- end
- turtleId = tonumber(args[1])
- cmd = args[2]
- if args[3] ~= nil then
- position = args[3]
- end
- cmd = cmd .. "Mining"
- print("Sending command " .. cmd .. " to turtle " .. turtleId .. " on " .. position .. " modem.")
- rednet.open(position)
- while true do
- rednet.send(turtleId, cmd)
- local senderId, message = rednet.receive(0.5)
- if message == "acknowledged" then
- break
- end
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement