Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. --Job setup portions:
  2. state.Moving = M(false, "moving")
  3.  
  4. --User Setup Portions:
  5. state.EngagedMoving = M('Disabled','Enabled')
  6.  
  7. send_command('bind f1 gs c cycle EngagedMoving')
  8.  
  9. --User Unload Portion
  10.  
  11. send_command('unbind f1')
  12.  
  13.  
  14. --[[Put this down in the funny business section. You'll need to edit the sections for pl pl.x and pl.y then parts to include another and statements (in both the if and elseif part) to check to make sure your pet is not fighting. That way not only will it have a toggle that by default will not have you equip movementspeed gear in your engaged sets unless you turn the toggle on, but after you've edited it, ideally won't equip it if your pet is engaged either.]]
  15.  
  16. mov = {counter=0}
  17. if player and player.index and windower.ffxi.get_mob_by_index(player.index) then
  18. mov.x = windower.ffxi.get_mob_by_index(player.index).x
  19. mov.y = windower.ffxi.get_mob_by_index(player.index).y
  20. mov.z = windower.ffxi.get_mob_by_index(player.index).z
  21. end
  22.  
  23.  
  24. moving = false
  25. windower.raw_register_event('prerender',function()
  26. mov.counter = mov.counter + 1;
  27. if mov.counter>15 then
  28. local pl = windower.ffxi.get_mob_by_index(player.index)
  29. if pl and pl.x and mov.x and state.EngagedMoving.Value == 'Disabled' then
  30. if player.status ~= 'Engaged' then
  31. dist = math.sqrt( (pl.x-mov.x)^2 + (pl.y-mov.y)^2 + (pl.z-mov.z)^2 )
  32. if dist > 1 and not moving then
  33. state.Moving.value = true
  34. send_command('gs c update')
  35. if world.area:contains("Adoulin") then
  36. send_command('gs equip sets.Adoulin')
  37. else
  38. send_command('gs equip sets.MoveSpeed')
  39. end
  40.  
  41. moving = true
  42.  
  43. elseif dist < 1 and moving then
  44. state.Moving.value = false
  45. send_command('gs c update')
  46. moving = false
  47. end
  48. end
  49. elseif pl and pl.x and mov.x and state.EngagedMoving.Value == 'Enabled' then
  50. dist = math.sqrt( (pl.x-mov.x)^2 + (pl.y-mov.y)^2 + (pl.z-mov.z)^2 )
  51. if dist > 1 and not moving then
  52. state.Moving.value = true
  53. send_command('gs c update')
  54. if world.area:contains("Adoulin") then
  55. send_command('gs equip sets.Adoulin')
  56. else
  57. send_command('gs equip sets.MoveSpeed')
  58. end
  59.  
  60. moving = true
  61.  
  62. elseif dist < 1 and moving then
  63. state.Moving.value = false
  64. send_command('gs c update')
  65. moving = false
  66. end
  67. end
  68. if pl and pl.x then
  69. mov.x = pl.x
  70. mov.y = pl.y
  71. mov.z = pl.z
  72. end
  73. mov.counter = 0
  74. end
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement