Advertisement
Bokura

Bokura_RDM

Jan 28th, 2014
1,593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.42 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 TP/WS/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.     MB = 'OFF' -- Set Default MB ON or OFF Here --
  15.     Elemental_Staff = 'ON' -- Set Default Precast Elemental Staff ON or OFF Here --
  16.     Enspells = 'ON' -- Set Default Enspells ON or OFF Here --
  17.     target_distance = 5 -- Set Default Distance Here --
  18.     select_default_macro_book() -- Change Default Macro Book At The End --
  19.  
  20.     Low_Tier_Spells = S{
  21.             'Fire','Aero','Water','Blizzard','Stone','Thunder','Fire II','Aero II','Water II',
  22.             'Blizzard II','Stone II','Thunder II'}
  23.  
  24.     Non_Obi_Spells = S{
  25.             'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  26.             'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  27.  
  28.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  29.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  30.     sc_map = {SC1 = "Composure", SC2 = "Stun", SC3 = "Chainspell"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  31.  
  32.     sets.Idle = {}
  33.     -- Idle Sets --
  34.     sets.Idle.Refresh = {}
  35.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  36.             legs="Blood Cuisses"})
  37.     sets.Resting = set_combine(sets.Idle.Movement,{})
  38.  
  39.     -- PDT Set --
  40.     sets.PDT = {}
  41.  
  42.     -- Sublimation Set --
  43.     sets.Sublimation = {}
  44.  
  45.     sets.Precast = {}
  46.  
  47.     -- Fastcast Set (empty = To Fix Club/Staff Issue) --
  48.     sets.Precast.FastCast = {
  49.             sub=empty}
  50.  
  51.     -- Elemental Staves --
  52.     sets.Precast.Lightning = {main='Apamajas I'}
  53.     sets.Precast.Water = {main='Haoma I'}
  54.     sets.Precast.Fire = {main='Atar I'}
  55.     sets.Precast.Ice = {main='Vourukasha I'}
  56.     sets.Precast.Wind = {main='Vayuvata I'}
  57.     sets.Precast.Earth = {main='Vishrava I'}
  58.     sets.Precast.Light = {main='Arka I'}
  59.     sets.Precast.Dark = {main='Xsaeta I'}
  60.  
  61.     -- Precast Enhancing Magic --
  62.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  63.  
  64.     -- Precast Enfeebling Magic --
  65.     sets.Precast['Enfeebling Magic'] = set_combine(sets.Precast.FastCast,{head="Leth. Chappel +1"})
  66.  
  67.     -- Precast Cure Set --
  68.     sets.Precast.Cure = {
  69.             sub=empty}
  70.  
  71.     -- Midcast Base Set --
  72.     sets.Midcast = {}
  73.  
  74.     -- Haste Set --
  75.     sets.Midcast.Haste = {
  76.             hands="Atrophy Gloves +1",
  77.             back="Ghostfyre Cape",
  78.             feet="Leth. Houseaux +1"}
  79.  
  80.     -- Cure Set --
  81.     sets.Midcast.Cure = {}
  82.  
  83.     -- Curaga Set --
  84.     sets.Midcast.Curaga = {}
  85.  
  86.     -- Enhancing Magic --
  87.     sets.Midcast['Enhancing Magic'] = {
  88.             body="Viti. Tabard +1",
  89.             hands="Viti. Gloves +1",
  90.             legs="Atrophy Tights +1",
  91.             feet="Leth. Houseaux +1"}
  92.  
  93.     -- Refresh --
  94.     sets.Midcast.Refresh = set_combine(sets.Midcast.Haste,{
  95.             back="Grapevine Cape",
  96.             legs="Leth. Fuseau +1"})
  97.  
  98.     -- Composure(Enhancing Magic On Others) Set --
  99.     sets.Composure = {
  100.             head="Leth. Chappel +1",
  101.             body="Lethargy Sayon +1",
  102.             hands="Leth. Gantherots +1",
  103.             back="Ghostfyre Cape",
  104.             legs="Leth. Fuseau +1",
  105.             feet="Leth. Houseaux +1"}
  106.  
  107.     -- Stoneskin --
  108.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  109.  
  110.     -- Phalanx --
  111.     sets.Midcast.Phalanx = set_combine(sets.Midcast['Enhancing Magic'],{})
  112.  
  113.     -- Cursna --
  114.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{})
  115.  
  116.     -- Stun Sets --
  117.     sets.Midcast.Stun = {}
  118.     sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  119.     sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  120.  
  121.     -- Dark Magic Sets --
  122.     sets.Midcast['Dark Magic'] = {}
  123.     sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  124.     sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  125.  
  126.     -- Low Tier Set --
  127.     sets.LowNuke = {}
  128.  
  129.     -- MB Set --
  130.     sets.MB = {}
  131.  
  132.     -- Elemental Sets --
  133.     sets.Midcast['Elemental Magic'] = {}
  134.     sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
  135.     sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  136.  
  137.     -- Enfeebling Sets --
  138.     sets.Midcast['Enfeebling Magic'] = {
  139.             head="Viti. Chapeau +1",
  140.             body="Lethargy Sayon +1",
  141.             hands="Leth. Gantherots +1",
  142.             feet="Vitivation Boots +1"}
  143.     sets.Midcast['Enfeebling Magic'].MidACC =  set_combine(sets.Midcast['Enfeebling Magic'],{})
  144.     sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
  145.  
  146.     -- Impact --
  147.     sets.Midcast.Impact = {
  148.             body="Twilight Cloak"}
  149.  
  150.     -- Elemental Obi/Twilight Cape --
  151.     sets.Obi = {}
  152.     sets.Obi.Lightning = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  153.     sets.Obi.Water = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  154.     sets.Obi.Fire = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  155.     sets.Obi.Ice = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  156.     sets.Obi.Wind = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  157.     sets.Obi.Earth = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  158.     sets.Obi.Light = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  159.     sets.Obi.Dark = {back="Twilight Cape",waist='Hachirin-no-Obi'}
  160.  
  161.     -- JA Sets --
  162.     sets.JA = {}
  163.     sets.JA.Chainspell = {body="Viti. Tabard +1"}
  164.     sets.JA.Saboteur = {hands="Leth. Gantherots +1"}
  165.  
  166.     -- Melee Sets --
  167.     sets.Melee = {}
  168.     sets.Melee.MidACC = set_combine(sets.Melee,{})
  169.     sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
  170.  
  171.     -- WS Base Set --
  172.     sets.WS = {}
  173.  
  174.     -- Chant du Cygne Sets --
  175.     sets.WS["Chant du Cygne"] = {}
  176.     sets.WS["Chant du Cygne"].MidACC = set_combine(sets.WS["Chant du Cygne"],{})
  177.     sets.WS["Chant du Cygne"].HighACC = set_combine(sets.WS["Chant du Cygne"].MidACC,{})
  178.  
  179.     -- Requiescat Sets --
  180.     sets.WS.Requiescat = {}
  181.     sets.WS.Requiescat.MidACC = set_combine(sets.WS.Requiescat,{})
  182.     sets.WS.Requiescat.HighACC = set_combine(sets.WS.Requiescat.MidACC,{})
  183.  
  184.     -- Knights of Round Set --
  185.     sets.WS["Knights of Round"] = {}
  186.  
  187.     -- Exenterator Sets --
  188.     sets.WS.Exenterator = {}
  189.     sets.WS.Exenterator.MidACC = set_combine(sets.WS.Exenterator,{})
  190.     sets.WS.Exenterator.HighACC = set_combine(sets.WS.Exenterator.MidACC,{})
  191.  
  192.     -- Evisceration Sets --
  193.     sets.WS.Evisceration = {}
  194.     sets.WS.Evisceration.MidACC = set_combine(sets.WS.Evisceration,{})
  195.     sets.WS.Evisceration.HighACC = set_combine(sets.WS.Evisceration.MidACC,{})
  196.  
  197.     -- Idle Reive Set --
  198.     sets.Reive = {neck="Arciela's Grace +1"}
  199. end
  200.  
  201. function pretarget(spell,action)
  202.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  203.         cancel_spell()
  204.         send_command('input /item "Echo Drops" <me>')
  205.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  206.         cancel_spell()
  207.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  208.         return
  209.     elseif spell.english:startswith("Cure") and player.mp<actualCost(spell.mp_cost) then
  210.         degrade_spell(spell,Cure_Spells)
  211.     elseif spell.english:startswith("Curaga") and player.mp<actualCost(spell.mp_cost) then
  212.         degrade_spell(spell,Curaga_Spells)
  213.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  214.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  215.             cancel_spell()
  216.             send_command('input /ja Addendum: White <me>')
  217.         elseif spell.english == "Manifestation" then
  218.             cancel_spell()
  219.             send_command('input /ja Accession <me>')
  220.         elseif spell.english == "Alacrity" then
  221.             cancel_spell()
  222.             send_command('input /ja Celerity <me>')
  223.         elseif spell.english == "Parsimony" then
  224.             cancel_spell()
  225.             send_command('input /ja Penury <me>')
  226.         end
  227.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  228.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  229.             cancel_spell()
  230.             send_command('input /ja Addendum: Black <me>')
  231.         elseif spell.english == "Accession" then
  232.             cancel_spell()
  233.             send_command('input /ja Manifestation <me>')
  234.         elseif spell.english == "Celerity" then
  235.             cancel_spell()
  236.             send_command('input /ja Alacrity <me>')
  237.         elseif spell.english == "Penury" then
  238.             cancel_spell()
  239.             send_command('input /ja Parsimony <me>')
  240.         end
  241.     end
  242. end
  243.  
  244. function precast(spell,action)
  245.     if spell.action_type == 'Magic' then
  246.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  247.             cancel_spell()
  248.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  249.             return
  250.         else
  251.             if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  252.                 equip(sets.Precast.Cure)
  253.             elseif spell.english == "Stun" then
  254.                 if buffactive.Composure then -- Cancel Composure When You Cast Stun --
  255.                     cast_delay(0.2)
  256.                     send_command('cancel Composure')
  257.                 end
  258.                 equip(sets.Precast.FastCast)
  259.             elseif spell.english == "Impact" then
  260.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  261.             elseif spell.english:startswith("En") and Enspells == 'ON' then
  262.                 local list={Dark="blizzard",Water="water",Earth="stone",Ice="blizzard",Fire="fire",Wind="aero",Lightning="thunder",Light="fire"}
  263.                 if spell.english ~= 'En'..list[world.day_element]..''..(spell.english:endswith(' II') and ' II' or '') then
  264.                     cancel_spell()
  265.                     send_command('@input /ma "En'..list[world.day_element]..''..(spell.english:endswith(' II') and ' II' or '')..'" <me>')
  266.                     return
  267.                 end
  268.             elseif spell.english == 'Utsusemi: Ni' then
  269.                 if buffactive['Copy Image (3)'] then
  270.                     cancel_spell()
  271.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  272.                     return
  273.                 else
  274.                     equip(sets.Precast.FastCast)
  275.                 end
  276.             elseif sets.Precast[spell.skill] then
  277.                 equip(sets.Precast[spell.skill])
  278.             else
  279.                 equip(sets.Precast.FastCast)
  280.             end
  281.         end
  282.     elseif spell.type == "WeaponSkill" then
  283.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  284.             cancel_spell()
  285.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  286.             return
  287.         else
  288.             equipSet = sets.WS
  289.             if equipSet[spell.english] then
  290.                 equipSet = equipSet[spell.english]
  291.             end
  292.             if equipSet[AccArray[AccIndex]] then
  293.                 equipSet = equipSet[AccArray[AccIndex]]
  294.             end
  295.             if (spell.english == "Chant du Cygne" or spell.english == "Evisceration") and player.tp > 2990 then -- Equip Jupiter's Pearl When You Have 3000 TP --
  296.                 equipSet = set_combine(equipSet,{ear1="Jupiter's Pearl"})
  297.             end
  298.             equip(equipSet)
  299.         end
  300.     elseif spell.type == "JobAbility" then
  301.         if sets.JA[spell.english] then
  302.             equip(sets.JA[spell.english])
  303.         end
  304.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  305.         cast_delay(0.2)
  306.         send_command('cancel Sneak')
  307.     end
  308.     if sets.Precast[spell.element] and Elemental_Staff == 'ON' then
  309.         equip(sets.Precast[spell.element])
  310.     end
  311.     if StunIndex == 1 then
  312.         equip(sets.Midcast.Stun)
  313.     end
  314. end
  315.  
  316. function midcast(spell,action)
  317.     equipSet = {}
  318.     if spell.action_type == 'Magic' then
  319.         equipSet = sets.Midcast
  320.         if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  321.             if spell.english:startswith('Cure') then
  322.                 equipSet = equipSet.Cure
  323.             elseif spell.english:startswith('Cura') then
  324.                 equipSet = equipSet.Curaga
  325.             end
  326.             if world.day_element == spell.element or world.weather_element == spell.element then
  327.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Hachirin-no-Obi"})
  328.             end
  329.         elseif spell.english:startswith('Refresh') then
  330.             equipSet = equipSet.Refresh
  331.         elseif spell.english:startswith('Haste') then
  332.             equipSet = equipSet.Haste
  333.         elseif spell.english:startswith('Flurry') then
  334.             equipSet = equipSet.Haste
  335.         elseif spell.english == "Stoneskin" then
  336.             if buffactive.Stoneskin then
  337.                 send_command('@wait 2.8;cancel stoneskin')
  338.             end
  339.             equipSet = equipSet.Stoneskin
  340.         elseif spell.english == "Phalanx II" then -- Equip Aug'd Viti. Gloves +1 When You Cast Phalanx II --
  341.             equipSet = set_combine(equipSet,{hands="Viti. Gloves +1"})
  342.         elseif spell.english == "Dia III" or spell.english == "Slow II" then -- Equip Aug'd Viti. Chapeau +1 When You Cast Dia III or Slow II --
  343.             equipSet = set_combine(equipSet,{head="Viti. Chapeau +1"})
  344.         elseif spell.english == "Paralyze II" then -- Equip Aug'd Vitivation Boots +1 When You Cast Paralyze II --
  345.             equipSet = set_combine(equipSet,{feet="Vitivation Boots +1"})
  346.         elseif spell.english == "Blind II" or spell.english == "Bio III" then -- Equip Aug'd Viti. Tights +1 When You Cast Blind II or Bio III --
  347.             equipSet = set_combine(equipSet,{legs="Viti. Tights +1"})
  348.         elseif spell.english == "Sneak" then
  349.             if spell.target.name == player.name and buffactive['Sneak'] then
  350.                 send_command('cancel sneak')
  351.             end
  352.             equipSet = equipSet.Haste
  353.         elseif spell.english:startswith('Banish') then
  354.             equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  355.         elseif Low_Tier_Spells:contains(spell.english) and LowNuke == 'ON' then
  356.             equipSet = set_combine(equipSet,sets.LowNuke)
  357.         elseif spell.skill == 'Elemental Magic' and MB == 'ON' then
  358.             equipSet = set_combine(equipSet,sets.MB)
  359.         elseif spell.english:startswith('Utsusemi') then
  360.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  361.                 send_command('@wait 1.7; cancel Copy Image*')
  362.             end
  363.             equipSet = equipSet.Haste
  364.         elseif spell.english == 'Monomi: Ichi' then
  365.             if buffactive['Sneak'] then
  366.                 send_command('@wait 1.7;cancel sneak')
  367.             end
  368.             equipSet = equipSet.Haste
  369.         else
  370.             if equipSet[spell.english] then
  371.                 equipSet = equipSet[spell.english]
  372.             end
  373.             if equipSet[spell.skill] then
  374.                 equipSet = equipSet[spell.skill]
  375.             end
  376.             if equipSet[AccArray[AccIndex]] then
  377.                 equipSet = equipSet[AccArray[AccIndex]]
  378.             end
  379.             if equipSet[spell.type] then
  380.                 equipSet = equipSet[spell.type]
  381.             end
  382.             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 --
  383.                 equipSet = set_combine(equipSet,sets.Obi[spell.element])
  384.             end
  385.         end
  386.     end
  387.     if buffactive.Composure and spell.skill == "Enhancing Magic" and spell.target.type == 'PLAYER' then -- Equip Composure Set When You Cast Enhancing Spells On Others --
  388.         equipSet = set_combine(equipSet,sets.Composure)
  389.     elseif equipSet[spell.english] then
  390.         equipSet = equipSet[spell.english]
  391.     end
  392.     equip(equipSet)
  393.     if StunIndex == 1 then
  394.         equip(sets.Midcast.Stun)
  395.     end
  396. end
  397.  
  398. function aftercast(spell,action)
  399.     if not spell.interrupted then
  400.         if spell.english == "Sleep II" then -- Sleep II Countdown --
  401.             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.]')
  402.         elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  403.             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.]')
  404.         elseif spell.english == "Banish II" then -- Banish II Countdown --
  405.             send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  406.         end
  407.     end
  408.     status_change(player.status)
  409. end
  410.  
  411. function status_change(new,old)
  412.     check_equip_lock()
  413.     if Armor == 'PDT' then
  414.         equip(sets.PDT)
  415.     elseif buffactive["Sublimation: Activated"] then
  416.         equip(sets.Sublimation)
  417.     elseif new == 'Engaged' then
  418.         equipSet = sets.Melee
  419.         if equipSet[AccArray[AccIndex]] then
  420.             equipSet = equipSet[AccArray[AccIndex]]
  421.         end
  422.         equip(equipSet)
  423.     elseif new == 'Idle' then
  424.         equipSet = sets.Idle
  425.         if equipSet[IdleArray[IdleIndex]] then
  426.             equipSet = equipSet[IdleArray[IdleIndex]]
  427.         end
  428.         if buffactive['Reive Mark'] then -- Equip Arciela's Grace +1 During Reive --
  429.             equipSet = set_combine(equipSet,sets.Reive)
  430.         end
  431.         equip(equipSet)
  432.     elseif new == 'Resting' then
  433.         equip(sets.Resting)
  434.     end
  435.     if StunIndex == 1 then
  436.         equip(sets.Midcast.Stun)
  437.     end
  438. end
  439.  
  440. function buff_change(buff,gain)
  441.     buff = string.lower(buff)
  442.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  443.         if gain then
  444.             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.]')
  445.         else
  446.             send_command('timers delete "Aftermath: Lv.3"')
  447.             add_to_chat(123,'AM3: [OFF]')
  448.         end
  449.     elseif buff == 'weakness' then -- Weakness Timer --
  450.         if gain then
  451.             send_command('timers create "Weakness" 300 up')
  452.         else
  453.             send_command('timers delete "Weakness"')
  454.         end
  455.     end
  456.     if not midaction() then
  457.         status_change(player.status)
  458.     end
  459. end
  460.  
  461. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  462. function self_command(command)
  463.     if command == 'C1' then -- Accuracy Toggle --
  464.         AccIndex = (AccIndex % #AccArray) + 1
  465.         add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  466.         status_change(player.status)
  467.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  468.         status_change(player.status)
  469.         add_to_chat(158,'Auto Update Gear')
  470.     elseif command == 'C2' then -- Stun Toggle --
  471.         if StunIndex == 1 then
  472.             StunIndex = 0
  473.             add_to_chat(123,'Stun Set: [Unlocked]')
  474.         else
  475.             StunIndex = 1
  476.             add_to_chat(158,'Stun Set: [Locked]')
  477.         end
  478.         status_change(player.status)
  479.     elseif command == 'C3' then -- Obi Toggle --
  480.         if Obi == 'ON' then
  481.             Obi = 'OFF'
  482.             add_to_chat(123,'Obi: [OFF]')
  483.         else
  484.             Obi = 'ON'
  485.             add_to_chat(158,'Obi: [ON]')
  486.         end
  487.         status_change(player.status)
  488.     elseif command == 'C7' then -- PDT Toggle --
  489.         if Armor == 'PDT' then
  490.             Armor = 'None'
  491.             add_to_chat(123,'PDT Set: [Unlocked]')
  492.         else
  493.             Armor = 'PDT'
  494.             add_to_chat(158,'PDT Set: [Locked]')
  495.         end
  496.         status_change(player.status)
  497.     elseif command == 'C15' then -- LowNuke Toggle --
  498.         if LowNuke == 'ON' then
  499.             LowNuke = 'OFF'
  500.             add_to_chat(123,'Low Nuke: [OFF]')
  501.         else
  502.             LowNuke = 'ON'
  503.             add_to_chat(158,'Low Nuke: [ON]')
  504.         end
  505.         status_change(player.status)
  506.     elseif command == 'C9' then -- MB Toggle --
  507.         if MB == 'ON' then
  508.             MB = 'OFF'
  509.             add_to_chat(123,'MB: [OFF]')
  510.         else
  511.             MB = 'ON'
  512.             add_to_chat(158,'MB: [ON]')
  513.         end
  514.         status_change(player.status)
  515.     elseif command == 'C17' then -- Lock Main Weapon Toggle --
  516.         if Lock_Main == 'ON' then
  517.             Lock_Main = 'OFF'
  518.             add_to_chat(123,'Main Weapon: [Unlocked]')
  519.         else
  520.             Lock_Main = 'ON'
  521.             add_to_chat(158,'Main Weapon: [Locked]')
  522.         end
  523.         status_change(player.status)
  524.     elseif command == 'C15' then -- Enspells Toggle --
  525.         if Enspells == 'ON' then
  526.             Enspells = 'OFF'
  527.             add_to_chat(123,'Enspells: [OFF]')
  528.         else
  529.             Enspells = 'ON'
  530.             add_to_chat(158,'Enspells: [ON]')
  531.         end
  532.         status_change(player.status)
  533.     elseif command == 'C8' then -- Distance Toggle --
  534.         if player.target.distance then
  535.             target_distance = math.floor(player.target.distance*10)/10
  536.             add_to_chat(158,'Distance: '..target_distance)
  537.         else
  538.             add_to_chat(123,'No Target Selected')
  539.         end
  540.     elseif command == 'C6' then -- Idle Toggle --
  541.         IdleIndex = (IdleIndex % #IdleArray) + 1
  542.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  543.         status_change(player.status)
  544.     elseif command:match('^SC%d$') then
  545.         send_command('//' .. sc_map[command])
  546.     end
  547. end
  548.  
  549. function check_equip_lock() -- Lock Equipment Here --
  550.     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
  551.         disable('ring1','ring2')
  552.     elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  553.         disable('back')
  554.     elseif Lock_Main == 'ON' then
  555.         disable('main','sub')
  556.     else
  557.         enable('main','sub','ring1','ring2','back')
  558.     end
  559. end
  560.  
  561. function actualCost(originalCost)
  562.     if buffactive["Penury"] then
  563.         return originalCost*.5
  564.     elseif buffactive["Light Arts"] then
  565.         return originalCost*.9
  566.     else
  567.         return originalCost
  568.     end
  569. end
  570.  
  571. function degrade_spell(spell,degrade_array)
  572.     spell_index = table.find(degrade_array,spell.name)
  573.     if spell_index > 1 then
  574.         new_spell = degrade_array[spell_index - 1]
  575.         change_spell(new_spell,spell.target.raw)
  576.         add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
  577.     end
  578. end
  579.  
  580. function change_spell(spell_name,target)
  581.     cancel_spell()
  582.     send_command('//'..spell_name..' '..target)
  583. end
  584.  
  585. function sub_job_change(newSubjob, oldSubjob)
  586.     select_default_macro_book()
  587. end
  588.  
  589. function set_macro_page(set,book)
  590.     if not tonumber(set) then
  591.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  592.         return
  593.     end
  594.     if set < 1 or set > 10 then
  595.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  596.         return
  597.     end
  598.  
  599.     if book then
  600.         if not tonumber(book) then
  601.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  602.             return
  603.         end
  604.         if book < 1 or book > 20 then
  605.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  606.             return
  607.         end
  608.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  609.     else
  610.         send_command('@input /macro set '..tostring(set))
  611.     end
  612. end
  613.  
  614. function select_default_macro_book()
  615.     -- Default macro set/book
  616.     if player.sub_job == 'WHM' then
  617.         set_macro_page(1, 11)
  618.     elseif player.sub_job == 'BLM' then
  619.         set_macro_page(2, 11)
  620.     elseif player.sub_job == 'SCH' then
  621.         set_macro_page(3, 11)
  622.     elseif player.sub_job == 'DNC' then
  623.         set_macro_page(10, 11)
  624.     elseif player.sub_job == 'WAR' then
  625.         set_macro_page(9, 11)
  626.     elseif player.sub_job == 'NIN' then
  627.         set_macro_page(5, 11)
  628.     else
  629.         set_macro_page(1, 11)
  630.     end
  631. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement