Advertisement
Guest User

schlua

a guest
Jul 4th, 2015
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.54 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Motenten's Macro Book Function ** --
  3.  
  4. function get_sets()
  5. AccIndex = 1
  6. AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  7. IdleIndex = 1
  8. IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  9. Armor = 'None'
  10. StunIndex = 0
  11. Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  12. Obi = 'ON' -- Turn Default Obi ON or OFF Here --
  13. LowNuke = 'ON' -- Set Default Low Tier Nuke ON or OFF Here --
  14. Elemental_Staff = 'ON' -- Set Default Precast Elemental Staff ON or OFF Here --
  15. target_distance = 5 -- Set Default Distance Here --
  16. select_default_macro_book() -- Change Default Macro Book At The End --
  17.  
  18. Low_Tier_Spells = S{
  19. 'Fire','Aero','Water','Blizzard','Stone','Thunder','Fire II','Aero II','Water II',
  20. 'Blizzard II','Stone II','Thunder II'}
  21.  
  22. Non_Obi_Spells = S{
  23. 'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  24. 'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  25.  
  26. Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  27. Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  28. sc_map = {SC1 = "LightArts", SC2 = "Perpetuance", SC3 = "Accession"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  29.  
  30. sets.Idle = {}
  31. -- Idle Sets --
  32. sets.Idle.Refresh = {head="Spurrina Coif",
  33. neck="Twilight Torque",
  34. body="Arbatel Gown +1",
  35. hands="Hagondes Cuffs +1",
  36. back="Umbra Cape",
  37. waist="Slipor Sash",
  38. ear1="Moonshade Earring",
  39. ear2="Savant's Earring",
  40. ring1="Defending Ring",
  41. ring2="Dark Ring",
  42. legs="Assiduity Pants +1",
  43. feet="Iaso Boots",
  44. main="Bolelabunga",
  45. sub="Genbu's Shield",
  46. ammo="Incantor's Stone"}
  47. sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  48. feet="Iaso Boots"})
  49. sets.Resting = set_combine(sets.Idle.Movement,{})
  50.  
  51. -- PDT Set --
  52. sets.PDT = {}
  53.  
  54. -- Sublimation Set --
  55. sets.Sublimation = {}
  56.  
  57. sets.Precast = {}
  58. -- Fastcast Sets --
  59. sets.Precast.FastCast = {head="Nahtirah Hat",
  60. neck="Orunmila's Torque",
  61. body="Anhur Robe",
  62. hands="Gendewitha Gages +1",
  63. back="Swith Cape",
  64. waist="Witful Belt",
  65. ear1="Loquacious Earring",
  66. ear2="Enchanter Earring +1",
  67. ring1="Prolix Ring",
  68. ring2="Weatherspoon Ring",
  69. legs="Artsieq Hose",
  70. feet="Pedagogy Loafers +1",
  71. main="Keraunos",
  72. ammo="Incantor's Stone"}
  73.  
  74. sets.Precast.Impact = {head=empty,
  75. neck="Orunmila's Torque",
  76. body="Twilight Cloak",
  77. hands="Gendewitha Gages +1",
  78. back="Swith Cape",
  79. waist="Witful Belt",
  80. ear1="Loquacious Earring",
  81. ear2="Enchanter Earring +1",
  82. ring1="Prolix Ring",
  83. ring2="Weatherspoon Ring",
  84. legs="Artsieq Hose",
  85. feet="Pedagogy Loafers +1",
  86. main="Keraunos",
  87. ammo="Incantor's Stone"}
  88.  
  89. -- Elemental Staves --
  90. sets.Precast.Thunder = {main='Apamajas I'}
  91. sets.Precast.Water = {main='Haoma I'}
  92. sets.Precast.Fire = {main='Atar I'}
  93. sets.Precast.Ice = {main='Vourukasha I'}
  94. sets.Precast.Wind = {main='Vayuvata I'}
  95. sets.Precast.Earth = {main='Vishrava I'}
  96. sets.Precast.Light = {main='Arka I'}
  97. sets.Precast.Dark = {main='Xsaeta I'}
  98.  
  99. -- Precast Enhancing Magic --
  100. sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  101.  
  102. -- Precast Cure Set --
  103. sets.Precast.Cure = {head="Nahtirah Hat",
  104. neck="Orunmila's Torque",
  105. body="Heka's Kalasiris",
  106. hands="Gendewitha Gages +1",
  107. back="Pahtli Cape",
  108. waist="Witful Belt",
  109. ear1="Loquacious Earring",
  110. ear2="Enchanter Earring +1",
  111. ring1="Prolix Ring",
  112. ring2="Weatherspoon Ring",
  113. legs="Artsieq Hose",
  114. feet="Pedagogy Loafers +1",
  115. main="Keraunos",
  116. ammo="Incantor's Stone"}
  117.  
  118. -- Midcast Base Set --
  119. sets.Midcast = {}
  120.  
  121. -- Haste Set --
  122. sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{})
  123.  
  124. -- Cure Set --
  125. sets.Midcast.Cure = {head="Gendewitha Caubeen +1",
  126. neck="Colossus's Torque",
  127. body="Pedagogy Gown +1",
  128. hands="Telchine Gloves",
  129. back="Vates Cape +1",
  130. waist="Bishop's Sash",
  131. ear1="Beatific Earring",
  132. ear2="Healing Earring +1",
  133. ring1="Haoma's Ring",
  134. ring2="Sirona's Ring",
  135. legs="Academic's Pants +1",
  136. feet="Pedagogy Loafers +1",
  137. main="Bolelabunga",
  138. sub="Genbu's Shield",
  139. ammo="Incantor's Stone"}
  140.  
  141. -- Curaga Set --
  142. sets.Midcast.Curaga = {}
  143.  
  144. -- Enhancing Magic --
  145. sets.Midcast['Enhancing Magic'] = {head="Befouled Crown",
  146. neck="Colossus's Torque",
  147. body="Anhur Robe",
  148. hands="Arbatel Bracers +1",
  149. back="Merciful Cape",
  150. waist="Olympus Sash",
  151. ear1="Andoaa Earring",
  152. ear2="Enchanter Earring +1",
  153. ring1="Prolix Ring",
  154. ring2="Weatherspoon Ring",
  155. legs="Academic's Pants +1",
  156. feet="Regal Pumps +1",
  157. main="Kirin's Pole",
  158. ammo="Savant's Treatise"}
  159.  
  160. -- Stoneskin Set --
  161. sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  162.  
  163. -- Cursna Set --
  164. sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{})
  165.  
  166. -- Regen Set --
  167. sets.Midcast.Regen = {head="Arbatel Bonnet +1",
  168. neck="Colossus's Torque",
  169. body="Telchine Chasuble",
  170. hands="Arbatel Bracers +1",
  171. back="Bookworm's Cape",
  172. waist="Olympus Sash",
  173. ear1="Andoaa Earring",
  174. ear2="Enchanter Earring +1",
  175. ring1="Prolix Ring",
  176. ring2="Weatherspoon Ring",
  177. legs="Academic's Pants +1",
  178. feet="Regal Pumps +1",
  179. main="Kirin's Pole",
  180. ammo="Savant's Treatise"}
  181.  
  182. -- Stun Sets --
  183. sets.Midcast.Stun = {}
  184. sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  185. sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  186.  
  187. -- Dark Magic Sets --
  188. sets.Midcast['Dark Magic'] = {}
  189. sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  190. sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  191.  
  192. -- Low Tier Set --
  193. sets.LowNuke = {main="Lehbrailg +2",
  194. sub="Elder's Grip +1",
  195. ammo="Dosis Tathlum",
  196. head="Helios Band",
  197. body="Count's Garb",
  198. hands="Helios Gloves",
  199. legs="Hagondes Pants +1",
  200. feet="Helios Boots",
  201. neck="Eddy Necklace",
  202. waist="Hachirin-no-Obi",
  203. ear1="Friomisi Earring",
  204. ear2="Novio Earring",
  205. ring1="Shiva Ring +1",
  206. ring2="Shiva Ring +1",
  207. back="Bookworm's Cape"}
  208.  
  209. -- Elemental Sets --
  210. sets.Midcast['Elemental Magic'] = {main="Lehbrailg +2",
  211. sub="Elder's Grip +1",
  212. ammo="Dosis Tathlum",
  213. head="Helios Band",
  214. body="Count's Garb",
  215. hands="Helios Gloves",
  216. legs="Hagondes Pants +1",
  217. feet="Helios Boots",
  218. neck="Eddy Necklace",
  219. waist="Hachirin-no-Obi",
  220. ear1="Friomisi Earring",
  221. ear2="Novio Earring",
  222. ring1="Shiva Ring +1",
  223. ring2="Shiva Ring +1",
  224. back="Bookworm's Cape"}
  225. sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{main="Keraunos",body="Arbatel Gown +1"})
  226. sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  227.  
  228. -- Enfeebling Sets --
  229. sets.Midcast['Enfeebling Magic'] = {main="Keraunos",
  230. sub="Elder's Grip +1",
  231. ammo="Oreiad's Tathlum",
  232. head="Befouled Crown",
  233. body="Ischemia Chasuble",
  234. hands="Lurid Mitts",
  235. legs="Psycloth Lappas",
  236. feet="Helios Boots",
  237. neck="Imbodla Necklace",
  238. waist="Rumination Sash",
  239. ear1="Enchanter Earring +1",
  240. ear2="Gwati Earring",
  241. ring1="Leviathan Ring +1",
  242. ring2="Leviathan Ring +1",
  243. back="Ogapepo Cape"}
  244. sets.Midcast['Enfeebling Magic'].MidACC = set_combine(sets.Midcast['Enfeebling Magic'],{})
  245. sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  246.  
  247. -- Impact --
  248. sets.Midcast.Impact = {
  249. body="Twilight Cloak",
  250. back="Bookworm's Cape",
  251. waist="Oneiros Rope",
  252. hands="Helios Gloves",
  253. neck="Imbodla Necklace",
  254. ear1="Friomisi Earring",
  255. ear2="Gwati Earring",
  256. ring1="Shiva Ring +1",
  257. ring2="Shiva Ring +1",
  258. legs="Perdition Slops",
  259. feet="Helios Boots",
  260. ammo="Seraphic Ampulla"}
  261.  
  262. -- Elemental Obi/Twilight Cape --
  263. sets.Obi = {}
  264. sets.Obi.Thunder = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  265. sets.Obi.Water = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  266. sets.Obi.Fire = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  267. sets.Obi.Ice = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  268. sets.Obi.Wind = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  269. sets.Obi.Earth = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  270. sets.Obi.Light = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  271. sets.Obi.Dark = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  272.  
  273. -- JA Sets --
  274. sets.JA = {}
  275. sets.JA['Tabula Rasa'] = {legs="Peda. Pants"}
  276.  
  277. -- Perpetuance --
  278. sets.Perpetuance = {hands="Arbatel Bracers +1"}
  279.  
  280. -- Alacrity --
  281. sets.Alacrity = {feet="Peda. Loafers +1"}
  282.  
  283. -- Rapture --
  284. sets.Rapture = {head="Arbatel Bonnet +1"}
  285.  
  286. -- Melee Set --
  287. sets.Melee = set_combine(sets.Midcast.Haste,{head="Gendewitha Caubeen +1",
  288. neck="Twilight Torque",
  289. body="Ischemia Chasuble",
  290. hands="Hagondes Cuffs +1",
  291. back="Umbra Cape",
  292. waist="Chaac Belt",
  293. ear1="Savant's Earring",
  294. ear2="Enchanter Earring +1",
  295. ring1="Defending Ring",
  296. ring2="Dark Ring",
  297. legs="Assiduity Pants +1",
  298. feet="Battlecast Gaiters"})
  299.  
  300. -- WS Base Set --
  301. sets.WS = {}
  302. sets.WS.Shattersoul = {head="Befouled Crown",body="Helios Jacket",back="Toro Cape",
  303. waist="Yamabuki-no-obi",hands="Arbatel Bracers +1",neck="Imbodla Necklace",
  304. ring1="Shiva Ring +1",ring2="Shiva Ring +1",legs="Psycloth Lappas",feet="Arbatel Loafers +1"}
  305.  
  306. sets.WS.Myrkr = {head="Nahtirah Hat",body="Helios Jacket",back="Pahtli Cape",
  307. waist="Yamabuki-no-obi",hands="Helios Gloves",neck="Nuna Gorget +1",ear1="Andoaa Earring",
  308. ear2="Loquacious Earring",ring1="Globidonta Ring",ring2="Sangoma Ring",legs="Perdition Slops",
  309. feet="Arbatel Loafers +1"}
  310.  
  311. sets.WS.Omniscience = {}
  312.  
  313. sets.WS.Cataclysm = {head="Hagondes Hat +1",body="Count's Garb",back="Toro Cape",
  314. waist="Yamabuki-no-obi",hands="Helios Gloves",neck="Eddy Necklace",ear1="Friomisi Earring",
  315. ear2="Novio Earring",ring1="Shiva Ring +1",ring2="Shiva Ring +1",legs="Hagondes Pants +1",
  316. feet="Helios Boots"}
  317.  
  318. -- Idle Reive Set --
  319. sets.Reive = {neck="Arciela's Grace +1"}
  320. end
  321.  
  322. function pretarget(spell,action)
  323. if spell.action_type == 'Magic' or spell.type == "Ninjutsu" then -- Auto Use Echo Drops If You Are Silenced --
  324. if buffactive.silence then
  325. cancel_spell()
  326. send_command('input /item "Echo Drops" <me>')
  327. return
  328. end
  329. elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
  330. if buffactive.amnesia then
  331. cancel_spell()
  332. return
  333. else
  334. if not spell.english == 'Myrkr' and spell.target.distance > target_distance then -- Cancel WS If You Are Out Of Range --
  335. cancel_spell()
  336. add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  337. return
  338. end
  339. end
  340. elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  341. degrade_spell(spell,Cure_Spells)
  342. elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  343. degrade_spell(spell,Curaga_Spells)
  344. elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  345. if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  346. cancel_spell()
  347. send_command('input /ja Addendum: White <me>')
  348. elseif spell.english == "Manifestation" then
  349. cancel_spell()
  350. send_command('input /ja Accession <me>')
  351. elseif spell.english == "Alacrity" then
  352. cancel_spell()
  353. send_command('input /ja Celerity <me>')
  354. elseif spell.english == "Parsimony" then
  355. cancel_spell()
  356. send_command('input /ja Penury <me>')
  357. end
  358. elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  359. if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  360. cancel_spell()
  361. send_command('input /ja Addendum: Black <me>')
  362. elseif spell.english == "Accession" then
  363. cancel_spell()
  364. send_command('input /ja Manifestation <me>')
  365. elseif spell.english == "Celerity" then
  366. cancel_spell()
  367. send_command('input /ja Alacrity <me>')
  368. elseif spell.english == "Penury" then
  369. cancel_spell()
  370. send_command('input /ja Parsimony <me>')
  371. end
  372. end
  373. end
  374.  
  375. function precast(spell,action)
  376. if spell.action_type == 'Magic' or spell.type == "Ninjutsu" then
  377. if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  378. cancel_spell()
  379. add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  380. return
  381. else
  382. if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  383. equip(sets.Precast.Cure)
  384. elseif spell.english == "Impact" then
  385. equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  386. elseif spell.english == 'Utsusemi: Ni' then
  387. if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  388. cancel_spell()
  389. add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  390. return
  391. else
  392. equip(sets.Precast.FastCast)
  393. end
  394. elseif sets.Precast[spell.skill] then
  395. equip(sets.Precast[spell.skill])
  396. else
  397. equip(sets.Precast.FastCast)
  398. end
  399. end
  400. elseif spell.type == "WeaponSkill" then
  401. if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  402. cancel_spell()
  403. add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  404. return
  405. else
  406. if sets.WS[spell.english] then
  407. equip(sets.WS[spell.english])
  408. end
  409. end
  410. elseif spell.type == "JobAbility" then
  411. if sets.JA[spell.english] then
  412. equip(sets.JA[spell.english])
  413. end
  414. elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  415. cast_delay(0.2)
  416. send_command('cancel Sneak')
  417. end
  418. if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  419. equip(sets.Precast[spell.element])
  420. end
  421. if StunIndex == 1 then
  422. equip(sets.Midcast.Stun)
  423. end
  424. end
  425.  
  426. function midcast(spell,action)
  427. equipSet = {}
  428. if spell.action_type == 'Magic' or spell.type == 'Ninjutsu' then
  429. equipSet = sets.Midcast
  430. if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  431. if spell.english:startswith('Cure') then
  432. equipSet = equipSet.Cure
  433. elseif spell.english:startswith('Cura') then
  434. equipSet = equipSet.Curaga
  435. end
  436. if buffactive.Rapture then -- Equip Arbatel Bonnet +1 When Rapture Is Up For Curaga Spells --
  437. equipSet = set_combine(equipSet,sets.Rapture)
  438. end
  439. if world.day_element == spell.element or world.weather_element == spell.element then
  440. equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  441. end
  442. elseif spell.english == "Stoneskin" then
  443. if buffactive.Stoneskin then
  444. send_command('@wait 2.8;cancel stoneskin')
  445. end
  446. equipSet = equipSet.Stoneskin
  447. elseif spell.english == "Sneak" then
  448. if spell.target.name == player.name and buffactive['Sneak'] then
  449. send_command('cancel sneak')
  450. end
  451. equipSet = equipSet.Haste
  452. elseif spell.english:startswith('Regen') then -- Equip Arbatel Bonnet +1 When You Cast Regen Spells --
  453. equipSet = equipSet.Regen
  454. elseif string.find(spell.english,'storm') then equipSet = set_combine(equipSet,{feet="Peda. Loafers +1"})
  455. elseif spell.english:startswith('Banish') then
  456. equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  457. elseif spell.english == "Stun" and buffactive.Alacrity and world.weather_element == 'Thunder' then -- Equip Peda. Loafers +1 When Alacrity Is Up And Thunder Weather --
  458. equipSet = set_combine(equipSet,sets.Alacrity)
  459. elseif Low_Tier_Spells:contains(spell.english) and LowNuke == 'ON' then
  460. equipSet = set_combine(equipSet,sets.LowNuke)
  461. elseif spell.english:startswith('Utsusemi') then
  462. if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  463. send_command('@wait 1.7;cancel Copy Image*')
  464. end
  465. equipSet = equipSet.Haste
  466. elseif spell.english == 'Monomi: Ichi' then
  467. if buffactive['Sneak'] then
  468. send_command('@wait 1.7;cancel sneak')
  469. end
  470. equipSet = equipSet.Haste
  471. else
  472. if equipSet[spell.english] then
  473. equipSet = equipSet[spell.english]
  474. end
  475. if equipSet[spell.skill] then
  476. equipSet = equipSet[spell.skill]
  477. end
  478. if equipSet[AccArray[AccIndex]] then
  479. equipSet = equipSet[AccArray[AccIndex]]
  480. end
  481. if equipSet[spell.type] then
  482. equipSet = equipSet[spell.type]
  483. end
  484. if (spell.skill == 'Elemental Magic' or spell.english:startswith('Cur') or spell.english:startswith('Bio') or spell.english:startswith('Dia') or spell.english == 'Aspir' or spell.english == 'Drain') and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' and spell.english ~= "Cursna" then -- Use Obi Toggle To Equip Normal Waist Gear --
  485. equipSet = set_combine(equipSet,sets.Obi[spell.element])
  486. end
  487. end
  488. end
  489. if buffactive.Perpetuance and spell.skill == "Enhancing Magic" then -- Equip Arbatel Bracers +1 When You Cast Enhancing Spells --
  490. equipSet = set_combine(equipSet,sets.Perpetuance)
  491. elseif equipSet[spell.english] then
  492. equipSet = equipSet[spell.english]
  493. end
  494. equip(equipSet)
  495. if StunIndex == 1 then
  496. equip(sets.Midcast.Stun)
  497. end
  498. end
  499.  
  500. function aftercast(spell,action)
  501. if not spell.interrupted then
  502. if spell.english == "Sleep II" then -- Sleep II Countdown --
  503. send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  504. elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  505. send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  506. elseif spell.english == "Banish II" then -- Banish II Countdown --
  507. send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  508. end
  509. end
  510. status_change(player.status)
  511. end
  512.  
  513. function status_change(new,old)
  514. check_equip_lock()
  515. if Armor == 'PDT' then
  516. equip(sets.PDT)
  517. elseif buffactive["Sublimation: Activated"] then
  518. equip(sets.Sublimation)
  519. elseif new == 'Engaged' then
  520. equip(sets.Melee)
  521. elseif new == 'Idle' then
  522. equipSet = sets.Idle
  523. if equipSet[IdleArray[IdleIndex]] then
  524. equipSet = equipSet[IdleArray[IdleIndex]]
  525. end
  526. if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  527. equipSet = set_combine(equipSet,sets.Reive)
  528. end
  529. equip(equipSet)
  530. elseif new == 'Resting' then
  531. equip(sets.Resting)
  532. end
  533. if StunIndex == 1 then
  534. equip(sets.Midcast.Stun)
  535. end
  536. end
  537.  
  538. function buff_change(buff,gain)
  539. buff = string.lower(buff)
  540. if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  541. if gain then
  542. send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  543. else
  544. send_command('timers delete "Aftermath: Lv.3"')
  545. add_to_chat(123,'AM3: [OFF]')
  546. end
  547. elseif buff == 'weakness' then -- Weakness Timer --
  548. if gain then
  549. send_command('timers create "Weakness" 300 up')
  550. else
  551. send_command('timers delete "Weakness"')
  552. end
  553. end
  554. if not midaction() then
  555. status_change(player.status)
  556. end
  557. end
  558.  
  559. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  560. function self_command(command)
  561. if command == 'C1' then -- Magic Accuracy Toggle --
  562. AccIndex = (AccIndex % #AccArray) + 1
  563. add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  564. status_change(player.status)
  565. elseif command == 'C5' then -- Auto Update Gear Toggle --
  566. status_change(player.status)
  567. add_to_chat(158,'Auto Update Gear')
  568. elseif command == 'C2' then -- Stun Toggle --
  569. if StunIndex == 1 then
  570. StunIndex = 0
  571. add_to_chat(123,'Stun Set: [Unlocked]')
  572. else
  573. StunIndex = 1
  574. add_to_chat(158,'Stun Set: [Locked]')
  575. end
  576. status_change(player.status)
  577. elseif command == 'C3' then -- Obi Toggle --
  578. if Obi == 'ON' then
  579. Obi = 'OFF'
  580. add_to_chat(123,'Obi: [OFF]')
  581. else
  582. Obi = 'ON'
  583. add_to_chat(158,'Obi: [ON]')
  584. end
  585. status_change(player.status)
  586. elseif command == 'C7' then -- PDT Toggle --
  587. if Armor == 'PDT' then
  588. Armor = 'None'
  589. add_to_chat(123,'PDT Set: [Unlocked]')
  590. else
  591. Armor = 'PDT'
  592. add_to_chat(158,'PDT Set: [Locked]')
  593. end
  594. status_change(player.status)
  595. elseif command == 'C9' then -- LowNuke Toggle --
  596. if LowNuke == 'ON' then
  597. LowNuke = 'OFF'
  598. add_to_chat(123,'Low Nuke: [OFF]')
  599. else
  600. LowNuke = 'ON'
  601. add_to_chat(158,'Low Nuke: [ON]')
  602. end
  603. status_change(player.status)
  604. elseif command == 'C17' then -- Lock Main Weapon Toggle --
  605. if Lock_Main == 'ON' then
  606. Lock_Main = 'OFF'
  607. add_to_chat(123,'Main Weapon: [Unlocked]')
  608. else
  609. Lock_Main = 'ON'
  610. add_to_chat(158,'Main Weapon: [Locked]')
  611. end
  612. status_change(player.status)
  613. elseif command == 'C8' then -- Distance Toggle --
  614. if player.target.distance then
  615. target_distance = math.floor(player.target.distance*10)/10
  616. add_to_chat(158,'Distance: '..target_distance)
  617. else
  618. add_to_chat(123,'No Target Selected')
  619. end
  620. elseif command == 'C6' then -- Idle Toggle --
  621. IdleIndex = (IdleIndex % #IdleArray) + 1
  622. add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  623. status_change(player.status)
  624. elseif command:match('^SC%d$') then
  625. send_command('//' .. sc_map[command])
  626. end
  627. end
  628.  
  629. function check_equip_lock() -- Lock Equipment Here --
  630. if player.equipment.left_ring == "Warp Ring" or player.equipment.left_ring == "Capacity Ring" or player.equipment.right_ring == "Warp Ring" or player.equipment.right_ring == "Capacity Ring" then
  631. disable('ring1','ring2')
  632. elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  633. disable('back')
  634. elseif Lock_Main == 'ON' then
  635. disable('main','sub')
  636. else
  637. enable('main','sub','ring1','ring2','back')
  638. end
  639. end
  640.  
  641. function actualCost(originalCost)
  642. if buffactive["Penury"] then
  643. return originalCost*.5
  644. elseif buffactive["Light Arts"] then
  645. return originalCost*.9
  646. else
  647. return originalCost
  648. end
  649. end
  650.  
  651. function degrade_spell(spell,degrade_array)
  652. spell_index = table.find(degrade_array,spell.name)
  653. if spell_index > 1 then
  654. new_spell = degrade_array[spell_index - 1]
  655. change_spell(new_spell,spell.target.raw)
  656. add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
  657. end
  658. end
  659.  
  660. function change_spell(spell_name,target)
  661. cancel_spell()
  662. send_command('//'..spell_name..' '..target)
  663. end
  664.  
  665. function sub_job_change(newSubjob, oldSubjob)
  666. select_default_macro_book()
  667. end
  668.  
  669. function set_macro_page(set,book)
  670. if not tonumber(set) then
  671. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  672. return
  673. end
  674. if set < 1 or set > 10 then
  675. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  676. return
  677. end
  678.  
  679. if book then
  680. if not tonumber(book) then
  681. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  682. return
  683. end
  684. if book < 1 or book > 20 then
  685. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  686. return
  687. end
  688. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  689. else
  690. send_command('@input /macro set '..tostring(set))
  691. end
  692. end
  693.  
  694. function select_default_macro_book()
  695. -- Default macro set/book
  696. if player.sub_job == 'RDM' then
  697. set_macro_page(10, 10)
  698. elseif player.sub_job == 'BLM' then
  699. set_macro_page(10, 10)
  700. elseif player.sub_job == 'WHM' then
  701. set_macro_page(10, 10)
  702. else
  703. set_macro_page(10, 10)
  704. end
  705. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement