Advertisement
Bokura

Bokura_MNK

Jan 19th, 2014
2,461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.69 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Some of Motenten's Functions ** --
  3.  
  4. function get_sets()
  5.     AccIndex = 1
  6.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. --
  7.     WeaponIndex = 1
  8.     WeaponArray = {"Verethragna","Glanzfaust","Spharai"} -- Default Main Weapon Is Verethragna. Don't Input Main In TP Sets. Can Delete Any Weapons That You Don't Own. --
  9.     IdleIndex = 1
  10.     IdleArray = {"Movement","Regen"} -- Default Idle Set Is Movement --
  11.     Armor = 'None'
  12.     HP = 'OFF'
  13.     Attack = 'OFF' -- Set Default WS Attack Set ON or OFF Here --
  14.     Rancor = 'OFF' -- Set Default Rancor 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.     sc_map = {SC1="VictorySmite", SC2="Impetus", SC3="Berserk"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  19.  
  20.     sets.Idle = {}
  21.     -- Idle/Town Sets --
  22.     sets.Idle.Regen = {}
  23.     sets.Idle.Regen.Verethragna = set_combine(sets.Idle.Regen,{
  24.             main="Verethragna"})
  25.     sets.Idle.Regen.Glanzfaust = set_combine(sets.Idle.Regen,{
  26.             main="Glanzfaust"})
  27.     sets.Idle.Regen.Spharai = set_combine(sets.Idle.Regen,{
  28.             main="Spharai"})
  29.  
  30.     sets.Idle.Movement = set_combine(sets.Idle.Regen,{
  31.             feet="Hermes' Sandals +1"})
  32.     sets.Idle.Movement.Verethragna = set_combine(sets.Idle.Movement,{
  33.             main="Verethragna"})
  34.     sets.Idle.Movement.Glanzfaust = set_combine(sets.Idle.Movement,{
  35.             main="Glanzfaust"})
  36.     sets.Idle.Movement.Spharai = set_combine(sets.Idle.Movement,{
  37.             main="Spharai"})
  38.  
  39.     --Normal TP Sets --
  40.     sets.TP = {}
  41.     sets.TP.MidACC = set_combine(sets.TP,{})
  42.     sets.TP.HighACC = set_combine(sets.TP.MidACC,{})
  43.  
  44.     -- Attack TP Set --
  45.     sets.TP.ATT = set_combine(sets.TP,{})
  46.  
  47.     -- (Impetus Up) TP Sets --
  48.     sets.TP.Impetus = set_combine(sets.TP,{
  49.             body="Bhikku Cyclas +1"})
  50.     sets.TP.MidACC.Impetus = set_combine(sets.TP.Impetus,{})
  51.     sets.TP.HighACC.Impetus = set_combine(sets.TP.MidACC.Impetus,{})
  52.  
  53.     -- (Impetus Up) Attack TP Set --
  54.     sets.TP.Impetus.ATT = set_combine(sets.TP.Impetus,{})
  55.  
  56.     -- Hundred Fists TP Set --
  57.     sets.TP.HF = {}
  58.  
  59.     -- Perfect Counter Set --
  60.     sets.TP.PerfectCounter = {head="Bhikku Crown +1"}
  61.  
  62.     -- TP Rancor ON Neck --
  63.     sets.TP.Rancor = {neck="Rancor Collar"}
  64.  
  65.     -- PDT/MDT Sets --
  66.     sets.PDT = {}
  67.  
  68.     sets.MDT = set_combine(sets.PDT,{})
  69.  
  70.     -- Hybrid/HP Sets --
  71.     sets.TP.Hybrid = set_combine(sets.PDT,{})
  72.     sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
  73.     sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
  74.  
  75.     sets.HP = set_combine(sets.PDT,{})
  76.  
  77.     -- WS Base Set --
  78.     sets.WS = {}
  79.  
  80.     -- Victory Smite Sets --
  81.     sets.WS["Victory Smite"] = {}
  82.     sets.WS["Victory Smite"].MidACC = set_combine(sets.WS["Victory Smite"],{})
  83.     sets.WS["Victory Smite"].HighACC = set_combine(sets.WS["Victory Smite"].MidACC,{})
  84.  
  85.     -- Victory Smite(Attack) Set --
  86.     sets.WS["Victory Smite"].ATT = set_combine(sets.WS["Victory Smite"],{})
  87.  
  88.     -- Shijin Spiral Sets --
  89.     sets.WS["Shijin Spiral"] = {}
  90.     sets.WS["Shijin Spiral"].MidACC = set_combine(sets.WS["Shijin Spiral"],{})
  91.     sets.WS["Shijin Spiral"].HighACC = set_combine(sets.WS["Shijin Spiral"].MidACC,{})
  92.  
  93.     -- Shijin Spiral(Attack) Set --
  94.     sets.WS["Shijin Spiral"].ATT = set_combine(sets.WS["Shijin Spiral"],{})
  95.  
  96.     -- Asuran Fists Sets --
  97.     sets.WS["Asuran Fists"] = {}
  98.     sets.WS["Asuran Fists"].MidACC = set_combine(sets.WS["Asuran Fists"],{})
  99.     sets.WS["Asuran Fists"].HighACC = set_combine(sets.WS["Asuran Fists"].MidACC,{})
  100.  
  101.     sets.WS["Final Heaven"] = {}
  102.  
  103.     sets.WS["Ascetic's Fury"] = {}
  104.    
  105.     -- JA Sets --
  106.     sets.JA = {}
  107.     sets.JA.Focus = {head="Anchor. Crown +1"}
  108.     sets.JA['Formless Strikes'] = {body="Hes. Cyclas +1"}
  109.     sets.JA['Hundred Fists'] = {legs="Hes. Hose +1"}
  110.     sets.JA.Mantra = {feet="Hes. Gaiters +1"}
  111.     sets.JA.Counterstance = {feet="Hes. Gaiters +1"}
  112.     sets.JA.Dodge = {feet="Anch. Gaiters +1"}
  113.     sets.JA.Chakra = {
  114.             body="Anch. Cyclas +1",
  115.             hands="Hes. Gloves +1"}
  116.  
  117.     -- Waltz Set --
  118.     sets.Waltz = {}
  119.  
  120.     sets.Precast = {}
  121.     -- Fastcast Set --
  122.     sets.Precast.FastCast = {}
  123.     -- Utsusemi Precast Set --
  124.     sets.Precast.Utsusemi = set_combine(sets.Precast.FastCast,{neck="Magoraga Beads"})
  125.  
  126.     sets.Midcast = {}
  127.     -- Magic Haste Set --
  128.     sets.Midcast.Haste = set_combine(sets.PDT,{})
  129. end
  130.  
  131. function pretarget(spell,action)
  132.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  133.         cancel_spell()
  134.         send_command('input /item "Echo Drops" <me>')
  135.     elseif spell.english == 'Impetus' and buffactive.Impetus then -- Change Impetus To Focus When Impetus Is On --
  136.         cancel_spell()
  137.         send_command('Focus')
  138.     elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  139.         cancel_spell()
  140.         send_command('Aggressor')
  141.     elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
  142.         cancel_spell()
  143.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  144.         return
  145.     end
  146. end
  147.  
  148. function precast(spell,action)
  149.     if spell.type == "WeaponSkill" then
  150.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  151.             cancel_spell()
  152.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  153.             return
  154.         else
  155.             equipSet = sets.WS
  156.             if equipSet[spell.english] then
  157.                 equipSet = equipSet[spell.english]
  158.             end
  159.             if Attack == 'ON' then
  160.                 equipSet = equipSet["ATT"]
  161.             end
  162.             if equipSet[AccArray[AccIndex]] then
  163.                 equipSet = equipSet[AccArray[AccIndex]]
  164.             end
  165.             if buffactive['Reive Mark'] then
  166.                 equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  167.             end
  168.             if spell.english == "Victory Smite" or spell.english == "Ascetic's Fury" then
  169.                 if buffactive.Impetus then -- Equip Bhikku Cyclas +1 When You Have Impetus On For Victory Smite or Ascetic's Fury --
  170.                     equipSet = set_combine(equipSet,{body="Bhikku Cyclas +1"})
  171.                 elseif player.tp > 2990 then -- Equip Vulcan's Pearl When You Have 3000 TP --
  172.                     equipSet = set_combine(equipSet,{ear1="Vulcan's Pearl"})
  173.                 end
  174.             end
  175.             equip(equipSet)
  176.         end
  177.     elseif spell.type == "JobAbility" then
  178.         if sets.JA[spell.english] then
  179.             equip(sets.JA[spell.english])
  180.         end
  181.     elseif spell.action_type == 'Magic' then
  182.         if spell.english:startswith('Utsusemi') then
  183.             if spell.english == 'Utsusemi: Ni' then
  184.                 if buffactive['Copy Image (3)'] then
  185.                     cancel_spell()
  186.                     add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  187.                     return
  188.                 else
  189.                     equip(sets.Precast.Utsusemi)
  190.                 end
  191.             else
  192.                 equip(sets.Precast.Utsusemi)
  193.             end
  194.         else
  195.             equip(sets.Precast.FastCast)
  196.         end
  197.     elseif spell.type == "Waltz" then
  198.         refine_waltz(spell,action)
  199.         equip(sets.Waltz)
  200.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  201.         cast_delay(0.2)
  202.         send_command('cancel Sneak')
  203.     end
  204.     if HP == 'ON' then
  205.         equip(sets.HP)
  206.     end
  207. end
  208.  
  209. function midcast(spell,action)
  210.     if spell.action_type == 'Magic' then
  211.         if spell.english:startswith('Utsusemi') then
  212.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  213.                 send_command('@wait 1.7;cancel Copy Image*')
  214.             end
  215.             equip(sets.Midcast.Haste)
  216.         elseif spell.english == 'Monomi: Ichi' then
  217.             if buffactive['Sneak'] then
  218.                 send_command('@wait 1.7;cancel sneak')
  219.             end
  220.             equip(sets.Midcast.Haste)
  221.         else
  222.             equip(sets.Midcast.Haste)
  223.         end
  224.     end
  225. end
  226.  
  227. function aftercast(spell,action)
  228.     if not spell.interrupted then
  229.         if spell.type == "WeaponSkill" then
  230.             send_command('wait 0.2;gs c TP')
  231.         elseif spell.english == "Impetus" then -- Impetus Timer --
  232.             timer_impetus()
  233.         elseif spell.english == "Mantra" then -- Mantra Timer/Countdown --
  234.             timer_mantra()
  235.             send_command('wait 170;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
  236.         end
  237.     end
  238.     status_change(player.status)
  239. end
  240.  
  241. function status_change(new,old)
  242.     check_equip_lock()
  243.     if Armor == 'PDT' then
  244.         equip(sets.PDT)
  245.     elseif Armor == 'MDT' then
  246.         equip(sets.MDT)
  247.     elseif new == 'Engaged' then
  248.         equipSet = sets.TP
  249.         if Armor == 'Hybrid' and equipSet["Hybrid"] then
  250.             equipSet = equipSet["Hybrid"]
  251.         end
  252.         if Attack == 'ON' then
  253.             equipSet = equipSet["ATT"]
  254.         end
  255.         if equipSet[AccArray[AccIndex]] then
  256.             equipSet = equipSet[AccArray[AccIndex]]
  257.         end
  258.         if buffactive.Impetus and equipSet["Impetus"] then
  259.             equipSet = equipSet["Impetus"]
  260.         end
  261.         if buffactive['Hundred Fists'] then
  262.             equipSet = set_combine(equipSet,sets.TP.HF)
  263.         end
  264.         if buffactive['Perfect Counter'] then
  265.             equipSet = set_combine(equipSet,sets.TP.PerfectCounter)
  266.         end
  267.         if Rancor == 'ON' then -- Use Rancor Toggle For Rancor Collar --
  268.             equipSet = set_combine(equipSet,sets.TP.Rancor)
  269.         end
  270.         equip(equipSet)
  271.     else
  272.         equipSet = sets.Idle
  273.         if equipSet[IdleArray[IdleIndex]] then
  274.             equipSet = equipSet[IdleArray[IdleIndex]]
  275.         end
  276.         if equipSet[WeaponArray[WeaponIndex]] then
  277.             equipSet = equipSet[WeaponArray[WeaponIndex]]
  278.         end
  279.         if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  280.             equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
  281.         end
  282.         if world.area:endswith('Adoulin') then
  283.             equipSet = set_combine(equipSet,{body="Councilor's Garb"})
  284.         end
  285.         equip(equipSet)
  286.     end
  287.     if HP == 'ON' then
  288.         equip(sets.HP)
  289.     end
  290. end
  291.  
  292. function buff_change(buff,gain)
  293.     buff = string.lower(buff)
  294.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  295.         if gain then
  296.             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.]')
  297.         else
  298.             send_command('timers delete "Aftermath: Lv.3"')
  299.             add_to_chat(123,'AM3: [OFF]')
  300.         end
  301.     elseif buff == 'impetus' and not gain then
  302.         send_command('timers delete "Impetus"')
  303.         add_to_chat(123,'Impetus: [OFF]')
  304.     elseif buff == 'mantra' and not gain then
  305.         send_command('timers delete "Mantra"')
  306.     elseif buff == "inner strength" then -- Inner Strength Timer --
  307.         if gain then
  308.             send_command('timers create "Inner Strength" 30 down')
  309.         else
  310.             send_command('timers delete "Inner Strength"')
  311.             add_to_chat(123,'Inner Strength: [OFF]')
  312.         end
  313.     elseif buff == 'aggressor' and not gain then
  314.         add_to_chat(123,'Aggressor: [OFF]')
  315.     elseif buff == "perfect defense" then -- PD Timer --
  316.         if gain then
  317.             send_command('timers create "Perfect Defense" 57 down')
  318.         else
  319.             send_command('timers delete "Perfect Defense"')
  320.             add_to_chat(123,'PD: [OFF]')
  321.         end
  322.     elseif buff == 'weakness' then -- Weakness Timer --
  323.         if gain then
  324.             send_command('timers create "Weakness" 300 up')
  325.         else
  326.             send_command('timers delete "Weakness"')
  327.         end
  328.     end
  329.     if not midaction() then
  330.         status_change(player.status)
  331.     end
  332. end
  333.  
  334. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  335. function self_command(command)
  336.     if command == 'C1' then -- Accuracy Toggle --
  337.         AccIndex = (AccIndex % #AccArray) + 1
  338.         add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  339.         status_change(player.status)
  340.     elseif command == 'C17' then -- Main Weapon Toggle --
  341.         WeaponIndex = (WeaponIndex % #WeaponArray) + 1
  342.         add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
  343.         status_change(player.status)
  344.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  345.         status_change(player.status)
  346.         add_to_chat(158,'Auto Update Gear')
  347.     elseif command == 'C2' then -- Hybrid Toggle --
  348.         if Armor == 'Hybrid' then
  349.             Armor = 'None'
  350.             add_to_chat(123,'Hybrid Set: [Unlocked]')
  351.         else
  352.             Armor = 'Hybrid'
  353.             add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  354.         end
  355.         status_change(player.status)
  356.     elseif command == 'C7' then -- PDT Toggle --
  357.         if Armor == 'PDT' then
  358.             Armor = 'None'
  359.             add_to_chat(123,'PDT Set: [Unlocked]')
  360.         else
  361.             Armor = 'PDT'
  362.             add_to_chat(158,'PDT Set: [Locked]')
  363.         end
  364.         status_change(player.status)
  365.     elseif command == 'C15' then -- MDT Toggle --
  366.         if Armor == 'MDT' then
  367.             Armor = 'None'
  368.             add_to_chat(123,'MDT Set: [Unlocked]')
  369.         else
  370.             Armor = 'MDT'
  371.             add_to_chat(158,'MDT Set: [Locked]')
  372.         end
  373.         status_change(player.status)
  374.     elseif command == 'C3' then -- HP Toggle --
  375.         if HP == 'ON' then
  376.             HP = 'OFF'
  377.             add_to_chat(123,'HP Set: [Unlocked]')
  378.         else
  379.             HP = 'ON'
  380.             add_to_chat(158,'HP Set: [locked]')
  381.         end
  382.         status_change(player.status)
  383.     elseif command == 'C16' then -- Rancor Toggle --
  384.         if Rancor == 'ON' then
  385.             Rancor = 'OFF'
  386.             add_to_chat(123,'Rancor: [OFF]')
  387.         else
  388.             Rancor = 'ON'
  389.             add_to_chat(158,'Rancor: [ON]')
  390.         end
  391.         status_change(player.status)
  392.     elseif command == 'C9' then -- Attack Toggle --
  393.         if Attack == 'ON' then
  394.             Attack = 'OFF'
  395.             add_to_chat(123,'Attack: [OFF]')
  396.         else
  397.             Attack = 'ON'
  398.             add_to_chat(158,'Attack: [ON]')
  399.         end
  400.         status_change(player.status)
  401.     elseif command == 'C8' then -- Distance Toggle --
  402.         if player.target.distance then
  403.             target_distance = math.floor(player.target.distance*10)/10
  404.             add_to_chat(158,'Distance: '..target_distance)
  405.         else
  406.             add_to_chat(123,'No Target Selected')
  407.         end
  408.     elseif command == 'C6' then -- Idle Toggle --
  409.         IdleIndex = (IdleIndex % #IdleArray) + 1
  410.         add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
  411.         status_change(player.status)
  412.     elseif command == 'TP' then
  413.         add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  414.     elseif command:match('^SC%d$') then
  415.         send_command('//' .. sc_map[command])
  416.     end
  417. end
  418.  
  419. function check_equip_lock() -- Lock Equipment Here --
  420.     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
  421.         disable('ring1','ring2')
  422.     elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
  423.         disable('back')
  424.     else
  425.         enable('ring1','ring2','back')
  426.     end
  427. end
  428.  
  429. function timer_impetus()
  430.     local duration = 180
  431.     send_command('timers create "Impetus" '..tostring(duration)..' down')
  432. end
  433.  
  434. function timer_mantra()
  435.     local duration = 180
  436.     send_command('timers create "Mantra" '..tostring(duration)..' down')
  437. end
  438.  
  439. function refine_waltz(spell,action)
  440.     if spell.type ~= 'Waltz' then
  441.         return
  442.     end
  443.  
  444.     if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
  445.         return
  446.     end
  447.  
  448.     local newWaltz = spell.english
  449.     local waltzID
  450.  
  451.     local missingHP
  452.  
  453.     if spell.target.type == "SELF" then
  454.         missingHP = player.max_hp - player.hp
  455.     elseif spell.target.isallymember then
  456.         local target = find_player_in_alliance(spell.target.name)
  457.         local est_max_hp = target.hp / (target.hpp/100)
  458.         missingHP = math.floor(est_max_hp - target.hp)
  459.     end
  460.  
  461.     if missingHP ~= nil then
  462.         if player.sub_job == 'DNC' then
  463.             if missingHP < 40 and spell.target.name == player.name then
  464.                 add_to_chat(123,'Full HP!')
  465.                 cancel_spell()
  466.                 return
  467.             elseif missingHP < 150 then
  468.                 newWaltz = 'Curing Waltz'
  469.                 waltzID = 190
  470.             elseif missingHP < 300 then
  471.                 newWaltz = 'Curing Waltz II'
  472.                 waltzID = 191
  473.             else
  474.                 newWaltz = 'Curing Waltz III'
  475.                 waltzID = 192
  476.             end
  477.         else
  478.             return
  479.         end
  480.     end
  481.  
  482.     local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50}
  483.     local tpCost = waltzTPCost[newWaltz]
  484.  
  485.     local downgrade
  486.  
  487.     if player.tp < tpCost and not buffactive.trance then
  488.  
  489.         if player.tp < 20 then
  490.             add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  491.             cancel_spell()
  492.             return
  493.         elseif player.tp < 35 then
  494.             newWaltz = 'Curing Waltz'
  495.         elseif player.tp < 50 then
  496.             newWaltz = 'Curing Waltz II'
  497.         end
  498.  
  499.         downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  500.     end
  501.  
  502.     if newWaltz ~= spell.english then
  503.         send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  504.         if downgrade then
  505.             add_to_chat(158, downgrade)
  506.         end
  507.         cancel_spell()
  508.         return
  509.     end
  510.  
  511.     if missingHP > 0 then
  512.         add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  513.     end
  514. end
  515.  
  516. function find_player_in_alliance(name)
  517.     for i,v in ipairs(alliance) do
  518.         for k,p in ipairs(v) do
  519.             if p.name == name then
  520.                 return p
  521.             end
  522.         end
  523.     end
  524. end
  525.  
  526. function sub_job_change(newSubjob, oldSubjob)
  527.     select_default_macro_book()
  528. end
  529.  
  530. function set_macro_page(set,book)
  531.     if not tonumber(set) then
  532.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  533.         return
  534.     end
  535.     if set < 1 or set > 10 then
  536.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  537.         return
  538.     end
  539.  
  540.     if book then
  541.         if not tonumber(book) then
  542.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  543.             return
  544.         end
  545.         if book < 1 or book > 20 then
  546.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  547.             return
  548.         end
  549.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  550.     else
  551.         send_command('@input /macro set '..tostring(set))
  552.     end
  553. end
  554.  
  555. function select_default_macro_book()
  556.     -- Default macro set/book
  557.     if player.sub_job == 'WAR' then
  558.         set_macro_page(1, 7)
  559.     elseif player.sub_job == 'DNC' then
  560.         set_macro_page(3, 7)
  561.     elseif player.sub_job == 'NIN' then
  562.         set_macro_page(8, 7)
  563.     elseif player.sub_job == 'DRK' then
  564.         set_macro_page(9, 7)
  565.     elseif player.sub_job == 'RUN' then
  566.         set_macro_page(5, 7)
  567.     else
  568.         set_macro_page(1, 7)
  569.     end
  570. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement