Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.54 KB | None | 0 0
  1. include('no_interruptions.lua')
  2. include('spam_protection.lua')
  3. include('common_commands.lua')
  4. include('spell_stack.lua')
  5. include('how_about_no')
  6.  
  7. --Spell Stack Settings
  8. --Use auto curing true|false
  9. doCures = false
  10. --Use Divine Caress automatically true|false
  11. autoCaress = false
  12. --Use status cures and ally buffs on alliance true|false
  13. allianceCheck = false
  14. --Use cures on alliance true|false
  15. allianceHeal = false
  16. --Use Stoneskin automatically true|false
  17. autoSS = false
  18. --Use Blink automatically true|false
  19. autoBlink = false
  20. --Use Sublimation automatically true|false
  21. autoSub = false
  22. --Use Phalanx automatically true|false
  23. autoPhalanx = false
  24. --Use Aquaveil automatically true|false
  25. autoAquaveil = false
  26.  
  27. lastChat = 0
  28.  
  29. afBodyPercent = 70
  30.  
  31. valid_controllers = T{'Miang','Mazuki','Norzu','Ulor'}
  32.  
  33.  
  34.  
  35. function get_sets()
  36. indiOn = false
  37. geoOn = false
  38. repeatSpell = T{'Indi-Acumen','Indi-INT'}
  39. geoRepeatSpell = T{'Geo-Focus'}
  40. entrustTarget = 'Miang'
  41. entrustOn = false
  42. lastCast = 0
  43. sibyl = false
  44. kuyin = false
  45.  
  46. CurrentElement = 'Thunder'
  47. CurrentElementa = 'Thundara'
  48. helixName = 'Ionohelix'
  49. stormName = 'Thunderstorm'
  50. autoNuke = false
  51. aoeSpell = false
  52.  
  53. spellAcc = 'Low'
  54.  
  55. indiSpells = T{}
  56. indiSpells['Indi-Regen'] = 539
  57. indiSpells['Indi-Refresh'] = 541
  58. indiSpells['Indi-STR'] = 542
  59. indiSpells['Indi-DEX'] = 543
  60. indiSpells['Indi-VIT'] = 544
  61. indiSpells['Indi-AGI'] = 545
  62. indiSpells['Indi-INT'] = 546
  63. indiSpells['Indi-MND'] = 547
  64. indiSpells['Indi-CHR'] = 548
  65. indiSpells['Indi-Fury'] = 549
  66. indiSpells['Indi-Barrier'] = 550
  67. indiSpells['Indi-Acumen'] = 551
  68. indiSpells['Indi-Fend'] = 552
  69. indiSpells['Indi-Precision'] = 553
  70. indiSpells['Indi-Voidance'] = 554
  71. indiSpells['Indi-Focus'] = 555
  72. indiSpells['Indi-Attunement'] = 556
  73. indiSpells['Indi-Haste'] = 580
  74. indiSpells['Indi-Languor'] = -1
  75. indiSpells['Indi-Malaise'] = -1
  76. indiSpells['Indi-Wilt'] = -1
  77. indiSpells['Indi-Frailty'] = -1
  78. indiSpells['Indi-Fade'] = -1
  79. indiSpells['Indi-Vex'] = -1
  80. indiSpells['Indi-Slip'] = -1
  81. indiSpells['Indi-Torpor'] = -1
  82. indiSpells['Indi-Slow'] = -1
  83. indiSpells['Indi-Slow'] = -1
  84. indiSpells['Indi-Paralysis'] = -1
  85. indiSpells['Indi-Gravity'] = -1
  86. indiSpells['Indi-Poison'] = -1
  87.  
  88. indiSpellShortnames = T{regen = 'Indi-Regen',
  89. refresh = 'Indi-Refresh',
  90. str = 'Indi-STR',
  91. dex = 'Indi-DEX',
  92. agi = 'Indi-AGI',
  93. int = 'Indi-INT',
  94. mnd = 'Indi-MND',
  95. chr = 'Indi-CHR',
  96. att = 'Indi-Fury',
  97. fury = 'Indi-Fury',
  98. def = 'Indi-Barrier',
  99. barrier = 'Indi-Barrier',
  100. mab = 'Indi-Acumen',
  101. acumen = 'Indi-Acumen',
  102. matt = 'Indi-Acumen',
  103. mdb = 'Indi-Fend',
  104. fend = 'Indi-Fend',
  105. mdef = 'Indi-Fend',
  106. acc = 'Indi-Precision',
  107. precision = 'Indi-Precision',
  108. eva = 'Indi-Voidance',
  109. voidance = 'Indi-Voidance',
  110. macc = 'Indi-Focus',
  111. focus = 'Indi-Focus',
  112. meva = 'Indi-Attunement',
  113. attunement = 'Indi-Attunement',
  114. haste = 'Indi-Haste',
  115. mdefdown = 'Indi-Malaise',
  116. defdown = 'Indi-Frailty',
  117. mevadown = 'Indi-Languor',
  118. attdown = 'Indi-Wilt',
  119. mabdown = 'Indi-Fade',
  120. mattdown = 'Indi-Fade',
  121. maccdown = 'Indi-Vex',
  122. accdown = 'Indi-Slip',
  123. evadown = 'Indi-Torpor',
  124. slow = 'Indi-Slow',
  125. para = 'Indi-Paralysis',
  126. gravity = 'Indi-Gravity',
  127. weight = 'Indi-Gravity',
  128. poison = 'Indi-Poison',
  129. }
  130.  
  131. geoSpellShortnames = T{ regen = {spell='Geo-Regen',type='player'},
  132. refresh = {spell='Geo-Refresh',type='player'},
  133. str = {spell='Geo-STR',type='player'},
  134. dex = {spell='Geo-DEX',type='player'},
  135. agi = {spell='Geo-AGI',type='player'},
  136. int = {spell='Geo-INT',type='player'},
  137. mnd = {spell='Geo-MND',type='player'},
  138. chr = {spell='Geo-CHR',type='player'},
  139. att = {spell='Geo-Fury',type='player'},
  140. fury = {spell='Geo-Fury',type='player'},
  141. def = {spell='Geo-Barrier',type='player'},
  142. barrier = {spell='Geo-Barrier',type='player'},
  143. mab = {spell='Geo-Acumen',type='player'},
  144. acumen = {spell='Geo-Acumen',type='player'},
  145. matt = {spell='Geo-Acumen',type='player'},
  146. mdb = {spell='Geo-Fend',type='player'},
  147. fend = {spell='Geo-Fend',type='player'},
  148. mdef = {spell='Geo-Fend',type='player'},
  149. acc = {spell='Geo-Precision',type='player'},
  150. precision = {spell='Geo-Precision',type='player'},
  151. eva = {spell='Geo-Voidance',type='player'},
  152. voidance = {spell='Geo-Voidance',type='player'},
  153. macc = {spell='Geo-Focus',type='player'},
  154. focus = {spell='Geo-Focus',type='player'},
  155. meva = {spell='Geo-Attunement',type='player'},
  156. attunement = {spell='Geo-Attunement',type='player'},
  157. haste = {spell='Geo-Haste',type='player'},
  158. mdefdown = {spell='Geo-Malaise',type='bt'},
  159. defdown = {spell='Geo-Frailty',type='bt'},
  160. mevadown = {spell='Geo-Languor',type='bt'},
  161. attdown = {spell='Geo-Wilt',type='bt'},
  162. mabdown = {spell='Geo-Fade',type='bt'},
  163. mattdown = {spell='Geo-Fade',type='bt'},
  164. maccdown = {spell='Geo-Vex',type='bt'},
  165. accdown = {spell='Geo-Slip',type='bt'},
  166. evadown = {spell='Geo-Torpor',type='bt'},
  167. slow = {spell='Geo-Slow',type='bt'},
  168. para = {spell='Geo-Paralysis',type='bt'},
  169. gravity = {spell='Geo-Gravity',type='bt'},
  170. weight = {spell='Geo-Gravity',type='bt'},
  171. poison = {spell='Geo-Poison',type='bt'},
  172. }
  173.  
  174. lastHealSent = os.clock()
  175.  
  176. send_command('input /macro book 2;')
  177.  
  178. include('gear/Lenus_GEO.lua')
  179. end
  180.  
  181. function pretarget(spell)
  182. if spell.skill == 'Elemental Magic' then
  183. if spell.english:sub(-2) == 'ra III' then
  184. pretargRecastData = windower.ffxi.get_spell_recasts()
  185. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  186. cancel_spell()
  187. newSpell = spell.english:gsub(spell.english:sub(-2),"ra II")
  188. send_command('input /ma "'..newSpell..'" <t>;')
  189. end
  190. elseif spell.english:sub(-6) == 'ra II' then
  191. pretargRecastData = windower.ffxi.get_spell_recasts()
  192. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  193. cancel_spell()
  194. newSpell = spell.english:gsub(spell.english:sub(-6),"ra")
  195. send_command('input /ma "'..newSpell..'" <t>;')
  196. end
  197. elseif spell.english:sub(-2) == ' V' then
  198. pretargRecastData = windower.ffxi.get_spell_recasts()
  199. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  200. cancel_spell()
  201. newSpell = spell.english:gsub(spell.english:sub(-2)," IV")
  202. send_command('input /ma "'..newSpell..'" <t>;')
  203. end
  204. elseif spell.english:sub(-3) == ' IV' then
  205. pretargRecastData = windower.ffxi.get_spell_recasts()
  206. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  207. cancel_spell()
  208. newSpell = spell.english:gsub(spell.english:sub(-3)," III")
  209. send_command('input /ma "'..newSpell..'" <t>;')
  210. end
  211. elseif spell.english:sub(-3) == 'III' then
  212. pretargRecastData = windower.ffxi.get_spell_recasts()
  213. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  214. cancel_spell()
  215. newSpell = spell.english:gsub(spell.english:sub(-3)," II")
  216. send_command('input /ma "'..newSpell..'" <t>;')
  217. end
  218. elseif spell.english:sub(-3) == ' II' then
  219. pretargRecastData = windower.ffxi.get_spell_recasts()
  220. if (player.mp >= spell.mp_cost) and pretargRecastData[spell.recast_id] ~= nil and pretargRecastData[spell.recast_id] > 60 then
  221. cancel_spell()
  222. newSpell = spell.english:gsub(spell.english:sub(-3),"")
  223. send_command('input /ma "'..newSpell..'" <t>;')
  224. end
  225. end
  226. end
  227. end
  228.  
  229. function precast(spell,action)
  230. if check_ready(spell) then
  231. if spell.type == 'WeaponSkill' then
  232. if spell.target.distance > 10 or player.tp < 900 then
  233. cancel_spell()
  234. return
  235. end
  236.  
  237. if sets[spell.english] then
  238. equip(sets[spell.english])
  239. end
  240.  
  241. windower.add_to_chat(050, '['..spell.name..'] '..spell.target.name..' <'..player.tp..'%>')
  242. elseif spell.type == 'JobAbility' and sets.precast[spell.english] then
  243. equip(sets.precast[spell.english])
  244. elseif spell.type == 'Geomancy' then
  245. equip(sets.precast['Geomancy'])
  246. elseif spell.type == 'WhiteMagic' then
  247. if string.find(spell.english,'Cure') then
  248. equip(sets.precast['CureSet'])
  249. else
  250. equip(sets.precast['General'])
  251. end
  252. elseif spell.type == 'BlackMagic' then
  253. if spell.english == 'Impact' then
  254. equip(sets.precast['Impact'])
  255. else
  256. equip(sets.precast['General'])
  257. end
  258. else
  259. equip(sets.precast['General'])
  260. end
  261.  
  262. spam_protection_on(spell)
  263. else
  264. cancel_spell()
  265. end
  266. end
  267.  
  268. function midcast(spell,action)
  269. equipSet = sets.midcast['General']
  270. if spell.type == 'Ninjutsu' then
  271. if spell.english == 'Utsusemi: Ichi' then
  272. if buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  273. equip(sets['UtsuSet'])
  274. send_command('wait 1.5;cancel 66;cancel 446;cancel 445;cancel 444;')
  275. end
  276. elseif spell.english == 'Utsusemi: Ni' then
  277. equip(sets['UtsuSet'])
  278. elseif spell.type == 'Trust' then
  279. equip(sets['Trust'])
  280. end
  281. elseif spell.type == 'Geomancy' then
  282. equipSet = sets.midcast['Geomancy']
  283. elseif spell.type == 'WhiteMagic' then
  284. if string.find(spell.english,'Cure') then
  285. equipSet = sets.midcast['CureSet']
  286. elseif spell.skill == 'Enhancing Magic' then
  287. if spell.english == 'Stoneskin' then
  288. equipSet = sets.midcast['Stoneskin']
  289. elseif spell.english == 'Aquaveil' then
  290. equipSet = sets.midcast['Aquaveil']
  291. elseif spell.english == 'Haste' or spell.english == 'Invisible' or spell.english == 'Sneak' or spell.english:sub(-5) == 'storm' or spell.english:sub(-8) == 'storm II' or spell.english:sub(4) == 'Prot' or spell.english:sub(4) == 'Shel' or spell.english == 'Adloquium' or spell.english:sub(-6) == 'Animus' or spell.english == 'Blink' or spell.english == 'Refresh' then
  292. equipSet = sets.midcast['General']
  293. else
  294. equipSet = sets.midcast['Enhancing Magic']
  295. end
  296. elseif spell.skill == 'Enfeebling Magic' then
  297. equipSet = sets.midcast['Enfeebling Magic']
  298. end
  299. elseif spell.type == 'BlackMagic' then
  300. if spell.english == 'Drain' or spell.english == 'Drain II' or spell.english == 'Aspir' or spell.english == 'Aspir II' then
  301. equipSet = sets.midcast[spellAcc]['Drain']
  302. elseif spell.skill == 'Enfeebling Magic' then
  303. equipSet = sets.midcast['Enfeebling Magic']
  304. elseif spell.english == 'Impact' then
  305. equipSet = sets.midcast['Impact']
  306. elseif spell.skill == 'Elemental Magic' then
  307. equipSet = sets.midcast[spellAcc]['Elemental Magic']
  308. if buffactive['Reive Mark'] then
  309. equipSet = set_combine(equipSet, {neck="Arciela's Grace +1"})
  310. end
  311. if (((player.mp-spell.mp_cost)/player.max_mp)*100) < afBodyPercent then
  312. equipSet = set_combine(equipSet, sets['lowMpNuke'])
  313. end
  314. end
  315. elseif spell.type == 'Trust' then
  316. equipSet = set_combine(equipSet, sets['Trust'])
  317. end
  318.  
  319. equip(equipSet)
  320. end
  321.  
  322. function aftercast(spell,action)
  323. if spam_protection_off(spell)then
  324. handle_idle()
  325. end
  326. checkAftercast(spell)
  327. end
  328.  
  329. function status_change(new,old)
  330. handle_idle()
  331. end
  332.  
  333. function buff_change(buff,gain_or_loss)
  334. if gain_or_loss then
  335. if buff == 'Aftermath: Lv.3' then
  336. send_command('timers c "AM3" 180 up "Aftermath"')
  337. elseif buff == 'Aftermath: Lv.2' then
  338. send_command('timers c "AM2" 180 up "Aftermath"')
  339. elseif buff == 'Aftermath: Lv.1' then
  340. send_command('timers c "AM1" 180 up "Aftermath"')
  341. end
  342.  
  343. if buff == 'weakness' then
  344. send_command('timers c "Weakness" 300 up "Weakness"')
  345. end
  346. else
  347. if buff == 'Aftermath: Lv.3' then
  348. send_command('timers d "AM3"')
  349. elseif buff == 'Aftermath: Lv.2' then
  350. send_command('timers d "AM2"')
  351. elseif buff == 'Aftermath: Lv.1' then
  352. send_command('timers d "AM1"')
  353. elseif buff == 'encumbrance' then
  354. windower.send_command('gs c dt_end;')
  355. end
  356.  
  357. if buff == 'weakness' then
  358. send_command('timers d "Weakness"')
  359. end
  360. end
  361. end
  362.  
  363. function handle_idle()
  364. if player.status == 'Engaged' then
  365. equipSet = sets['Melee']
  366. elseif player.status == 'Resting' then
  367. equipSet = sets['Resting']
  368. if player.mpp < 50 then
  369. equipSet = set_combine(equipSet, sets['mpBelt'])
  370. end
  371. else
  372. equipSet = set_combine(sets['DT'],sets['BolelabungaSet'], sets['Running'])
  373.  
  374. if player.mpp < 50 then
  375. equipSet = set_combine(equipSet, sets['mpBelt'])
  376. end
  377. end
  378.  
  379. if buffactive['Reive Mark'] then
  380. equipSet = set_combine(equipSet, {neck="Arciela's Grace +1"})
  381. end
  382.  
  383. if pet.isvalid then
  384. equipSet = set_combine(equipSet, sets['Luopan_DT'])
  385. end
  386.  
  387. equip(equipSet)
  388. end
  389.  
  390. function self_command(command)
  391. if execute_common_command(command) then
  392. --done
  393. elseif command:slice(1,8) == 'nuke_req' then
  394. command = command:gsub("nuke_req ","")
  395. if command ~= nil and string.len(command) > 0 then
  396. local nuke_request = T{}
  397. local counter = 1
  398. for w in string.gmatch(command, "%w+") do
  399. nuke_request[counter] = w
  400. counter = counter + 1
  401. end
  402. if nuke_request[1] ~= nil then
  403. self_command('element '..nuke_request[1])
  404. if (nuke_request[2] == 'single' or nuke_request[2] == 'aoe') and nuke_request[3] ~= nil then
  405. local request_test = windower.ffxi.get_mob_by_id(nuke_request[3])
  406. if request_test ~= nil and request_test.id ~= nil then
  407. if nuke_request[2] ~= 'single' and request_test.distance <= 144 then
  408. if player.mp > 700 and is_spell_ready(CurrentElementa..' III') and request_test.hpp > 20 then
  409. send_command('//'..CurrentElementa..'3 '..nuke_request[3])
  410. elseif is_spell_ready(CurrentElementa..' II') then
  411. send_command('//'..CurrentElementa..'2 '..nuke_request[3])
  412. elseif is_spell_ready(CurrentElementa) then
  413. send_command('//'..CurrentElementa..' '..nuke_request[3])
  414. end
  415. else
  416. if is_spell_ready(CurrentElement..' V') then
  417. send_command('//'..CurrentElement..'5 '..nuke_request[3])
  418. elseif is_spell_ready(CurrentElement..' IV') then
  419. send_command('//'..CurrentElement..'4 '..nuke_request[3])
  420. elseif is_spell_ready(CurrentElement..' III') then
  421. send_command('//'..CurrentElement..'3 '..nuke_request[3])
  422. elseif is_spell_ready(CurrentElement..' II') then
  423. send_command('//'..CurrentElement..'2 '..nuke_request[3])
  424. elseif is_spell_ready(CurrentElement) then
  425. send_command('//'..CurrentElement..' '..nuke_request[3])
  426. end
  427. end
  428. end
  429. end
  430. end
  431. end
  432. elseif command == 'indi' then
  433. if indiOn then
  434. indiOn = false
  435. windower.add_to_chat(050,'Not using Indi- spells automatically')
  436. else
  437. indiOn = true
  438. windower.add_to_chat(050,'Using Indi- spells automatically')
  439. end
  440. elseif command == 'geo' then
  441. if geoOn then
  442. geoOn = false
  443. windower.add_to_chat(050,'Not using Geo- spells automatically')
  444. else
  445. geoOn = true
  446. windower.add_to_chat(050,'Using Geo- spells automatically')
  447. end
  448. elseif command == 'nuke' or command == 'autonuke' then
  449. if autoNuke then
  450. autoNuke = false
  451. windower.add_to_chat(050,'Not using nukes automatically (When engaged)')
  452. else
  453. autoNuke = true
  454. windower.add_to_chat(050,'Using nukes automatically (When engaged)')
  455. end
  456. elseif command == 'aoenuke' or command == 'aoe' then
  457. if aoeSpell then
  458. aoeSpell = false
  459. windower.add_to_chat(050,'Not using AoE nukes (When engaged)')
  460. else
  461. aoeSpell = true
  462. windower.add_to_chat(050,'Using AoE nukes (When engaged)')
  463. end
  464. elseif command == 'entruston' then
  465. if entrustOn then
  466. entrustOn = false
  467. windower.add_to_chat(050,'Not using Entrust automatically')
  468. else
  469. entrustOn = true
  470. windower.add_to_chat(050,'Using Entrust automatically')
  471. end
  472. elseif command:sub(1,9) == 'indispell' then
  473. commandSplit = T{}
  474. command = command:gsub("[%w ]+","%1")
  475. command = command:lower()
  476. if #command > 9 then
  477. command = command:sub(9,#command)
  478. commandSplit = string.split(command," ")
  479. table.clear(repeatSpell)
  480.  
  481. j = 1
  482. for i=1, #commandSplit, 1 do
  483. for shortcutName,shortcutSpellName in pairs(indiSpellShortnames) do
  484. if commandSplit[i] and commandSplit[i] == shortcutName then
  485. repeatSpell[j] = shortcutSpellName
  486. j = j + 1
  487. windower.add_to_chat(050,'Adding '..shortcutSpellName)
  488. end
  489. end
  490. end
  491. end
  492. elseif command:sub(1,8) == 'geospell' then
  493. commandSplit = T{}
  494. command = command:gsub("[%w ]+","%1")
  495. command = command:lower()
  496. if #command > 8 then
  497. command = command:sub(10,#command)
  498. geoRepeatSpell = false
  499. if command ~= '' then
  500. for shortcutName,shortcutSpell in pairs(geoSpellShortnames) do
  501. if command == shortcutName then
  502. geoRepeatSpell = shortcutSpell
  503. windower.add_to_chat(050,'Using '..shortcutSpell.spell)
  504. break
  505. end
  506. end
  507. end
  508. end
  509. elseif command:sub(1,7) == 'entrust' then
  510. command = command:gsub("entrust ", "")
  511. if #command > 0 then
  512. targetFound = checkName(command)
  513. if targetFound ~= '' and targetFound ~= player.name then
  514. entrustTarget = targetFound
  515. windower.add_to_chat(050,'Entrust target now ['..entrustTarget..']')
  516. else
  517. print('Player not found in party')
  518. end
  519. end
  520. elseif command == 'sneak' then
  521. send_command('input /ma "Sneak" <me>')
  522. elseif command == 'invisible' then
  523. send_command('input /ma "Invisible" <me>')
  524. elseif command == 'ws' and player.status == 'Engaged' and player.tp >= 1000 then
  525. send_command('input /ws "Full Swing" <t>;')
  526. elseif command:sub(1,7) == 'element' then
  527. targetElement = command:gsub("element ", "")
  528. targetElement = targetElement:gsub(" ", "")
  529. targetElement = targetElement:lower()
  530. if targetElement == 'water' then
  531. CurrentElement = 'Water'
  532. CurrentElementa = 'Watera'
  533. helixName = 'Hydrohelix'
  534. stormName = 'Rainstorm'
  535. windower.add_to_chat(167,"Water Mode")
  536. elseif targetElement == 'thunder' then
  537. CurrentElement = 'Thunder'
  538. CurrentElementa = 'Thundara'
  539. helixName = 'Ionohelix'
  540. stormName = 'Thunderstorm'
  541. windower.add_to_chat(167,"Thunder Mode")
  542. elseif targetElement == 'stone' then
  543. CurrentElement = 'Stone'
  544. CurrentElementa = 'Stonera'
  545. helixName = 'Geohelix'
  546. stormName = 'Sandstorm'
  547. windower.add_to_chat(167,"Stone Mode")
  548. elseif targetElement == 'aero' then
  549. CurrentElement = 'Aero'
  550. CurrentElementa = 'Aerora'
  551. helixName = 'Anemohelix'
  552. stormName = 'Rainstorm'
  553. windower.add_to_chat(167,"Aero Mode")
  554. elseif targetElement == 'blizzard' then
  555. CurrentElement = 'Blizzard'
  556. CurrentElementa = 'Blizzara'
  557. helixName = 'Cryohelix'
  558. stormName = 'Hailstorm'
  559. windower.add_to_chat(167,"Blizzard Mode")
  560. elseif targetElement == 'fire' then
  561. CurrentElement = 'Fire'
  562. CurrentElementa = 'Fira'
  563. helixName = 'Pyrohelix'
  564. stormName = 'Firestorm'
  565. windower.add_to_chat(167,"Fire Mode")
  566. end
  567. elseif command == 'trigger1' or command == 'next_element' then
  568. if CurrentElement == 'Water' then
  569. CurrentElement = 'Fire'
  570. CurrentElementa = 'Fira'
  571. helixName = 'Pyrohelix'
  572. stormName = 'Firestorm'
  573. windower.add_to_chat(167,"Fire Mode")
  574. elseif CurrentElement == 'Thunder' then
  575. CurrentElement = 'Water'
  576. CurrentElementa = 'Watera'
  577. helixName = 'Hydrohelix'
  578. stormName = 'Rainstorm'
  579. windower.add_to_chat(167,"Water Mode")
  580. elseif CurrentElement == 'Stone' then
  581. CurrentElement = 'Thunder'
  582. CurrentElementa = 'Thundara'
  583. helixName = 'Ionohelix'
  584. stormName = 'Thunderstorm'
  585. windower.add_to_chat(167,"Thunder Mode")
  586. elseif CurrentElement == 'Aero' then
  587. CurrentElement = 'Stone'
  588. CurrentElementa = 'Stonera'
  589. helixName = 'Geohelix'
  590. stormName = 'Sandstorm'
  591. windower.add_to_chat(167,"Stone Mode")
  592. elseif CurrentElement == 'Blizzard' then
  593. CurrentElement = 'Aero'
  594. CurrentElementa = 'Aerora'
  595. helixName = 'Anemohelix'
  596. stormName = 'Rainstorm'
  597. windower.add_to_chat(167,"Aero Mode")
  598. elseif CurrentElement == 'Fire' then
  599. CurrentElement = 'Blizzard'
  600. CurrentElementa = 'Blizzara'
  601. helixName = 'Cryohelix'
  602. stormName = 'Hailstorm'
  603. windower.add_to_chat(167,"Blizzard Mode")
  604. end
  605. elseif command == 'rtrigger1' or command == 'prev_element' then
  606. if CurrentElement == 'Water' then
  607. CurrentElement = 'Thunder'
  608. CurrentElementa = 'Thundara'
  609. helixName = 'Ionohelix'
  610. stormName = 'Thunderstorm'
  611. windower.add_to_chat(167,"Thunder Mode")
  612. elseif CurrentElement == 'Thunder' then
  613. CurrentElement = 'Stone'
  614. CurrentElementa = 'Stonera'
  615. helixName = 'Geohelix'
  616. stormName = 'Sandstorm'
  617. windower.add_to_chat(167,"Stone Mode")
  618. elseif CurrentElement == 'Stone' then
  619. CurrentElement = 'Aero'
  620. CurrentElementa = 'Aerora'
  621. helixName = 'Anemohelix'
  622. stormName = 'Windstorm'
  623. windower.add_to_chat(167,"Aero Mode")
  624. elseif CurrentElement == 'Aero' then
  625. CurrentElement = 'Blizzard'
  626. CurrentElementa = 'Blizzara'
  627. helixName = 'Cryohelix'
  628. stormName = 'Hailstorm'
  629. windower.add_to_chat(167,"Blizzard Mode")
  630. elseif CurrentElement == 'Blizzard' then
  631. CurrentElement = 'Fire'
  632. CurrentElementa = 'Fira'
  633. helixName = 'Pyrohelix'
  634. stormName = 'Firestorm'
  635. windower.add_to_chat(167,"Fire Mode")
  636. elseif CurrentElement == 'Fire' then
  637. CurrentElement = 'Water'
  638. CurrentElementa = 'Watera'
  639. helixName = 'Hydrohelix'
  640. stormName = 'Rainstorm'
  641. windower.add_to_chat(167,"Water Mode")
  642. end
  643. elseif command == 'tier1' or command == 't1' then
  644. if nukeType == 'single' then
  645. send_command('input /ma "'..CurrentElement..'" <t>;')
  646. else
  647. send_command('input /ma "'..CurrentElementa..'" <t>;')
  648. end
  649. if mirror_nuke then
  650. local target_info = windower.ffxi.get_mob_by_target('t')
  651. if type(target_info) == 'table' and target_info.id ~= nil then
  652. if nukeType == 'single' then
  653. execute_common_command('mirror ele '..CurrentElement..' single '..target_info.id)
  654. else
  655. execute_common_command('mirror ele '..CurrentElement..' aoe '..target_info.id)
  656. end
  657. end
  658. end
  659. elseif command == 'trigger3' or command == 'tier2' or command == 't2' then
  660. if nukeType == 'single' then
  661. send_command('input /ma "'..CurrentElement..' II" <t>;')
  662. else
  663. send_command('input /ma "'..CurrentElementa..' II" <t>;')
  664. end
  665. if mirror_nuke then
  666. local target_info = windower.ffxi.get_mob_by_target('t')
  667. if type(target_info) == 'table' and target_info.id ~= nil then
  668. if nukeType == 'single' then
  669. execute_common_command('mirror ele '..CurrentElement..' single '..target_info.id)
  670. else
  671. execute_common_command('mirror ele '..CurrentElement..' aoe '..target_info.id)
  672. end
  673. end
  674. end
  675. elseif command == 'trigger4' or command == 'tier3' or command == 't3' then
  676. if nukeType == 'single' then
  677. send_command('input /ma "'..CurrentElement..' III" <t>;')
  678. else
  679. send_command('input /ma "'..CurrentElementa..' III" <t>;')
  680. end
  681. if mirror_nuke then
  682. local target_info = windower.ffxi.get_mob_by_target('t')
  683. if type(target_info) == 'table' and target_info.id ~= nil then
  684. if nukeType == 'single' then
  685. execute_common_command('mirror ele '..CurrentElement..' single '..target_info.id)
  686. else
  687. execute_common_command('mirror ele '..CurrentElement..' aoe '..target_info.id)
  688. end
  689. end
  690. end
  691. elseif command == 'trigger5' or command == 'tier4' or command == 't4' then
  692. if nukeType == 'single' then
  693. send_command('input /ma "'..CurrentElement..' IV" <t>;')
  694. end
  695. if mirror_nuke then
  696. local target_info = windower.ffxi.get_mob_by_target('t')
  697. if type(target_info) == 'table' and target_info.id ~= nil then
  698. if nukeType == 'single' then
  699. execute_common_command('mirror ele '..CurrentElement..' single '..target_info.id)
  700. else
  701. execute_common_command('mirror ele '..CurrentElement..' aoe '..target_info.id)
  702. end
  703. end
  704. end
  705. elseif command == 'trigger6' or command == 'tier5' or command == 't5' then
  706. send_command('input /ma "'..CurrentElement..' V" <t>;')
  707. if mirror_nuke then
  708. local target_info = windower.ffxi.get_mob_by_target('t')
  709. if type(target_info) == 'table' and target_info.id ~= nil then
  710. execute_common_command('mirror ele '..CurrentElement..' single '..target_info.id)
  711. end
  712. end
  713. elseif stack_command(command) then
  714. --done
  715. end
  716. end
  717.  
  718. function handle_ping()
  719. if buffactive['petrification'] then
  720. if os.clock()-lastChat > 10 then
  721. send_command('input /p stoned')
  722. lastChat = os.clock()
  723. end
  724. elseif buffactive['sleep'] then
  725. if os.clock()-lastChat > 10 then
  726. send_command('input /p zzz')
  727. lastChat = os.clock()
  728. end
  729. end
  730.  
  731. if check_ready_silent() and player.x == lastx and player.y == lasty then
  732. if buffactive['silence'] and os.clock()-lastChat > 5 then
  733. send_command('input /item "Echo Drops" <me>;')
  734. lastChat = os.clock()
  735. end
  736.  
  737. if autoNuke and player.status == 'Engaged' and player.mp > 250 then
  738. if aoeSpell and is_spell_ready(CurrentElementa..' II') then
  739. direct_push(CurrentElementa..' II', 'ma', 't', false)
  740. elseif is_spell_ready(CurrentElement..' V') then
  741. direct_push(CurrentElement..' V', 'ma', 't', false)
  742. elseif is_spell_ready(CurrentElement..' IV') then
  743. direct_push(CurrentElement..' IV', 'ma', 't', false)
  744. elseif is_spell_ready(CurrentElement..' III') then
  745. direct_push(CurrentElement..' III', 'ma', 't', false)
  746. elseif aoeSpell and is_spell_ready(CurrentElementa) then
  747. direct_push(CurrentElementa, 'ma', 't', false)
  748. elseif is_spell_ready(CurrentElement..' II') then
  749. direct_push(CurrentElement..' II', 'ma', 't', false)
  750. elseif is_spell_ready(CurrentElement) then
  751. direct_push(CurrentElement, 'ma', 't', false)
  752. end
  753. end
  754.  
  755. if indiOn and #repeatSpell > 0 then
  756. if repeatSpell[1] == 'Indi-Acumen' then
  757. sibyl = false
  758. for i,v in pairs(partyData) do
  759. if type(v) == 'table' and partyData[i].name == 'StarSibyl' then
  760. sibyl = true
  761. end
  762. end
  763.  
  764. if (sibyl and (buffactive[indiSpells[repeatSpell[1]]] == 0 or buffactive[indiSpells[repeatSpell[1]]] == 1)) or (not sibyl and not buffactive[indiSpells[repeatSpell[1]]]) and os.clock()-lastCast > 60 and is_spell_ready(repeatSpell[1]) then
  765. direct_push_front(repeatSpell[1], 'ma', player.name, false)
  766. lastCast = os.clock()
  767. elseif entrustOn and #repeatSpell > 1 and #entrustTarget > 0 and is_spell_ready(repeatSpell[2]) and is_ability_ready('Entrust') and checkRange(entrustTarget,true) then
  768. direct_push_front(repeatSpell[2], 'ma', entrustTarget, false)
  769. direct_push_front('Entrust', 'ja', player.name, false)
  770. end
  771. elseif repeatSpell[1] == 'Indi-Precision' then
  772. kuyin = false
  773. for i,v in pairs(partyData) do
  774. if type(v) == 'table' and partyData[i].name == 'KuyinHathdenna' then
  775. kuyin = true
  776. end
  777. end
  778.  
  779. if (kuyin and (buffactive[indiSpells[repeatSpell[1]]] == 0 or buffactive[indiSpells[repeatSpell[1]]] == 1)) or (not kuyin and not buffactive[indiSpells[repeatSpell[1]]]) and os.clock()-lastCast > 60 and is_spell_ready(repeatSpell[1]) then
  780. direct_push_front(repeatSpell[1], 'ma', player.name, false)
  781. lastCast = os.clock()
  782. elseif entrustOn and #repeatSpell > 1 and #entrustTarget > 0 and is_spell_ready(repeatSpell[2]) and is_ability_ready('Entrust') and checkRange(entrustTarget,true) then
  783. direct_push_front(repeatSpell[2], 'ma', entrustTarget, false)
  784. direct_push_front('Entrust', 'ja', player.name, false)
  785. end
  786. else
  787. if indiSpells[repeatSpell[1]] == -1 and player.indi == nil then
  788. direct_push_front(repeatSpell[1], 'ma', player.name, false)
  789. elseif indiSpells[repeatSpell[1]] > 0 and not buffactive[indiSpells[repeatSpell[1]]] and is_spell_ready(repeatSpell[1]) then
  790. direct_push_front(repeatSpell[1], 'ma', player.name, false)
  791. elseif entrustOn and #repeatSpell > 1 and #entrustTarget > 0 and is_spell_ready(repeatSpell[2]) and is_ability_ready('Entrust') and checkRange(entrustTarget,true) then
  792. direct_push_front(repeatSpell[2], 'ma', entrustTarget, false)
  793. direct_push_front('Entrust', 'ja', player.name, false)
  794. end
  795. end
  796. end
  797.  
  798. if geoOn and geoRepeatSpell ~= false then
  799. if not pet.isvalid then
  800. if geoRepeatSpell.type == 'bt' and player.in_combat then
  801. direct_push_front(geoRepeatSpell.spell, 'ma', 't', false)
  802. elseif geoRepeatSpell.type == 'player' then
  803. direct_push_front(geoRepeatSpell.spell, 'ma', player.name, false)
  804. end
  805. else
  806. if geoRepeatSpell.type == 'player' then
  807. local tempx = player.x-pet.x
  808. local tempy = player.y-pet.y
  809. if math.sqrt((tempx*tempx)+(tempy*tempy)) > 7 then
  810. direct_push('Full Circle', 'ja', player.name, false)
  811. end
  812. end
  813. end
  814. end
  815.  
  816. if player.sub_job == 'NIN' and not buffactive['Copy Image (2)'] and not buffactive['Copy Image (3)'] and not buffactive['Copy Image (4)'] then
  817. if is_spell_ready('Utsusemi: Ni') then
  818. direct_push_front('Utsusemi: Ni', 'ma', player.name, false)
  819. elseif is_spell_ready('Utsusemi: Ichi') then
  820. direct_push_front('Utsusemi: Ichi', 'ma', player.name, false)
  821. end
  822. end
  823.  
  824. if buffactive['doom'] or buffactive['curse'] and is_spell_ready('Cursna') then
  825. direct_push_front('Cursna', 'ma', player.name, true)
  826. end
  827. if buffactive['poison'] then
  828. direct_push('Poisona', 'ma', player.name, true)
  829. end
  830.  
  831. if player.sub_job_level > 0 and player.sub_job == 'WHM' then
  832. if not buffactive['reraise'] and recastData[spellIDs['Reraise']] == 0 and player.mp > spellCosts['Reraise'] then
  833. direct_push('Reraise', 'ma', player.name, true)
  834. end
  835. if autoSS and not buffactive['stoneskin'] and is_spell_ready('Stoneskin') then
  836. direct_push('Stoneskin', 'ma', player.name, true)
  837. end
  838. if autoBlink and not buffactive['Blink'] and is_spell_ready('Blink') then
  839. direct_push('Blink', 'ma', player.name, true)
  840. end
  841. if autoAquaveil and not buffactive['Aquaveil'] and is_spell_ready('Aquaveil') then
  842. direct_push('Aquaveil', 'ma', player.name, true)
  843. end
  844. end
  845.  
  846. if player.in_combat then
  847. direct_push('Fira', 'ma', 't', true)
  848. end
  849.  
  850. check_auto_spell()
  851. if doCures then
  852. cure_process()
  853. end
  854. showArrayContents()
  855. handleSpareTime()
  856. else
  857. lastx = player.x
  858. lasty = player.y
  859. end
  860. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement