Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drone = component.proxy(component.list('drone')())
- local leash = component.proxy(component.list('leash')())
- local RED = 0xff0000
- local GREEN = 0x00ff00
- local YELLOW = 0xffff00
- local BLUE = 0x0000ff
- local targetName = ""
- drone.setLightColor(GREEN)
- leash.unleash()
- while true do
- local e,ad,x,y,z,entityName = computer.pullSignal(1,"motion")
- if(not e) then
- drone.setLightColor(YELLOW)
- for i=0,5 do
- if(leash.leash(i)) then
- drone.setLightColor(BLUE)
- while true do
- computer.beep(500)
- computer.beep(800)
- end
- end
- end
- else
- drone.setStatusText(string.format("%s",targetName))
- if(entityName ~= "AR2000AR") then
- if(targetName == "") then targetName = entityName end
- if(targetName == entityName) then
- computer.beep()
- drone.setLightColor(RED)
- drone.move(x/2,(y/2)+1.5,z/2)
- end
- else
- drone.setLightColor(GREEN)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement