Volaik

locateUser.lua

Oct 8th, 2023
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. modem = peripheral.find("modem")
  2. droneCon = peripheral.find("drone_interface")
  3.  
  4. rednet.open("left")
  5.  
  6. io.write("Input tablet ID: ")
  7. buddy = tonumber(read())
  8. rednet.send(buddy, "con1")
  9.  
  10. while true do
  11.     event, sender, message, protocol = os.pullEvent("rednet_message")
  12.     if protocol == sendLoc then
  13.         droneCon.clearArea()
  14.         userLoc = message
  15.         term.setCursorPos(1,2)
  16.         print(userLoc[1])
  17.         print(userLoc[2])
  18.         print(userLoc[3])
  19.         x = tonumber(userLoc[1])
  20.         y = tonumber(userLoc[2])
  21.         z = tonumber(userLoc[3])
  22.         droneCon.addArea(x, y, z)
  23.         droneCon.setAction("goto")
  24.     end
  25. end
Add Comment
Please, Sign In to add comment