Advertisement
Guest User

Drone(OpenComputers)

a guest
Mar 26th, 2021
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. drone = component.proxy(component.list("drone")())
  2. modem = component.proxy(component.list("modem")())
  3. leash = component.proxy(component.list("leash")())
  4.  
  5. local port = 255
  6.  
  7. modem.open(port)
  8. local pass = tostring(math.random(100,999))
  9. drone.setStatusText(pass .. "     ")
  10. drone.setLightColor(0xFF0000)
  11.  
  12. function logn(pass)
  13.   local e = {computer.pullSignal()}
  14.   if e[1]=="modem_message" and e[6]==pass then
  15.     modem.broadcast(port, "Linked")
  16.  
  17.     return e[3]
  18.   else
  19.     modem.broadcast(port, "err")
  20.   end
  21. end
  22.  
  23.  
  24.  
  25.  
  26. while not user do
  27.   user = logn(pass)
  28. end
  29. drone.setStatusText("Linked")
  30. drone.setLightColor(0x0099FF)
  31. while true do
  32.  
  33.   local e = {computer.pullSignal()}
  34.   if e[1]=="modem_message" and e[3]==user then
  35.     pcall(load(e[6]))
  36.   end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement