-- Provides access to MQ functionslocalmq=require('mq')-- The zone to be in for the event to be handledlocalrequired_zone='vexthaltwo_mission'-- The location to run away tolocalrun_away_loc={x=1222.67,y=-48.97,z=236.41,}-- The time to wait before returning to the group (15000 is 15 seconds)localreturn_delay=15000localfunctionrun_away()localmy_class=mq.TLO.Me.Class.ShortName()-- pause all the thingsmq.cmdf('/%s mode 0',my_class)mq.cmd('/mqp on')mq.cmd('/twist off')mq.cmd('/timed 5 /afollow off')mq.cmd('/nav stop')mq.cmd('/target clear')-- run awaymq.cmdf('/timed 10 /nav locxyz %d %d %d',run_away_loc.x,run_away_loc.y,run_away_loc.z)-- resume all the thingsmq.delay(return_delay)mq.cmdf('/%s mode 2',my_class)mq.cmd('/mqp off')mq.cmd('/twist on')endlocalfunctionevent_handler(line,target)ifnotmq.TLO.Zone.ShortName()==required_zonethenreturnendlocali_am_ma=mq.TLO.Group.Member(0).MainAssist()localmy_name=mq.TLO.Me.CleanName()localma_name=mq.TLO.Group.MainAssist.CleanName()-- run away if i am targeted and i am not the MA, or if the MA is targeted and i am not the MAif(target==my_nameandnoti_am_ma)or(target==ma_nameandnoti_am_ma)thenrun_away()endendreturn{eventfunc=event_handler}