Guest User

I broke skillup.lua

a guest
Oct 5th, 2014
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.44 KB | None | 0 0
  1.    
  2.  
  3.     --[[How to use:
  4.             --this tool is set it and forget it you can leave it running for hours as long as se does not log you out it will keep running--
  5.             1.)place "skillup.lua" in your normal gearswap folder(where all your job files are)
  6.             2.)then us "gs l skillup.lua" to load this skill up in to gearswap
  7.             3.) on lines 22 and 25 of this file you can put in you wind and string instruments
  8.             to start Geomancy magic skillup use command "gs c startgeo"
  9.             to start Healing magic skillup use command "gs c starthealing"
  10.             to start Enhancing magic skillup use command "gs c startenhancing"
  11.             to start Ninjutsu magic skillup use command "gs c startninjutsu"
  12.             to start Singing magic skillup use command "gs c startsinging"
  13.             to start Blue magic skillup use command "gs c startblue"
  14.             to start Summoning magic skillup use command "gs c startsmn"
  15.             to stop all skillups use command "gs c skillstop"
  16.             to auto shutdown after skillup use command "gs c aftershutdown"
  17.             to auto logoff after skillup use command "gs c afterlogoff"
  18.             to just stop and stay logged on after skillup use command "gs c afterStop"(only needed if you use one of the above auto shutdown/logoff)
  19.             if you want to change the spell list all you need to do is remove the spells that you do not want to cast from the spell lists(i.e. geospells,healingspells,etc.)
  20.            
  21.             much thanks to Arcon,Byrth,Mote,and anybody else i forgot for the help in making this]]
  22.            
  23.             debugmode = false
  24.  
  25.  
  26.     function get_sets()
  27.             skilluprun = false
  28.             sets.brd = {}
  29.             sets.brd.wind = {
  30.                     range="Cornette"--put your wind instrument here
  31.             }
  32.             sets.brd.string = {
  33.                     range="Lamia Harp"--put your string instrument here
  34.             }
  35.             skilluptype = {"Geomancy","Healing","Enhancing","Ninjutsu","Singing","Blue","Summoning","Elemental"}
  36.             skillupcount = 1
  37.             elementspells = {"Thunder","Blizzard","Aero","Fire","Stone","Frost","Choke","Shock"}
  38.             elementcount = 1           
  39.             geospells = {"Indi-Acumen","Indi-AGI","Indi-Attunement","Indi-Barrier","Indi-CHR","Indi-DEX","Indi-Fade","Indi-Fend","Indi-Focus","Indi-Frailty","Indi-Fury","Indi-Gravity","Indi-Haste","Indi-INT","Indi-Languor","Indi-Malaise","Indi-MND","Indi-Paralysis","Indi-Poison","Indi-Precision","Indi-Refresh","Indi-Regen","Indi-Slip","Indi-Slow","Indi-STR","Indi-Torpor","Indi-Vex","Indi-VIT","Indi-Voidance","Indi-Wilt"}
  40.             geocount = 1
  41.             healingspells = {"Blindna","Cura","Cura II","Cura III","Curaga","Curaga II","Curaga III","Curaga IV","Curaga V","Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI","Cursna","Esuna","Paralyna","Poisona","Reraise","Reraise II","Reraise III","Silena","Stona","Viruna"}
  42.             healingcount = 1
  43.             enhancespells = {"Adloquium","Animus Augeo","Animus Minuo","Aquaveil","Aurorastorm","Auspice","Baraera","Baraero","Baramnesia","Baramnesra","Barblind","Barblindra","Barblizzara","Barblizzard","Barfira","Barfire","Barparalyze","Barparalyzra","Barpetra","Barpetrify","Barpoison","Barpoisonra","Barsilence","Barsilencera","Barsleep","Barsleepra","Barstone","Barstonra","Barthunder","Barthundra","Barvira","Barvirus","Barwater","Barwatera","Blaze Spikes","Blink","Boost-AGI","Boost-CHR","Boost-DEX","Boost-INT","Boost-MND","Boost-STR","Boost-VIT","Crusade","Deodorize","Embrava","Enaero","Enaero II","Enblizzard","Enblizzard II","Enfire","Enfire II","Enstone","Enstone II","Enthunder","Enthunder II","Enwater","Enwater II","Erase","Escape","Firestorm","Foil","Gain-AGI","Gain-CHR","Gain-DEX","Gain-INT","Gain-MND","Gain-STR","Gain-VIT","Hailstorm","Haste","Ice Spikes","Invisible","Phalanx","Phalanx II","Protect","Protect II","Protect III","Protect IV","Protect V","Protectra","Protectra II","Protectra III","Protectra IV","Protectra V","Rainstorm","Refresh","Refresh II","Regen","Regen II","Regen III","Regen IV","Regen V","Reprisal","Sandstorm","Shell","Shell II","Shell III","Shell IV","Shell V","Shellra","Shellra II","Shellra III","Shellra IV","Shellra V","Shock Spikes","Sneak","Stoneskin","Temper","Thunderstorm","Voidstorm","Windstorm"}
  44.             enhancecount = 1
  45.             ninspells = {"Gekka: Ichi","Kakka: Ichi","Migawari: Ichi","Monomi: Ichi","Myoshu: Ichi","Tonko: Ichi","Tonko: Ni","Utsusemi: Ichi","Utsusemi: Ni","Yain: Ichi","Yain: Ichi","Gekka: Ichi"}
  46.             nincount = 1
  47.             nincant = {}
  48.             nincantcount = 0
  49.             nin_tools ={
  50.                     ["Monomi: Ichi"] = {tool='Sanjaku-Tenugui',tool_bag="Toolbag (Sanja)",tool_bag_id=5417,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  51.                     ["Aisha: Ichi"] = {tool='Soshi',tool_bag="Toolbag (Soshi)",tool_bag_id=5734,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  52.                     ["Katon: Ichi"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  53.                     ["Katon: Ni"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  54.                     ["Katon: San"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  55.                     ["Hyoton: Ichi"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  56.                     ["Hyoton: Ni"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  57.                     ["Hyoton: San"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  58.                     ["Huton: Ichi"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  59.                     ["Huton: Ni"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  60.                     ["Huton: San"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  61.                     ["Doton: Ichi"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  62.                     ["Doton: Ni"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  63.                     ["Doton: San"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  64.                     ["Raiton: Ichi"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  65.                     ["Raiton: Ni"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  66.                     ["Raiton: San"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  67.                     ["Suiton: Ichi"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  68.                     ["Suiton: Ni"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  69.                     ["Suiton: San"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867},
  70.                     ["Utsusemi: Ichi"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  71.                     ["Utsusemi: Ni"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  72.                     ["Utsusemi: San"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  73.                     ["Jubaku: Ichi"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  74.                     ["Jubaku: Ni"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  75.                     ["Jubaku: San"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  76.                     ["Hojo: Ichi"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  77.                     ["Hojo: Ni"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  78.                     ["Hojo: San"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  79.                     ["Kurayami: Ichi"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  80.                     ["Kurayami: Ni"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  81.                     ["Kurayami: San"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  82.                     ["Dokumori: Ichi"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  83.                     ["Dokumori: Ni"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  84.                     ["Dokumori: San"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  85.                     ["Tonko: Ichi"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  86.                     ["Tonko: Ni"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  87.                     ["Tonko: San"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  88.                     ["Gekka: Ichi"] = {tool='Ranka',tool_bag="Toolbag (Ranka)",tool_bag_id=6265,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  89.                     ["Yain: Ichi"] = {tool='Furusumi',tool_bag="Toolbag (Furu)",tool_bag_id=6266,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  90.                     ["Myoshu: Ichi"] = {tool='Kabenro',tool_bag="Toolbg. (Kaben)",tool_bag_id=5863,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  91.                     ["Yurin: Ichi"] = {tool='Jinko',tool_bag="Toolbag (Jinko)",tool_bag_id=5864,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869},
  92.                     ["Kakka: Ichi"] = {tool='Ryuno',tool_bag="Toolbag (Ryuno)",tool_bag_id=5865,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  93.                     ["Migawari: Ichi"] = {tool='Mokujin',tool_bag="Toolbag (Moku)",tool_bag_id=5866,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868},
  94.                     }
  95.             songspells = {"Knight's Minne","Advancing March","Adventurer's Dirge","Archer's Prelude","Army's Paeon","Army's Paeon II","Army's Paeon III","Army's Paeon IV","Army's Paeon V","Army's Paeon VI","Bewitching Etude","Blade Madrigal","Chocobo Mazurka","Dark Carol","Dark Carol II","Dextrous Etude","Dragonfoe Mambo","Earth Carol","Earth Carol II","Enchanting Etude","Fire Carol","Fire Carol II","Foe Sirvente","Fowl Aubade","Goblin Gavotte","Goddess's Hymnus","Gold Capriccio","Herb Pastoral","Herculean Etude","Hunter's Prelude","Ice Carol","Ice Carol II","Knight's Minne II","Knight's Minne III","Knight's Minne IV","Knight's Minne V","Learned Etude","Light Carol","Light Carol II","Lightning Carol","Lightning Carol II","Logical Etude","Mage's Ballad","Mage's Ballad II","Mage's Ballad III","Puppet's Operetta","Quick Etude","Raptor Mazurka","Sage Etude","Scop's Operetta","Sentinel's Scherzo","Sheepfoe Mambo","Shining Fantasia","Sinewy Etude","Spirited Etude","Swift Etude","Sword Madrigal","Uncanny Etude","Valor Minuet","Valor Minuet II","Valor Minuet III","Valor Minuet IV","Valor Minuet V","Victory March","Vital Etude","Vivacious Etude","Warding Round","Water Carol","Water Carol II","Wind Carol","Wind Carol II"}
  96.             songcount = 1
  97.             bluspells = {"Pollen","Wild Carrot","Refueling","Feather Barrier","Magic Fruit","Diamondhide","Warm-Up","Amplification","Triumphant Roar","Saline Coat","Reactor Cool","Plasma Charge","Plenilune Embrace","Regeneration","Animating Wail","Battery Charge","Magic Barrier","Fantod","Winds of Promy.","Barrier Tusk","White Wind","Harden Shell","O. Counterstance","Pyric Bulwark","Nat. Meditation","Carcharian Verve","Healing Breeze"}
  98.             bluspellul = S{"Harden Shell","Thunderbolt","Absolute Terror","Gates of Hades","Tourbillion","Pyric Bulwark","Bilgestorm","Bloodrake","Droning Whirlwind","Carcharian Verve","Blistering Roar"}
  99.             blucount = 1
  100.             smnspells = {"Carbuncle","Cait Sith","Diabolos","Fenrir","Garuda","Ifrit","Leviathan","Ramuh","Shiva","Titan","Air Spirit","Dark Spirit","Earth Spirit","Fire Spirit","Ice Spirit","Light Spirit","Thunder Spirit","Water Spirit"}
  101.             smncount = 1
  102.             sets.Idle = {
  103.                     main="Dark Staff",
  104.                     left_ear="Relaxing Earring",
  105.                     right_ear="Liminus Earring",
  106.             }
  107.             shutdown = false
  108.             logoff = false
  109.             healingcap = false
  110.             enhancingcap = false
  111.             summoningcap = false
  112.             ninjutsucap = false
  113.             singingcap = false
  114.             stringcap = false
  115.             windcap = false
  116.             bluecap = false
  117.             geomancycap = false
  118.             handbellcap = false
  119.             add_to_chat(123,"Skill Up Loaded")
  120.     end
  121.     function status_change(new,old)
  122.             if new=='Idle' then
  123.                     equip(sets.Idle)
  124.                     if skilluptype[skillupcount] == "Geomancy" and skilluprun then
  125.                             send_command('wait 1.0;input /ma "'..geospells[geocount]..'" <me>')
  126.                     elseif skilluptype[skillupcount] == "Healing" and skilluprun then
  127.                             send_command('wait 1.0;input /ma "'..healingspells[healingcount]..'" <me>')
  128.                     elseif skilluptype[skillupcount] == "Enhancing" and skilluprun then
  129.                             send_command('wait 1.0;input /ma "'..enhancespells[enhancecount]..'" <me>')
  130.                     elseif skilluptype[skillupcount] == "Ninjutsu" and skilluprun then
  131.                             send_command('wait 1.0;input /ma "'..ninspells[nincount]..'" <me>')
  132.                     elseif skilluptype[skillupcount] == "Singing" and skilluprun then
  133.                             send_command('wait 1.0;input /ma "'..songspells[songcount]..'" <me>')
  134.                     elseif skilluptype[skillupcount] == "Blue" and skilluprun then
  135.                             send_command('wait 1.0;input /ma "'..bluspells[blucount]..'" <me>')
  136.                     elseif skilluptype[skillupcount] == "Summoning" and skilluprun then
  137.                             send_command('wait 1.0;input /ma "'..smnspells[smncount]..'" <me>')
  138.                     else if skilluptype[skillupcount] == "Element" and skilluprun then
  139.                             send_command('wait 1.0;input /ma "'..elementspells[elementcount]..'" <t>')
  140.                     end
  141.             end
  142.     end
  143.     function filtered_action(spell)
  144.             if spell.type == "Geomancy" and skilluprun then
  145.                     cancel_spell()
  146.                     geocount = (geocount % #geospells) + 1
  147.                     send_command('input /ma "'..geospells[geocount]..'" <me>')
  148.                     return
  149.             elseif spell.skill == "Healing Magic" and skilluprun then
  150.                     cancel_spell()
  151.                     healingcount = (healingcount % #healingspells) + 1
  152.                     send_command('input /ma "'..healingspells[healingcount]..'" <me>')
  153.                     return
  154.             elseif spell.skill == "Enhancing Magic" and skilluprun then
  155.                     cancel_spell()
  156.                     enhancecount = (enhancecount % #enhancespells) + 1
  157.                     send_command('input /ma "'..enhancespells[enhancecount]..'" <me>')
  158.                     return
  159.             elseif spell.skill == "Elemental Magic" and skilluprun then
  160.                     cancel_spell()
  161.                     elementcount = (elementcount % #elementspells) + 1
  162.                     send_command('input /ma "'..elementspells[elementcount]..'" <t>')
  163.                     return
  164.             elseif spell.skill == "Ninjutsu" and skilluprun then
  165.                     if not windower.ffxi.get_spells()[spell.id] then
  166.                             cancel_spell()
  167.                             nincount = (nincount % #ninspells) + 1
  168.                             send_command('input /ma "'..ninspells[nincount]..'" <me>')
  169.                             return
  170.                     else
  171.                             nincount = (nincount % #ninspells) + 1
  172.                     end
  173.                     if nin_tool_check() then
  174.                             cancel_spell()
  175.                             send_command('input /item "'..nin_tool_open()..'" <me>')
  176.                     end
  177.             elseif spell.skill == "Singing" and skilluprun then
  178.                     cancel_spell()
  179.                     songcount = (songcount % #songspells) + 1
  180.                     send_command('input /ma "'..songspells[songcount]..'" <me>')
  181.                     return
  182.             elseif spell.skill == "Blue Magic" and skilluprun then
  183.                     cancel_spell()
  184.                     blucount = (blucount % #bluspells) + 1
  185.                     send_command('input /ma "'..bluspells[blucount]..'" <me>')
  186.                     return
  187.             elseif spell.type == "SummonerPact" and skilluprun then
  188.                     cancel_spell()
  189.                     smncount = (smncount % #smnspells) + 1
  190.                     send_command('input /ma "'..smnspells[smncount]..'" <me>')
  191.                     return
  192.             elseif spell.name == "Unbridled Learning" then
  193.                     cancel_spell()
  194.                     blucount = (blucount % #bluspells) + 1
  195.                     send_command('input /ma "'..bluspells[blucount]..'" <me>')
  196.                     return
  197.             elseif spell.name == "Avatar's Favor" then
  198.                             cancel_spell()
  199.                             send_command('input /ja "Release" <me>')
  200.                             return
  201.             end
  202.     end
  203.     function precast(spell)
  204.             if spell then
  205.                     if spell.mp_cost > player.mp then
  206.                             cancel_spell()
  207.                             send_command('input /heal on')
  208.                             return
  209.                     end
  210.             end
  211.             if spell.type == "Geomancy" and skilluprun then
  212.                     if not windower.ffxi.get_spells()[spell.id] then
  213.                             cancel_spell()
  214.                             geocount = (geocount % #geospells) + 1
  215.                             send_command('input /ma "'..geospells[geocount]..'" <me>')
  216.                             return
  217.                     else
  218.                             geocount = (geocount % #geospells) + 1
  219.                     end
  220.             elseif spell.skill == "Healing Magic" and skilluprun then
  221.                     if not windower.ffxi.get_spells()[spell.id] then
  222.                             cancel_spell()
  223.                             healingcount = (healingcount % #healingspells) + 1
  224.                             send_command('input /ma "'..healingspells[healingcount]..'" <me>')
  225.                             return
  226.                     else
  227.                             healingcount = (healingcount % #healingspells) + 1
  228.                     end
  229.             elseif spell.skill == "Enhancing Magic" and skilluprun then
  230.                     if not windower.ffxi.get_spells()[spell.id] then
  231.                             cancel_spell()
  232.                             enhancecount = (enhancecount % #enhancespells) + 1
  233.                             send_command('input /ma "'..enhancespells[enhancecount]..'" <me>')
  234.                             return
  235.                     else
  236.                             enhancecount = (enhancecount % #enhancespells) + 1
  237.                     end
  238.             elseif spell.skill == "Ninjutsu" and skilluprun then
  239.                     if not windower.ffxi.get_spells()[spell.id] then
  240.                             cancel_spell()
  241.                             nincount = (nincount % #ninspells) + 1
  242.                             send_command('input /ma "'..ninspells[nincount]..'" <me>')
  243.                             return
  244.                     else
  245.                             nincount = (nincount % #ninspells) + 1
  246.                     end
  247.             elseif spell.skill == "Singing" and skilluprun then
  248.                     if not stringcap then
  249.                             equip(sets.brd.string)
  250.                     elseif not windcap then
  251.                             equip(sets.brd.wind)
  252.                     end
  253.                     if not windower.ffxi.get_spells()[spell.id] then
  254.                             cancel_spell()
  255.                             songcount = (songcount % #songspells) + 1
  256.                             send_command('input /ma "'..songspells[songcount]..'" <me>')
  257.                             return
  258.                     else
  259.                             songcount = (songcount % #songspells) + 1
  260.                     end
  261.             elseif spell.skill == "Blue Magic" and skilluprun then
  262.                     if not windower.ffxi.get_spells()[spell.id] then
  263.                             cancel_spell()
  264.                             blucount = (blucount % #bluspells) + 1
  265.                             send_command('input /ma "'..bluspells[blucount]..'" <me>')
  266.                             return
  267.                     else
  268.                             blucount = (blucount % #bluspells) + 1
  269.                     end
  270.             elseif spell.type == "SummonerPact" and skilluprun then
  271.                     if not windower.ffxi.get_spells()[spell.id] then
  272.                             cancel_spell()
  273.                             smncount = (smncount % #smnspells) + 1
  274.                             send_command('input /ma "'..smnspells[smncount]..'" <me>')
  275.                             return
  276.                     else
  277.                             smncount = (smncount % #smnspells) + 1
  278.                     end
  279.             end
  280.             if spell.name == "Avatar's Favor" then
  281.                     if (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) or buffactive["Avatar's Favor"] then
  282.                             cancel_spell()
  283.                             send_command('input /ja "Release" <me>')
  284.                             return
  285.                     end
  286.             elseif spell.name == "Elemental Siphon" then
  287.                     if (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) or player.mpp > 75 then
  288.                             cancel_spell()
  289.                             send_command('input /ja "Release" <me>')
  290.                             return
  291.                     end
  292.             elseif spell.name == "Unbridled Learning" then
  293.                     if bluspellul:contains(bluspells[blucount]) and not windower.ffxi.get_spells()[ulid[bluspells[blucount]]] then
  294.                             if not buffactive["Unbridled Learning"] then
  295.                                     if (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) then
  296.                                             cancel_spell()
  297.                                             blucount = (blucount % #bluspells) + 1
  298.                                             send_command('input /ma "'..bluspells[blucount]..'" <me>')
  299.                                             return
  300.                                     end
  301.                             end
  302.                     else
  303.                             cancel_spell()
  304.                             blucount = (blucount % #bluspells) + 1
  305.                             send_command('input /ma "'..bluspells[blucount]..'" <me>')
  306.                             return
  307.                     end
  308.             end
  309.             if spell.name == "Release" then
  310.                     if not pet.isvalid then
  311.                             cancel_spell()
  312.                             send_command('input /heal on')
  313.                             return
  314.                     end
  315.                     local recast = windower.ffxi.get_ability_recasts()[spell.recast_id]
  316.                     add_to_chat(7,"recast="..tostring(recast))
  317.                     if (recast > 0) then
  318.                             cancel_spell()
  319.                             send_command('wait '..tostring(recast+0.5)..';input /ja "Release" <me>')
  320.                             return
  321.                     end
  322.                     -- if (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) then
  323.                             -- cancel_spell()
  324.                             -- while (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) do
  325.                                     -- stand()
  326.                                     -- if (windower.ffxi.get_ability_recasts()[spell.recast_id] < 1) then
  327.                                             -- break
  328.                                     -- end
  329.                             -- end
  330.                             -- send_command('wait 1.05;input /ja "Release" <me>')
  331.                     -- end
  332.             end
  333.     end
  334.     function aftercast(spell)
  335.             if skilluprun then
  336.                     if spell.type == "Geomancy" then
  337.                             if geomancycap and handbellcap then
  338.                                     skilluprun = false
  339.                                     shutdown_logoff()
  340.                                     return
  341.                             end
  342.                             send_command('wait 3.0;input /ma "'..geospells[geocount]..'" <me>')
  343.                     elseif spell.skill == "Healing Magic" then
  344.                             if healingcap then
  345.                                     skilluprun = false
  346.                                     shutdown_logoff()
  347.                                     return
  348.                             end
  349.                             send_command('wait 3.0;input /ma "'..healingspells[healingcount]..'" <me>')
  350.                     elseif spell.skill == "Enhancing Magic" then
  351.                             if enhancingcap then
  352.                                     skilluprun = false
  353.                                     shutdown_logoff()
  354.                                     return
  355.                             end
  356.                             send_command('wait 3.0;input /ma "'..enhancespells[enhancecount]..'" <me>')
  357.                     elseif spell.skill == "Ninjutsu" then
  358.                             if ninjutsucap then
  359.                                     skilluprun = false
  360.                                     shutdown_logoff()
  361.                                     return
  362.                             end
  363.                             send_command('wait 3.0;input /ma "'..ninspells[nincount]..'" <me>')
  364.                     elseif spell.skill == "Singing" then
  365.                             if singingcap and stringcap and windcap then
  366.                                     skilluprun = false
  367.                                     shutdown_logoff()
  368.                                     return
  369.                             end
  370.                             send_command('wait 3.0;input /ma "'..songspells[songcount]..'" <me>')
  371.                     elseif spell.skill == "Blue Magic" then
  372.                             if bluecap then
  373.                                     skilluprun = false
  374.                                     shutdown_logoff()
  375.                                     return
  376.                             end
  377.                             send_command('wait 3.5;input /ja "Unbridled Learning" <me>')
  378.                     elseif spell.type == "SummonerPact" then
  379.                             if summoningcap then
  380.                                     skilluprun = false
  381.                                     send_command('wait 4.0;input /ja "Release" <me>')
  382.                                     return
  383.                             end
  384.                             if spell.name:contains('Spirit') and (spell.element == world.weather_element or spell.element == world.day_element)then
  385.                                     send_command('wait 4.0;input /ja "Elemental Siphon" <me>')
  386.                             else
  387.                                     send_command('wait 4.0;input /ja "Avatar\'s Favor" <me>')
  388.                             end
  389.                     elseif spell.name == "Release" then
  390.                             if spell.interrupted then
  391.                                     send_command('wait 0.5; input /ja "Release" <me>')
  392.                                     return
  393.                             end
  394.                             send_command('wait 1.0;input /ma "'..smnspells[smncount]..'" <me>')
  395.                     elseif spell.name == "Avatar's Favor" then
  396.                             send_command('wait 1.0;input /ja "Release" <me>')
  397.                     elseif spell.name == "Elemental Siphon" then
  398.                             send_command('wait 1.0;input /ja "Release" <me>')
  399.                     elseif spell.name == "Unbridled Learning" then
  400.                             send_command('wait 1.0;input /ma "'..bluspells[blucount]..'" <me>')
  401.                     end
  402.             elseif spell.type == "SummonerPact" then
  403.                     if summoningcap then
  404.                             skilluprun = false
  405.                             send_command('wait 4.0;input /ja "Release" <me>')
  406.                             return
  407.                     end
  408.                     if spell.name:contains('Spirit') then
  409.                             send_command('wait 4.0;input /ja "Elemental Siphon" <me>')
  410.                     else
  411.                             send_command('wait 4.0;input /ja "Avatar\'s Favor" <me>')
  412.                     end
  413.             elseif spell.name == "Release" then
  414.                     if summoningcap then
  415.                             shutdown_logoff()
  416.                             return
  417.                     end
  418.                     if pet.isvalid then
  419.                             if spell.interrupted then
  420.                                     send_command('wait 0.5; input /ja "Release" <me>')
  421.                                     return
  422.                             end
  423.                     end
  424.             elseif spell.name == "Avatar's Favor" then
  425.                     send_command('wait 1.0;input /ja "Release" <me>')
  426.             end
  427.     end
  428.     function self_command(command)
  429.             if command == "startgeo" then
  430.                     skilluprun = true
  431.                     skillupcount = 1
  432.                     send_command('wait 1.0;input /ma "'..geospells[geocount]..'" <me>')
  433.                     add_to_chat(123,"Starting Geomancy Skill up")
  434.             end
  435.             if command == "starthealing" then
  436.                     skilluprun = true
  437.                     skillupcount = 2
  438.                     send_command('wait 1.0;input /ma "'..healingspells[healingcount]..'" <me>')
  439.                     add_to_chat(123,"Starting Healing Skill up")
  440.             end
  441.             if command == "startenhancing" then
  442.                     skilluprun = true
  443.                     skillupcount = 3
  444.                     send_command('wait 1.0;input /ma "'..enhancespells[enhancecount]..'" <me>')
  445.                     add_to_chat(123,"Starting Enhancing Skill up")
  446.             end
  447.             if command == "startninjutsu" then
  448.                     skilluprun = true
  449.                     skillupcount = 4
  450.                     send_command('wait 1.0;input /ma "'..ninspells[nincount]..'" <me>')
  451.                     add_to_chat(123,"Starting Ninjutsu Skill up")
  452.             end
  453.             if command == "startsinging" then
  454.                     skilluprun = true
  455.                     skillupcount = 5
  456.                     send_command('wait 1.0;input /ma "'..songspells[songcount]..'" <me>')
  457.                     add_to_chat(123,"Starting Singing Skill up")
  458.             end
  459.             if command == "startblue" then
  460.                     skilluprun = true
  461.                     skillupcount = 6
  462.                     send_command('wait 1.0;input /ma "'..bluspells[blucount]..'" <me>')
  463.                     add_to_chat(123,"Starting Blue Magic Skill up")
  464.             end
  465.             if command == "startsmn" then
  466.                     skilluprun = true
  467.                     skillupcount = 7
  468.                     send_command('wait 1.0;input /ma "'..smnspells[smncount]..'" <me>')
  469.                     add_to_chat(123,"Starting Summoning Skill up")
  470.             end
  471.             if command == "startelement" then
  472.                     skilluprun = true
  473.                     skillupcount = 8
  474.                     send_command('wait 1.0;input /ma "'..elementspells[elementcount]..'" <t>')
  475.                     add_to_chat(123,"Starting Elemental Skill up")
  476.             end
  477.             if command == "skillstop" then
  478.                     skilluprun = false
  479.                     add_to_chat(123,"Stoping Skill up")
  480.             end
  481.             if command == 'aftershutdown' then
  482.                     shutdown = true
  483.                     logoff = false
  484.                     add_to_chat(123, '----- Will Shutdown When Skillup Done -----')
  485.             end
  486.             if command == 'afterlogoff' then
  487.                     shutdown = false
  488.                     logoff = true
  489.                     add_to_chat(123, '----- Will Logoff When Skillup Done -----')
  490.             end
  491.             if command == 'afterStop' then
  492.                     shutdown = false
  493.                     logoff = false
  494.                     add_to_chat(123, '----- Will Stop When Skillup Done -----')
  495.             end
  496.     end
  497.     function shutdown_logoff()
  498.                     add_to_chat(123,"Auto stop skillup")
  499.             if logoff then
  500.                     send_command('wait 3.0;input /logoff')
  501.             elseif shutdown then
  502.                     send_command('wait 3.0;input /shutdown')
  503.             end
  504.     end
  505.     function nin_tool_check()
  506.             if (player.inventory[nin_tools[spell.english].tool] == nil  or player.inventory[nin_tools[spell.english].uni_tool] == nil)
  507.             and (player.inventory[nin_tools[spell.english].tool_bag] ~= nil or player.inventory[nin_tools[spell.english].uni_tool_bag] ~= nil) then
  508.                     return true
  509.             else
  510.                     add_to_chat(7,"No Tools Available To Cast "..spell.english)
  511.             end
  512.     end
  513.     function nin_tool_open()
  514.             if player.inventory[nin_tools[spell.english].tool_bag] ~= nil then
  515.                     return nin_tools[spell.english].tool_bag
  516.             elseif player.inventory[nin_tools[spell.english].uni_tool_bag] ~= nil then
  517.                     return nin_tools[spell.english].uni_tool_bag
  518.             end
  519.     end
  520.     function event_action(act)
  521.             action = Action(act)
  522.         if action:get_category_string() == 'item_finish' then
  523.             if action.raw.param == tbid and player.id == action.raw.actor_id then
  524.                             send_command('wait 1.0;input /ma "'..ninspells[nincount]..'" <me>')
  525.                             tbid = 0
  526.                     end
  527.         end
  528.     end
  529.     windower.raw_register_event('action', event_action)
  530.     function skill_capped(id, data, modified, injected, blocked)
  531.             if id == 0x062 then
  532.                     healingcap = data:unpack('q', 0xC4, 8)
  533.                     enhancingcap = data:unpack('q', 0xC6, 8)
  534.                     summoningcap = data:unpack('q', 0xCE, 8)
  535.                     ninjutsucap = data:unpack('q', 0xD0, 8)
  536.                     singingcap = data:unpack('q', 0xD2, 8)
  537.                     stringcap = data:unpack('q', 0xD4, 8)
  538.                     windcap = data:unpack('q', 0xD6, 8)
  539.                     bluecap = data:unpack('q', 0xD8, 8)
  540.                     geomancycap = data:unpack('q', 0xDA, 8)
  541.                     handbellcap = data:unpack('q', 0xDC, 8)
  542.             end
  543.             if id == 0x0DF then
  544.                     if data:unpack('I', 0x0D) == player.max_mp and skilluprun then
  545.                             windower.send_command('input /heal off')
  546.                     end
  547.             end
  548.     end
  549.     windower.raw_register_event('incoming chunk', skill_capped)
  550.  
  551. end
Advertisement
Add Comment
Please, Sign In to add comment