summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_autopilot.lua
blob: 0560477d380954d048d0e168bdb0553b5b31b1a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local LLAgent = require 'LLAgent'
local LLListener = require 'LLListener'

local pos = LLAgent.getGlobalPosition()
pos[1]+=10 -- delta x
pos[2]+=5  -- delta y
LLAgent.requestStand()
LLAgent.startAutoPilot{target_global=pos,allow_flying=false,stop_distance=1}

local listener = LLListener()

function listener:handleMessages(event_data)
    if event_data.success then
      print('Destination is reached')
      LLAgent.requestSit()
    else
      print('Failed to reach destination')
    end
    return false
end

listener:start(LLAgent.autoPilotPump)