Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.find("modem")
- droneCon = peripheral.find("drone_interface")
- rednet.open("left")
- io.write("Input tablet ID: ")
- buddy = tonumber(read())
- rednet.send(buddy, "con1")
- while true do
- radius = 3
- for angle = 0,360,1 do
- event, sender, message, protocol = os.pullEvent("rednet_message")
- if protocol == sendLoc then
- userLoc = message
- --term.setCursorPos(1,2)
- --print(userLoc[1])
- --print(userLoc[2])
- --print(userLoc[3])
- droneCon.clearArea()
- x = tonumber(userLoc[1])
- y = tonumber(userLoc[2])
- z = tonumber(userLoc[3])
- radians = math.rad(angle)
- deltaX = radius * math.cos(radians)
- deltaY = radius * math.sin(radians)
- droneCon.addArea(x+deltaX, y+deltaY, z)
- droneCon.setAction("goto")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement