KLoOoSH

My SAM Gearswap

Dec 29th, 2014
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.42 KB | None | 0 0
  1. --[[
  2. *** I don't take full credit for this file. I've used various other files and some of my own ***
  3. ----------------------
  4. GearSwap Version 0.892
  5. ----------------------
  6. File Created 10-9-14
  7. If you found this file, it was probably through bluegartr. If any bugs or errors are
  8. found please send me a PM there and I'll try to fix it.
  9. *For some of these features to work, the Shortcuts, Cancel addon and Timers plugin are required.
  10. ----------------------
  11. Update 10-10-14
  12. *Added: Oneiros Ring function at "function status_change(new,old)" for MP conditions.  
  13. *Added: Function to WS on certain days and use the new head piece Gavialis Helm.
  14. *Added: Auto locks Twilight set on when you get up from a raise.
  15. ---------------------- 
  16. Macro lists- case sensitive (If in chat remove the /console & add //, example //gs c acc)
  17.  
  18. /console gs c encumber  (encumber toggle- Tsuru,Amano,Koga,Masa - Defaults to Tsurumaru)
  19. /console gs c idle    (idle toggle Regen,Normal)
  20. /console gs c acc    (acc toggle for TP,WS) (Accuracy levels are Normal, LightAcc, FullAcc)
  21. /console gs c update    (updates current gear set, also set to the F10 key on keyboard)
  22. /console gs c active    (will show all active sets and toggles that are active or not)
  23. /console gs c distance  (Set target distance, default is 5 yalms
  24.  
  25. - All Toggles below are OFF by default.
  26. /console gs c pdt    (toggle/locks pdt set at all times, during Idle,TP,WS,JA,MA ect.)
  27. /console gs c mdt    (toggle/locks mdt set at all times, during Idle,TP,WS,JA,MA ect.)
  28. /console gs c th    (toggle/locks Chaac Belt at these times, during Idle,TP)
  29. /console gs c rings    (toggle/locks Warp Ring & Capacity Ring at all times, during Idle,TP,WS,JA,MA ect.)
  30. /console gs c twilight  (toggle/locks Twilight set at all times for reraise, during Idle,TP,WS,JA,MA ect.)
  31. /console gs c cpmantle  (toggle/locks Mecisto. Mantle at all times for Capacity Points farming, during Idle,TP,WS,JA,MA ect.)
  32. /console gs c movement  (toggle/locks movement gear)
  33. /console gs c seigan    (toggle seigan/third eye set)
  34. /console gs c autohasso (toggle to auto hasso)]]
  35.      
  36. function get_sets()
  37.     ACC_Index = 1
  38.     ACC_Array = {"Normal","LightAcc","FullAcc"} -- Default ACC Set Is Normal. The First TP Set Of Your Main Weapon Is Normal.
  39.     Idle_Index = 1
  40.     Idle_Array = {"Regen","Normal"} -- Default Idle Set Is Regen
  41.     Encumber_Index = 1 -- Encumber Weapons
  42.     Armor = 'None'
  43.     Twilight = 'OFF'
  44.     TH = 'OFF' -- Rives Necklace Toggle
  45.     Rings = 'OFF' -- Capacity/Warp Ring Toggle     
  46.     Auto_Hasso = 'ON' -- Auto Hasso Toggle Default (Keeps Hasso up fulltime)
  47.     Mecisto = 'OFF' -- Mecisto. Mantle (Capacity Points Back) Toggle Default
  48.     Seigan_T = 'OFF' -- Seigan/Third Eye Set Toggle Default
  49.     Movement = 'OFF' -- Movement Gear Toggle Default
  50.     target_distance = 5 -- Set Default Distance Here          
  51.        
  52.     --Default Macro Set for SAM
  53.     send_command('input /macro book 3;wait .1;input /macro set 1')
  54.  
  55.     --Binds
  56.     send_command('bind f10 gs c update')
  57.     send_command('bind f9 ws Tachi: Fudo <t>')
  58.    
  59.     --Slept
  60.     sets.Slept = {neck="Berserker's Torque"}
  61.     --Meikyo Shisui
  62.     sets.OneHour = {feet="Sak. Sune-Ate +1"}
  63.    
  64.     --Twilight Set
  65.     sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
  66.    
  67.     --Capacity Points Mantle
  68.     sets.Mecisto = {back="Mecisto. Mantle"}
  69.    
  70.     --Movement Set
  71.     sets.Movement = {feet="Danzo Sune-Ate"}
  72.    
  73.     --Rives Necklace
  74.     sets.TH = {neck="Ygnas's Resolve +1"}
  75.    
  76.     --Capacity/Warp Ring
  77.     sets.Rings = {ring1="Capacity Ring",ring2="Warp Ring"}
  78.    
  79.     --encumbrance
  80.     sets.Encumber = {}
  81.     Encumber_Set_Names = {'Koga','Tsuru'}  
  82.     sets.Encumber['Koga'] = {main="Kogarasumaru",sub="Bloodrain Strap"}
  83.     sets.Encumber['Tsuru'] = {main="Tsurumaru",sub="Bloodrain Strap"}
  84.      
  85.     -- Idle/Regen Sets --
  86.     sets.Idle = {}
  87.     sets.Idle.Regen = {
  88.         range="Cibitshavore",
  89.         head="Twilight Helm",
  90.         neck="Wiglen Gorget",
  91.         ear1="Bladeborn earring",
  92.         ear2="Dawn Earring",
  93.         body="Kumarbi's Akar",
  94.         hands="Otronif Gloves +1",
  95.         ring1="Paguroidea Ring",
  96.         ring2="Karieyh Ring",
  97.         back="Scuta Cape",
  98.         waist="Lycopodium Sash",
  99.         legs="Otronif Brais +1",
  100.         feet="Otronif boots +1"}          
  101.        
  102.     sets.Idle.Normal = set_combine(sets.Idle.Normal,{
  103.         ear1="Reraise Earring",
  104.         neck="Reraise Gorget",
  105.         ring1="Capacity Ring",
  106.         ring2="Warp Ring"})
  107.        
  108.             -- Preshot Set --
  109.     sets.Preshot = {
  110.             head="Saotome Kabuto",
  111.             neck="Iqabi necklace",
  112.             ear1="Bladeborn Earring",
  113.             ear2="Steelflash Earring",
  114.             body="Kyujutsugi",
  115.             hands="Unkai kote +2",
  116.             ring1="Paqichikaji Ring",
  117.             ring2="Bellona's Ring",
  118.             back="Kayapa Cape",
  119.             waist="Saotome Koshi-ate",
  120.             legs="Wakido haidate +1",
  121.             feet="Wakido sune-ate +1"}
  122.  
  123.     -- TP Base Set --
  124.     sets.TP = {}
  125.      
  126.     -- Kogarasumaru TP Sets --
  127.     sets.TP.Kogarasumaru = {
  128.         range="Cibitshavore",
  129.         ammo="Tulfaire Arrow",
  130.         head="Otomi Helm",
  131.         neck="Asperity necklace",
  132.         ear1="Bladeborn Earring",
  133.         ear2="Steelflash Earring",
  134.         body="Sakonji Domaru +1",
  135.         hands="Otronif gloves +1",
  136.         ring1="K'ayres ring",
  137.         ring2="Rajas Ring",
  138.         back="Takaha Mantle",
  139.         waist="Cetl Belt",
  140.         legs="Otronif Brais +1",
  141.         feet="Otronif Boots +1"}
  142.     sets.TP.Kogarasumaru.LightAcc = set_combine(sets.TP.Kogarasumaru,{
  143.         body="Mes. Haubergeon",
  144.         waist="Anguinus Belt",
  145.         legs="Xaddi Cuisses"})
  146.     sets.TP.Kogarasumaru.FullAcc = set_combine(sets.TP.Kogarasumaru.LightAcc,{
  147.         head="Yaoyotl Helm",
  148.         neck="Iqabi Necklace",    
  149.         body="Mes. Haubergeon",
  150.         hands="Sakonji kote +1",
  151.         ring1="Mouflon Ring",
  152.         ring2="Patricius Ring",
  153.         feet="Waki. Sune-Ate +1"})
  154.      
  155.     -- Tsurumaru TP Sets --
  156.     sets.TP.Tsurumaru = {
  157.         range="Cibitshavore",
  158.         ammo="Tulfaire Arrow",
  159.         head="Otomi Helm",
  160.         neck="Asperity necklace",
  161.         ear1="Bladeborn Earring",
  162.         ear2="Steelflash Earring",
  163.         body="Sakonji Domaru +1",
  164.         hands="Otronif gloves +1",
  165.         ring1="K'ayres ring",
  166.         ring2="Rajas Ring",
  167.         back="Takaha Mantle",
  168.         waist="Cetl Belt",
  169.         legs="Otronif Brais +1",
  170.         feet="Otronif Boots +1"}
  171.     sets.TP.Tsurumaru.LightAcc = set_combine(sets.TP.Tsurumaru,{
  172.         body="Mes. Haubergeon",
  173.         waist="Anguinus Belt",
  174.         legs="Xaddi Cuisses"})
  175.     sets.TP.Tsurumaru.FullAcc = set_combine(sets.TP.Tsurumaru.LightAcc,{
  176.         head="Yaoyotl Helm",
  177.         neck="Iqabi Necklace",    
  178.         body="Mes. Haubergeon",
  179.         hands="Sakonji kote +1",
  180.         ring1="Mouflon Ring",
  181.         ring2="Patricius Ring",
  182.         feet="Waki. Sune-Ate +1"})
  183.      
  184.             -- Third Eye/Seigan TP Set --
  185.     sets.TP['Seigan'] = {
  186.         head="Unkai Kabuto +2",
  187.         legs="Sakonji Haidate"}
  188.      
  189.     -- PDT/MDT Sets --
  190.     sets.PDT = {
  191.         head="Otomi Helm",
  192.         neck="Twilight Torque",
  193.         ear1="Bladeborn Earring",
  194.         ear2="Steelflash Earring",
  195.         body="Xaddi mail",
  196.         hands="Otronif Gloves +1",
  197.         ring1="Defending Ring",
  198.         ring2="Patricius Ring",
  199.         back="Mollusca Mantle",
  200.         waist="Flume Belt +1",
  201.         legs="Otronif Brais +1",
  202.         feet="Otronif Boots +1"}
  203.    
  204.     sets.MDT = set_combine(sets.PDT,{
  205.         head="Otomi Helm",
  206.         ear1="Merman's Earring",
  207.         ear2="Sanare Earring",
  208.         body="Ogier's surcoat",
  209.         ring1="Shadow Ring",
  210.         back="Mubvumbamiri mantle",
  211.         waist="Resolute Belt"})
  212.  
  213.     -- WS Base Set --
  214.     sets.WS = {
  215.         range="Cibitshavore",
  216.         head="Otomi Helm",
  217.         neck="Light Gorget",
  218.         ear1="Steelflash earring",
  219.         ear2="Bladeborn earring",
  220.         body="Phorcys Korazin",
  221.         hands="Miki. Gauntlets",
  222.         ring1="Ifrit Ring",
  223.         ring2="Ifrit Ring",
  224.         back="Vespid Mantle",
  225.         waist="Metalsinger Belt",
  226.         legs="Miki. Cuisses",
  227.         feet="Wakido sune-ate +1"}
  228.      
  229.     -- WS Fudo Sets --
  230.     sets.WS["Tachi: Fudo"] = {
  231.         range="Cibitshavore",
  232.         head="Otomi Helm",
  233.         neck="Light Gorget",
  234.         ear1="Trux earring",
  235.         ear2="Brutal Earring",
  236.         body="Phorcys Korazin",
  237.         hands="Miki. Gauntlets",
  238.         ring1="Ifrit Ring",
  239.         ring2="Karieyh Ring",
  240.         back="Buquwik Cape",
  241.         waist="Metalsinger Belt",
  242.         legs="Scuff. Cosciales",
  243.         feet="Sak. Sune-Ate +1"}    
  244.     sets.WS["Tachi: Fudo"].LightAcc = set_combine(sets.WS["Tachi: Fudo"],{
  245.         head="Yaoyotl Helm",
  246.         body="Phorcys Korazin",
  247.         back="Vespid Mantle",
  248.         legs="Miki. Cuisses"})
  249.     sets.WS["Tachi: Fudo"].FullAcc = set_combine(sets.WS["Tachi: Fudo"].LightAcc,{
  250.         body="Mes. Haubergeon",
  251.         ear1="Bladeborn Earring",
  252.         ear2="Steelflash Earring",
  253.         feet="Wakido sune-ate +1"})
  254.        
  255.  
  256.     -- WS Rana Sets --
  257.     sets.WS["Tachi: Rana"] = {
  258.         range="Cibitshavore",
  259.         head="Otomi Helm",
  260.         neck="Light Gorget",
  261.         ear1="Trux earring",
  262.         ear2="Brutal Earring",
  263.         body="Phorcys Korazin",
  264.         hands="Miki. Gauntlets",
  265.         ring1="Ifrit Ring",
  266.         ring2="Karieyh Ring",
  267.         back="Buquwik Cape",
  268.         waist="Metalsinger Belt",
  269.         legs="Scuff. Cosciales",
  270.         feet="Sak. Sune-Ate +1"}
  271.     sets.WS["Tachi: Rana"].LightAcc = set_combine(sets.WS["Tachi: Rana"],{
  272.         head="Yaoyotl Helm",
  273.         body="Phorcys Korazin",
  274.         back="Vespid Mantle",
  275.         legs="Miki. Cuisses"})
  276.     sets.WS["Tachi: Rana"].FullAcc = set_combine(sets.WS["Tachi: Rana"].LightAcc,{
  277.         body="Mes. Haubergeon",
  278.         ear1="Bladeborn Earring",
  279.         ear2="Steelflash Earring",
  280.         feet="Wakido sune-ate +1"})
  281.        
  282.     -- WS Apex Sets --
  283.     sets.WS["Apex Arrow"] = {
  284.         head="Sukeroku hachimaki",
  285.         neck="Iqabi necklace",
  286.         ear1="Bladeborn Earring",
  287.         ear2="Steelflash Earring",
  288.         body="Kyujutsugi",
  289.         hands="Unkai kote +2",
  290.         ring1="Paqichikaji Ring",
  291.         ring2="Karieyh Ring",
  292.         back="Vespid mantle",
  293.         waist="Caudata belt",
  294.         legs="Mikinaak cuisses",
  295.         feet="Wakido sune-ate +1"}
  296.     sets.WS["Apex Arrow"].LightAcc = set_combine(sets.WS["Apex Arrow"],{})
  297.     sets.WS["Apex Arrow"].FullAcc = set_combine(sets.WS["Apex Arrow"].LightAcc,{})
  298.        
  299.     -- JA Sets --
  300.     sets.JA = {}
  301.     sets.JA['Sengikori'] = {feet="Unkai Sune-Ate +2"}
  302.     sets.JA['Sekkanoki'] = {hands="Unkai Kote +2"}
  303.     sets.JA['Meditate'] = {head="Wakido Kabuto",hands="Sakonji Kote +1"}
  304.     sets.JA['Warding Circle'] = {head="Wakido Kabuto"}
  305.     sets.JA['Blade Bash'] = {hands="Sakonji Kote +1"}            
  306.      
  307.     -- Waltz Set --
  308.     sets.Waltz = {}
  309.        
  310.     -- Magic Sets Below
  311.     sets.Precast = {}
  312.     sets.Precast.FastCast = {    
  313.         head="Otomi Helm",
  314.         neck="Orunmila's Torque",    
  315.         ear2="Loquacious Earring",      
  316.         ring1="Veneficium Ring",
  317.         ring2="Prolix Ring"}
  318.    
  319.     sets.Midcast = {}
  320.     -- Magic Haste Set --
  321.     sets.Midcast.Haste = set_combine(sets.PDT,{})
  322. end
  323.      
  324. function pretarget(spell,action)
  325.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  326.         cancel_spell()
  327.         send_command('input /item "Echo Drops" <me>')    
  328.     elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  329.         cancel_spell()
  330.         send_command('ThirdEye')
  331.     elseif spell.english == "Meditate" and player.tp > 2990 then -- Cancel Meditate If TP Is Above 2990 --
  332.         cancel_spell()
  333.         add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
  334.     elseif spell.type == "WeaponSkill" and player.tp > 1000 and buffactive['amnesia'] or buffactive['stun'] or buffactive['sleep'] then
  335.         -- Won't try to Weaponskill and cause blinking when those status effects are on.
  336.         cancel_spell()
  337.         add_to_chat(39,spell.name .. ' Canceled: ['..player.name..' Stunned ,Slept or Amnesia]')
  338.         return
  339.     elseif (spell.english == 'Ranged' and spell.target.distance > 24.9) or (player.status == 'Engaged' and (((spell.english == "Namas Arrow" or spell.english == "Apex Arrow") and spell.target.distance > 16+target_distance) or (spell.type == "WeaponSkill" and spell.english ~= "Namas Arrow" and spell.english ~= "Apex Arrow" and spell.target.distance > target_distance))) then -- Cancel Ranged Attack or WS If You Are Out Of Range --
  340.         cancel_spell()
  341.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  342.         return
  343.     end
  344. end
  345.        
  346. function precast(spell,action)
  347.     if spell.name == "Ranged" then             
  348.         if player.equipment.ammo ~= 'empty' then           
  349.             if player.inventory[player.equipment.ammo].count < 5 then --Less than 5 ammo triggers a warning
  350.                 add_to_chat(8,"Ammo '"..player.inventory[player.equipment.ammo].shortname.."' running low ("..player.inventory[player.equipment.ammo].count.." Remain)")               
  351.             end
  352.         end
  353.     end
  354.     if spell.type == "WeaponSkill" then                    
  355.             equipSet = sets.WS
  356.             if equipSet[spell.english] then
  357.                 equipSet = equipSet[spell.english]
  358.             end
  359.             if equipSet[ACC_Array[ACC_Index]] then
  360.                 equipSet = equipSet[ACC_Array[ACC_Index]]
  361.             end
  362.             if spell.name == "Tachi: Fudo" then        
  363.                 if (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then
  364.                     equipSet = set_combine(equipSet,{ear1="Trux earring"})             
  365.                 elseif world.day == 'Lightsday' or world.day == 'Iceday' or world.day == 'Watersday' then
  366.                     equipSet = set_combine(equipSet,{head="Gavialis Helm"})                                                        
  367.                 end
  368.             end
  369.             if spell.name == "Tachi: Shoha" then           
  370.                 if (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then
  371.                     equipSet = set_combine(equipSet,{ear1="Trux earring"})             
  372.                 elseif world.day == 'Darksday' or world.day == 'Thundersday' or world.day == 'Windsday' then
  373.                     equipSet = set_combine(equipSet,{head="Gavialis Helm"})                                                        
  374.                 end        
  375.             end
  376.                 equip(equipSet)
  377.     end
  378.     if spell.type == "JobAbility" then
  379.             if sets.JA[spell.english] then
  380.                     equip(sets.JA[spell.english])
  381.             end
  382.     elseif spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  383.             if string.find(spell.english,'Utsusemi') then
  384.                     if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  385.                             cancel_spell()
  386.                             add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  387.                             return
  388.                     else
  389.                             equip(sets.Precast.FastCast)
  390.                     end
  391.                     else
  392.                             equip(sets.Precast.FastCast)
  393.                     end                
  394.             elseif spell.type == "Waltz" then
  395.                 equip(sets.Waltz)
  396.             elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  397.                 cast_delay(0.2)
  398.                 send_command('cancel Sneak')
  399.             end        
  400.             if Twilight == 'ON' then
  401.                 equip(sets.Twilight)
  402.             end
  403.             if Armor == 'PDT' then
  404.                 equip(sets.PDT)
  405.             end
  406.             if Armor == 'MDT' then
  407.                 equip(sets.MDT)
  408.             end
  409.             if Mecisto == 'ON' then
  410.                 equip(sets.Mecisto)                
  411.             end
  412.             if TH == 'ON' then
  413.             equip(sets.TH)         
  414.             end
  415.             if Mamool == 'ON' then
  416.                 equip(sets.Mamool)                 
  417.             end
  418.             if Movement == 'ON' then
  419.                 equip(sets.Movement)
  420.                 disable('feet')
  421.             else
  422.                 enable('feet')
  423.             end
  424.             if Rings == 'ON' then
  425.                 equip(sets.Rings)              
  426.             end
  427.             if buffactive["weakness"] then
  428.                 equip(sets.Twilight)
  429.                 disable('head','body')
  430.                 else
  431.                 enable('head','body')
  432.             end
  433.             if buffactive["Meikyo Shisui"] then
  434.                 equip(sets.OneHour)
  435.                 disable('feet')
  436.                 else
  437.                 enable('feet')
  438.             end
  439.     end
  440.    
  441. function midcast(spell,action)
  442.     if spell.action_type == 'Ranged Attack' then
  443.         equip(sets.Preshot)
  444.     end
  445.     if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  446.         if string.find(spell.english,'Utsusemi') then
  447.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  448.                 send_command('@wait 1.7;cancel Copy Image*')
  449.             end
  450.             equip(sets.Midcast.Haste)
  451.         elseif spell.english == 'Monomi: Ichi' then
  452.             if buffactive['Sneak'] then
  453.                 send_command('@wait 1.7;cancel sneak')
  454.             end
  455.             equip(sets.Midcast.Haste)
  456.         else
  457.             equip(sets.Midcast.Haste)
  458.         end
  459.     end
  460. end
  461.      
  462. function aftercast(spell,action)   
  463.     if spell.english == "Warding Circle" and not spell.interrupted then -- Warding Circle Countdown
  464.         send_command('wait 260;input /echo '..spell.name..' Effect: [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..' Effect: [OFF]')
  465.     end
  466.     status_change(player.status)
  467. end
  468.      
  469. function status_change(new,old)
  470.     if player.equipment.range ~= 'empty' then
  471.         disable('range','ammo')
  472.     else
  473.         enable('range','ammo')
  474.     end
  475.     if Armor == 'PDT' then
  476.         equip(sets.PDT)
  477.     elseif Armor == 'MDT' then
  478.         equip(sets.MDT)
  479.     elseif new == 'Engaged' then
  480.         equipSet = sets.TP
  481.         if equipSet[player.equipment.main] then
  482.             equipSet = equipSet[player.equipment.main]
  483.         end
  484.         if equipSet[ACC_Array[ACC_Index]] then
  485.             equipSet = equipSet[ACC_Array[ACC_Index]]
  486.         end
  487.         if buffactive.Aftermath and equipSet["AM"] then
  488.                 equipSet = equipSet["AM"]
  489.         end
  490.         if buffactive["Seigan"] and Seigan_T == 'ON' then
  491.                 equipSet = set_combine(equipSet,sets.TP["Seigan"])
  492.         end
  493.         equip(equipSet)
  494.     else
  495.         equip(sets.Idle[Idle_Array[Idle_Index]])
  496.     end            
  497.     if Twilight == 'ON' then
  498.         equip(sets.Twilight)
  499.     end    
  500.     if Mecisto == 'ON' then
  501.         equip(sets.Mecisto)        
  502.     end
  503.     if Movement == 'ON' then
  504.         equip(sets.Movement)
  505.         disable('feet')
  506.     else
  507.         enable('feet')
  508.     end
  509.     if TH == 'ON' then
  510.         equip(sets.TH)         
  511.     end
  512.     if Rings == 'ON' then
  513.         equip(sets.Rings)          
  514.     end
  515.     if buffactive["Meikyo Shisui"] then
  516.         equip(sets.OneHour)
  517.         disable('feet')
  518.     else
  519.         enable('feet')
  520.     end
  521.     if buffactive["weakness"] then
  522.         equip(sets.Twilight)
  523.         disable('head','body')        
  524.     else
  525.         enable('head','body')
  526.     end
  527. end
  528.    
  529. function buff_change(buff,gain)            
  530.     if buff == "Hasso" and Auto_Hasso == 'ON' then
  531.         if not gain then
  532.             send_command('Hasso')
  533.         end
  534.     elseif buff == "Seigan" and gain then
  535.         status_change(player.status)
  536.     else
  537.         status_change(player.status)
  538.     end  
  539.     if buff == "encumbrance" then
  540.         if not gain then
  541.             add_to_chat(200,"No longer Encumbered")    
  542.             equip(sets.Encumber[Encumber_Set_Names[Encumber_Index]])
  543.         end
  544.     end
  545.     if buff == "sleep" and player.hp > 200 and player.status == "Engaged" then
  546.         if gain then        
  547.             equip(sets.Slept)
  548.             add_to_chat(39,"Slept: [Equipping Berserker's Torque]")    
  549.         else
  550.             status_change(player.status)
  551.             add_to_chat(200,"Awake: [Removing Berserker's Torque]")
  552.         end    
  553.     end
  554.     if buff == "Yaegasumi" then
  555.         if gain then
  556.             send_command('timers create "Yaegasumi" 45 down')
  557.         else
  558.             send_command('timers delete "Yaegasumi"')
  559.             add_to_chat(158,'Yaegasumi: [OFF]')
  560.         end
  561.     end
  562.     if buff == "weakness" then
  563.         if gain then
  564.             send_command('timers create "Weakness" 300 up abilities/00255.png')
  565.         else
  566.             send_command('timers delete "Weakness"')
  567.             add_to_chat(158,'Unweak!')
  568.         end
  569.     end
  570.     if buff == "Aftermath: Lv.3" then --Aftermath: lv.3
  571.         if gain then
  572.             send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  573.         else
  574.             send_command('timers delete "Aftermath: Lv.3"')
  575.             add_to_chat(158,'Aftermath: lv.3: [OFF]')
  576.         end
  577.     end
  578. end
  579.      
  580. --Toggle Self Commands with //gs c [command name]
  581. --Example type in chat //gs c acc (case sensitive)
  582. --Example Make a macro /console gs c acc (case sensitive)
  583. function self_command(command)
  584.     if command == 'c2' then -- Acc Toggle for TP/WS/ --
  585.         ACC_Index = (ACC_Index % #ACC_Array) + 1
  586.         add_to_chat(207,'Accuracy Level TP/WS: '..ACC_Array[ACC_Index])
  587.         status_change(player.status)
  588.     elseif command == 'c1' then -- Idle Toggle --
  589.         Idle_Index = (Idle_Index % #Idle_Array) + 1
  590.         add_to_chat(207,'Idle Set: '..Idle_Array[Idle_Index])
  591.         status_change(player.status)            
  592.     elseif command == 'c5' then -- PDT Toggle --
  593.         if Armor == 'PDT' then
  594.             Armor = 'None'
  595.             add_to_chat(123,'PDT Set: [Unlocked]')
  596.         else
  597.             Armor = 'PDT'
  598.             add_to_chat(158,'PDT Set: [Locked]')
  599.         end
  600.         status_change(player.status)
  601.     elseif command == 'mdt' then -- MDT Toggle --
  602.         if Armor == 'MDT' then
  603.             Armor = 'None'
  604.             add_to_chat(123,'MDT Set: [Unlocked]')
  605.         else
  606.             Armor = 'MDT'
  607.             add_to_chat(158,'MDT Set: [Locked]')
  608.         end
  609.         status_change(player.status)
  610.     elseif command == 'c4' then -- Seigan/ThirdEye Toggle --
  611.         if Seigan_T == 'ON' then
  612.             Seigan_T = 'OFF'
  613.             add_to_chat(123,'Seigan Set: [Unlocked]')
  614.         else
  615.             Seigan_T = 'ON'
  616.             add_to_chat(158,'Seigan Set: [Locked]')
  617.         end
  618.         status_change(player.status)
  619.     elseif command == 'c7' then -- Twilight Toggle --
  620.         if Twilight == 'ON' then
  621.             Twilight = 'OFF'
  622.             add_to_chat(123,'Twilight Set: [Unlocked]')
  623.         else
  624.             Twilight = 'ON'
  625.             add_to_chat(158,'Twilight Set: [locked]')
  626.         end
  627.         status_change(player.status)
  628.     elseif command == 'distance' then -- Distance Toggle --
  629.         if player.target.distance then
  630.             target_distance = math.floor(player.target.distance*10)/10
  631.             add_to_chat(57,'Distance: '..target_distance)
  632.         else
  633.             add_to_chat(158,'No Target Selected')
  634.         end
  635.     elseif command == 'rive' then -- Rives Necklace --
  636.         if TH == 'ON' then
  637.             TH = 'OFF'             
  638.             add_to_chat(123,'Rives Necklace: [OFF]')
  639.         else
  640.             TH = 'ON'              
  641.             add_to_chat(158,'Rives Necklace: [ON]')
  642.         end
  643.         status_change(player.status)
  644.     elseif command == 'rings' then -- Capacity/Warp Ring Toggle --
  645.         if Rings == 'ON' then
  646.             Rings = 'OFF'              
  647.             add_to_chat(123,'Capacity/Warp Ring: [OFF]')
  648.         else
  649.             Rings = 'ON'               
  650.             add_to_chat(158,'Capacity/Warp Ring: [ON]')
  651.         end
  652.         status_change(player.status)   
  653.     elseif command == 'c6' then -- Auto Hasso --
  654.         if Auto_Hasso == 'ON' then
  655.             Auto_Hasso = 'OFF'             
  656.             add_to_chat(123,'Auto Hasso: [OFF]')
  657.         else
  658.             Auto_Hasso = 'ON'              
  659.             add_to_chat(158,'Auto Hasso: [ON]')
  660.             send_command('Hasso')
  661.         end
  662.     elseif command == 'c3' then -- Mecisto. Mantle Toggle --
  663.         if Mecisto == 'ON' then
  664.             Mecisto = 'OFF'            
  665.             add_to_chat(123,'Mecisto. Mantle: [Unlocked]')
  666.         else
  667.             Mecisto = 'ON'             
  668.             add_to_chat(158,'Mecisto. Mantle: [Locked]')
  669.         end
  670.         status_change(player.status)   
  671.     elseif command == 'movement' then -- Movement Toggle --
  672.         if Movement == 'ON' then
  673.             Movement = 'OFF'               
  674.             add_to_chat(57,'Movement Set: [OFF]')
  675.         else
  676.             Movement = 'ON'            
  677.             add_to_chat(158,'Movement Set: [ON]')
  678.         end
  679.         status_change(player.status)
  680.     elseif command == 'encumber' then
  681.         Encumber_Index = Encumber_Index +1
  682.         if Encumber_Index > #Encumber_Set_Names then Encumber_Index = 1 end
  683.         add_to_chat(207,'Encumber [Weapon] '..Encumber_Set_Names[Encumber_Index]..'')    
  684.         equip(sets.Encumber[Encumber_Set_Names[Encumber_Index]])            
  685.     elseif command == 'update' then -- Auto Update Gear Toggle --
  686.         status_change(player.status)
  687.         add_to_chat(207,'Auto Update Gear')
  688.     elseif command == 'active' then -- Shows what sets and toggles are active --
  689.         add_to_chat(8,'Current Active sets below...')
  690.         add_to_chat(207,'Idle Set Active: '..Idle_Array[Idle_Index]..'')    
  691.         add_to_chat(207,'Accuracy Level TP/WS Active: '..ACC_Array[ACC_Index]..'')         
  692.         add_to_chat(207,'Target distance set to: '..target_distance..'')
  693.         add_to_chat(207,'TH [Chaac Belt]: '..TH..'')
  694.         add_to_chat(207,'CP [Mecisto. Mantle]: '..Mecisto..'')
  695.         add_to_chat(207,'Capacity/Warp Rings: '..Rings..'')
  696.         add_to_chat(207,'Auto [Hasso]: '..Auto_Hasso..'')
  697.         add_to_chat(207,'Movement Set: '..Movement..'')
  698.         add_to_chat(207,'Twilight Set: '..Twilight..'')
  699.         add_to_chat(207,'Seigan-Third Eye Set: '..Seigan_T..'')
  700.         add_to_chat(207,'PDT/MDT Set: '..Armor..'')                
  701.     end
  702. end
  703. function file_unload()
  704.     send_command('unbind f10')
  705.     send_command('unbind f9')
  706. end
Advertisement
Add Comment
Please, Sign In to add comment