Item Search
     
BG-Wiki Search
Page 116 of 302 FirstFirst ... 66 106 114 115 116 117 118 126 166 ... LastLast
Results 2301 to 2320 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #2301
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Thanks guys! <3

  2. #2302
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Motenten View Post
    That information is out of date. What Arcon said is correct -- world.time gives you the number of minutes since midnight of the game day, as an integer. It is precise.
    so it would be
    Code:
    if world.time >= 360 and world.time <= 1080 then --360 is 6:00 and 1080 is 18:00
    	equip({ammo='Tengu-no-Hane'})
    end

  3. #2303
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    hi all im currently using kines cor lua i have not modified any rules or anything just the basic file. i was wondering if you could add in fire and dark day/weather rules for wildfire and leaden salute am trying to work a obi and zodiac ring into both weaponskills nothing i have tried has worked so far sence im a total noob any help would greatly appreciated.

  4. #2304
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    First, please try taking your classes in English writing and grammar seriously.

    Second, just add gear.ElementalObi (a variable, so not placed in quotes) as the waist item of the weaponskills in question. It will automatically set the obi if it matches the day or weather element of the action (weaponskill, in this case). Same for the ring, using gear.ElementalRing.

    If the day/weather does not match the element, it will default to using whatever gear you specify in the gear.default.obi_waist and gear.default.obi_ring variables. You can use whatever the defaults happen to be, or specify your own.

    Thus (aside from regular gear):

    gear.default.obi_waist = "Soil Gorget"
    gear.default.obi_ring = "Stormsoul Ring"
    sets.precast.WS.Wildfire = {waist=gear.ElementalObi, ring2=gear.ElementalRing}

  5. #2305
    Smells like Onions
    Join Date
    Jul 2014
    Posts
    1
    BG Level
    0
    FFXI Server
    Sylph
    WoW Realm
    Gorefiend

    I think I'm getting the hang of it now. Just now switching over to GearSwap from Spellcast.

    Spoiler: show

    Code:
    function get_sets()
    	sets.precast = {}
    	sets.precast.HundredFists = {
    		legs="Mel. Hose +2"
    	}
        sets.precast.Boost = {}
    	sets.precast.Counterstance = {
    		feet="Mel. Gaiters +1"
    	}
    	sets.precast.Dodge = {
    		feet="Anch. Gaiters"
    	}	
    	sets.precast.Focus = {
    		head="Temple Crown"
    	}
    	sets.precast.Mantra = {}
    	sets.precast.Waltz = {}
    	
    	sets.precast.Chakra = {
    		ammo="Tantra Tathlum",
    		head="Uk'uxkaj Cap",
    		neck="Tjukurrpa Medal",
    		ear1="Soil Pearl",
    		ear2="Soil Pearl",
    		body="Anchorite's Cyclas",
    		hands="Hesychast's Gloves",
    		ring1="Terrasoul Ring",
    		ring2="Terrasoul Ring",
    		back="Anchoret's Mantle",
    		waist="Warwolf Belt",
    		legs="Espial Hose",
    		feet="Thurandaut Boots"
    	}		 
    	
    	sets.precast['Victory Smite'] = {
    		ammo="Tantra Tathlum",
    		head="Uk'uxkaj Cap",
    		neck="Asperity Necklace",
    		ear1="Bladeborn Earring",
    		ear2="Steelflash Earring",
    		body="Espial Gambison",
    		hands="Otronif Gloves",
    		ring1="Epona's Ring",
    		ring2="Rajas Ring",
    		back="Atheling Mantle",
    		waist="Black Belt",
    		legs="Espial Hose",
    		feet="Espial Socks"
    	}
    	sets.precast['Shijin Spiral'] = {
    		ammo="Demonry Core",
    		head="Uk'uxkaj Cap",
    		neck="Flame Gorget",
    		ear1="Bladeborn Earring",
    		ear2="Steelflash Earring",
    		body="Espial Gambison",
    		hands="Espial Bracers",
    		ring1="Epona's Ring",
    		ring2="Jupiter's Ring",
    		back="Atheling Mantle",
    		waist="Light Belt",
    		legs="Manibozho Brais",
    		feet="Espial Socks"
    	}	
    	sets.precast.WS = sets.precast['Victory Smite']
    	
    	sets.TP = {}	
    	sets.TP.DD = {
    		ammo="Tantra Tathlum",
    		head="Uk'uxkaj Cap",
    		neck="Asperity Necklace",
    		ear1="Bladeborn Earring",
    		ear2="Steelflash Earring",
    		body="Thaumas Coat",
    		hands="Hesychast's Gloves",
    		ring1="Epona's Ring",
    		ring2="Rajas Ring",
    		back="Atheling Mantle",
    		waist="Windbuffet Belt",
    		legs="Manibozho Brais",
    		feet="Manibozho Boots"
    	}	
    	sets.TP.Acc = {}
    	sets.TP.Solo = {}
    	
    	sets.DT = {}
    	
    	sets.aftercast = {}
        sets.aftercast.TP = sets.TP.Acc
        
    	sets.aftercast.Idle = {
    		head="Ocelo. Headpiece",
    		body="Melee Cyclas",
    		hands="Hesychast's Gloves",
    		ring1="Paguroidea Ring",
    		ring2="Sheltered Ring",
    		feet="Hermes' Sandals"
    	}	
    	
    end
    
    function precast(spell)
        if player.equipment.head == 'Reraise Hairpin' then disable('head')
        else enable('head') end
        if player.equipment.left_ear == 'Reraise Earring' then disable('ear1')
        else enable('ear1') end
    	if player.equipment.right_ear == 'Reraise Earring' then disable('ear2')
        else enable('ear2') end
        if sets.precast[spell.english] then
            equip(sets.precast[spell.english])
        elseif spell.type=="WeaponSkill" then
            equip(sets.precast.WS)
        elseif string.find(spell.english,'Waltz') then
            equip(sets.precast.Waltz)
        end
    end
    
    function midcast(spell)
    end
    
    function aftercast(spell)
        if player.status =='Engaged' then
            equip(sets.aftercast.TP)
        else
            equip(sets.aftercast.Idle)
        end
    end
    
    function status_change(new,old)
        if T{'Idle','Resting'}:contains(new) then
            equip(sets.aftercast.Idle)
        elseif new == 'Engaged' then
            equip(sets.aftercast.TP)
        end
    end
    
    function self_command(command)
        if command == 'toggle TP set' then
            if sets.aftercast.TP == sets.TP.DD then
                sets.aftercast.TP = sets.TP.Solo
                send_command('@input /echo SOLO SET')
            elseif sets.aftercast.TP == sets.TP.Solo then
                sets.aftercast.TP = sets.TP.DD
                send_command('@input /echo DD SET')
            end
        elseif command == 'DT' then
            equip(sets.DT)
        end
    end


    I guess my only question at this point is with the following:

    Code:
    function self_command(command)
        if command == 'toggle TP set' then
            if sets.aftercast.TP == sets.TP.DD then
                sets.aftercast.TP = sets.TP.Solo
                send_command('@input /echo SOLO SET')
            elseif sets.aftercast.TP == sets.TP.Solo then
                sets.aftercast.TP = sets.TP.DD
                send_command('@input /echo DD SET')
            end
        elseif command == 'DT' then
            equip(sets.DT)
        end
    end
    I don't see the Accuracy set in that anywhere so how do I toggle back to that if I need to? Currently it defaults to Accuracy set when engaging then I type "//gs c toggle TP set" and it will switch between Solo and DD? Still kind of confused on how that part works but pretty sure I have everything else down for the most part.

    Granted, I was using Byth's monk lua as an example. I may just use a DD and Accuracy set which would make things easier I think.

    Also where would the Shadow Mantle for Chakra fit in?

    Thanks.

  6. #2306
    Sea Torques
    Join Date
    Aug 2008
    Posts
    699
    BG Level
    5
    FFXI Server
    Odin

    Having a hard time getting everything in this gs to work properly. Was first having problems with healing/restoring breath staying on until the breath actually goes off, then got that working, but now my gear doesnt swap back to my tp/idle set after using ja's like jump or spirit link. Had a few people look over it, but they dont know/care enough about drg to fix it. Any ideas what i can do to fix this? Seems like this is a pain because there is a delay on wyvern breath activation and its not a instant proc of gear i suppose. Thanks

    Code:
    -- *** Credit goes to Flippant & Martel for helping me with this Gearswap *** --
    -- ** I Use Some of Motenten's Functions ** --
    -- Last Updated: 05/03/14 7:30 AM *Changed HB Rule* --
     
    function get_sets()
            AccIndex = 1
            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. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
            AttIndex = 1
            AttArray = {"LowATT","HighATT","LowContent"} -- LowATT Is The Same As LowACC Set. MidACC & HighACC Take Priority Over These 2 Sets(HighATT & LowContent). --
            IdleIndex = 1
            IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
            Armor = 'None'
            Twilight = 'None'
            Rancor = 'OFF' -- Set Default Rancor ON or OFF Here --
            Brais = 'OFF' -- Set Default Brais ON or OFF Here --
            Samurai_Roll = 'OFF' -- Set Default SAM Roll ON or OFF Here --
            target_distance = 5 -- Set Default Distance Here --
            select_default_macro_book() -- Change Default Macro Book At The End --
     
            NM_For_Brais = S{} -- Add More NM Here For High Jump --
     
            HB_Mage_SubJob = S{"WHM","RDM","BLM","BLU","SCH"} -- 50% Healing Breath Trigger SubJob --
            HB_DD_SubJob = S{"PLD","DRK","BRD","NIN"} -- 33% Healing Breath Trigger SubJob --
            sc_map = {SC1="Drakesbane", SC2="SpiritJump", SC3="SoulJump"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
     
            sets.Idle = {}
            -- Idle/Town Sets --
            sets.Idle.Regen = {
                            ammo="Ginsen",
                            head="Twilight Helm",
                            neck="Wiglen Gorget",
                            ear1="Brutal Earring",
                            ear2="Sanare Earring",
                            body="Ares' Cuirass +1",
                            hands="Xaddi Gauntlets",
                            ring1="Sheltered Ring",
                            ring2="Paguroidea Ring",
                            back="Shadow Mantle",
                            waist="Flume Belt",
                            legs="Crimson Cuisses",
                            feet="Phorcys Schuhs"}
            sets.Idle.Movement = set_combine(sets.Idle.Regen,{
                            ammo="Ginsen",
                            head="Twilight Helm",
                            neck="Wiglen Gorget",
                            ear1="Brutal Earring",
                            ear2="Sanare Earring",
                            body="Ares' Cuirass +1",
                            hands="Cizin Mufflers +1",
                            ring1="Sheltered Ring",
                            ring2="Paguroidea Ring",
                            back="Shadow Mantle",
                            waist="Flume Belt",
                            legs="Crimson Cuisses",
                        feet="Gorney Sollerets +1"})
            sets.Idle.Refresh = set_combine(sets.Idle.Regen,{
                            ammo="Ginsen",
                            head="Twilight Helm",
                            neck="Wiglen Gorget",
                            ear1="Black Earring",
                            ear2="Dawn Earring",
                            body="Ares' Cuirass +1",
                            hands="Xaddi Gauntlets",
                            ring1="Sheltered Ring",
                            ring2="Paguroidea Ring",
                            back="Shadow Mantle",
                            waist="Nierenschutz",
                            legs="Crimson Cuisses",
                            feet="Gorney Sollerets +1"})
     
            sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
     
            -- TP Base Set --
            sets.TP = {}
     
            -- Ryunohige(AM3 Down) TP Sets --
            sets.TP.Ryunohige = {
                            main="Ryunohige",
                            sub="Bloodrain Strap",
                            ammo="Ginsen",
                            head="Otomi Helm",
                            neck="Ganesha's Mala",
                            ear1="Brutal Earring",
                            ear2="Tripudio Earring",
                            body="Xaddi Mail",
                            hands="Xaddi Gauntlets",
                            ring1="K'ayres Ring",
                            ring2="Rajas Ring",
                            back="Atheling Mantle",
                            waist="Windbuffet Belt",
                            legs="Xaddi Cuisses",
                            feet="Huginn Gambieras"}
            sets.TP.Ryunohige.MidACC = set_combine(sets.TP.Ryunohige,{
                            head="Yaoyotl Helm",
                            back="Letalis Mantle",
                            waist="Dynamic Belt +1"})
            sets.TP.Ryunohige.HighACC = set_combine(sets.TP.Ryunohige.MidACC,{
                            neck="Iqabi Necklace",
                            feet="Mikinaak Greaves",
                            ring1="Patricius Ring"})
     
            -- Ryunohige(AM3 Up) TP Sets --
            sets.TP.Ryunohige.AM3 = set_combine(sets.TP.Ryunohige,{
                            head="Yaoyotl Helm",
                            waist="Goading Belt"})
            sets.TP.Ryunohige.MidACC.AM3 = set_combine(sets.TP.Ryunohige.AM3,{
                            back="Letalis Mantle",
                            waist="Dynamic Belt +1"})
            sets.TP.Ryunohige.HighACC.AM3 = set_combine(sets.TP.Ryunohige.MidACC.AM3,{
                            neck="Iqabi Necklace",
                            feet="Mikinaak Greaves",
                            ring1="Patricius Ring"})
     
            -- Ryunohige(AM3 Down: Ionis) TP Sets --
            sets.TP.Ryunohige.Ionis = set_combine(sets.TP.Ryunohige,{})
            sets.TP.Ryunohige.MidACC.Ionis = set_combine(sets.TP.Ryunohige.Ionis,{})
            sets.TP.Ryunohige.HighACC.Ionis = set_combine(sets.TP.Ryunohige.MidACC.Ionis,{})
     
            -- Ryunohige(AM3 Up: Ionis) TP Sets --
            sets.TP.Ryunohige.AM3.Ionis = set_combine(sets.TP.Ryunohige.AM3,{})
            sets.TP.Ryunohige.MidACC.AM3.Ionis = set_combine(sets.TP.Ryunohige.AM3.Ionis,{})
            sets.TP.Ryunohige.HighACC.AM3.Ionis = set_combine(sets.TP.Ryunohige.MidACC.AM3.Ionis,{})
     
            -- Ryunohige(AM3 Down: SAM Roll) TP Sets --
            sets.TP.Ryunohige.STP = set_combine(sets.TP.Ryunohige,{})
            sets.TP.Ryunohige.MidACC.STP = set_combine(sets.TP.Ryunohige.STP,{})
            sets.TP.Ryunohige.HighACC.STP = set_combine(sets.TP.Ryunohige.MidACC.STP,{})
     
            -- Ryunohige(AM3 Up: SAM Roll) TP Sets --
            sets.TP.Ryunohige.AM3.STP =  set_combine(sets.TP.Ryunohige.AM3,{})
            sets.TP.Ryunohige.MidACC.AM3.STP = set_combine(sets.TP.Ryunohige.AM3.STP,{})
            sets.TP.Ryunohige.HighACC.AM3.STP = set_combine(sets.TP.Ryunohige.MidACC.AM3.STP,{})
     
            -- Ryunohige(AM3 Down: Ionis + SAM Roll) TP Sets --
            sets.TP.Ryunohige.Ionis.STP =  set_combine(sets.TP.Ryunohige.Ionis,{})
            sets.TP.Ryunohige.MidACC.Ionis.STP = set_combine(sets.TP.Ryunohige.Ionis.STP,{})
            sets.TP.Ryunohige.HighACC.Ionis.STP = set_combine(sets.TP.Ryunohige.MidACC.Ionis.STP,{})
     
            -- Ryunohige(AM3 Up: Ionis + SAM Roll) TP Sets --
            sets.TP.Ryunohige.AM3.Ionis.STP =  set_combine(sets.TP.Ryunohige.AM3.Ionis,{})
            sets.TP.Ryunohige.MidACC.AM3.Ionis.STP = set_combine(sets.TP.Ryunohige.AM3.Ionis.STP,{})
            sets.TP.Ryunohige.HighACC.AM3.Ionis.STP = set_combine(sets.TP.Ryunohige.MidACC.AM3.Ionis.STP,{})
     
            -- Gungnir TP Sets --
            sets.TP.Gungnir = {main="Gungnir",
                            sub="Bloodrain Strap",
                            ammo="Ginsen",
                            head="Otomi Helm",
                            neck="Ganesha's Mala",
                            ear1="Brutal Earring",
                            ear2="Tripudio Earring",
                            body="Xaddi Mail",
                            hands="Xaddi Gauntlets",
                            ring1="K'ayres Ring",
                            ring2="Rajas Ring",
                            back="Atheling Mantle",
                            waist="Goading Belt",
                            legs="Xaddi Cuisses",
                            feet="Huginn Gambieras"}
            sets.TP.Gungnir.MidACC = set_combine(sets.TP.Gungnir,{head="Yaoyotl Helm",
                            back="Letalis Mantle",
                            waist="Dynamic Belt +1"})
            sets.TP.Gungnir.HighACC = set_combine(sets.TP.Gungnir.MidACC,{neck="Iqabi Necklace",
                            feet="Mikinaak Greaves",
                            ring1="Patricius Ring"})
     
            -- Gungnir(Ionis) TP Sets --
            sets.TP.Gungnir.Ionis = set_combine(sets.TP.Gungnir,{})
            sets.TP.Gungnir.MidACC.Ionis = set_combine(sets.TP.Gungnir.Ionis,{})
            sets.TP.Gungnir.HighACC.Ionis = set_combine(sets.TP.Gungnir.MidACC.Ionis,{})
     
            -- Gungnir(SAM Roll) TP Sets --
            sets.TP.Gungnir.STP = set_combine(sets.TP.Gungnir,{})
            sets.TP.Gungnir.MidACC.STP = set_combine(sets.TP.Gungnir.MidACC,{})
            sets.TP.Gungnir.HighACC.STP = set_combine(sets.TP.Gungnir.HighACC,{})
     
            -- Gungnir(Ionis + SAM Roll) TP Sets --
            sets.TP.Gungnir.Ionis.STP = set_combine(sets.TP.Gungnir.Ionis,{})
            sets.TP.Gungnir.MidACC.Ionis.STP = set_combine(sets.TP.Gungnir.Ionis.STP,{})
            sets.TP.Gungnir.HighACC.Ionis.STP = set_combine(sets.TP.Gungnir.MidACC.Ionis.STP,{})
     
            -- Rhongomiant TP Sets --
            sets.TP.Rhongomiant = {}
            sets.TP.Rhongomiant.MidACC = set_combine(sets.TP.Rhongomiant,{})
            sets.TP.Rhongomiant.HighACC = set_combine(sets.TP.Rhongomiant.MidACC,{})
     
            -- Rhongomiant(Ionis) TP Sets --
            sets.TP.Rhongomiant.Ionis = set_combine(sets.TP.Rhongomiant,{})
            sets.TP.Rhongomiant.MidACC.Ionis = set_combine(sets.TP.Rhongomiant.Ionis,{})
            sets.TP.Rhongomiant.HighACC.Ionis = set_combine(sets.TP.Rhongomiant.MidACC.Ionis,{})
     
            -- Rhongomiant(SAM Roll) TP Sets --
            sets.TP.Rhongomiant.STP = set_combine(sets.TP.Rhongomiant,{})
            sets.TP.Rhongomiant.MidACC.STP = set_combine(sets.TP.Rhongomiant.MidACC,{})
            sets.TP.Rhongomiant.HighACC.STP = set_combine(sets.TP.Rhongomiant.HighACC,{})
     
            -- Rhongomiant(Ionis + SAM Roll) TP Sets --
            sets.TP.Rhongomiant.Ionis.STP = set_combine(sets.TP.Rhongomiant.Ionis,{})
            sets.TP.Rhongomiant.MidACC.Ionis.STP = set_combine(sets.TP.Rhongomiant.Ionis.STP,{})
            sets.TP.Rhongomiant.HighACC.Ionis.STP = set_combine(sets.TP.Rhongomiant.MidACC.Ionis.STP,{})
     
            -- Upukirex TP Sets --
            sets.TP.Upukirex = {}
            sets.TP.Upukirex.MidACC = set_combine(sets.TP.Upukirex,{})
            sets.TP.Upukirex.HighACC = set_combine(sets.TP.Upukirex.MidACC,{})
     
            -- Upukirex(Ionis) TP Sets --
            sets.TP.Upukirex.Ionis = set_combine(sets.TP.Upukirex,{})
            sets.TP.Upukirex.MidACC.Ionis = set_combine(sets.TP.Upukirex.Ionis,{})
            sets.TP.Upukirex.HighACC.Ionis = set_combine(sets.TP.Upukirex.MidACC.Ionis,{})
     
            -- Upukirex(SAM Roll) TP Sets --
            sets.TP.Upukirex.STP = set_combine(sets.TP.Upukirex,{})
            sets.TP.Upukirex.MidACC.STP = set_combine(sets.TP.Upukirex.MidACC,{})
            sets.TP.Upukirex.HighACC.STP = set_combine(sets.TP.Upukirex.HighACC,{})
     
            -- Upukirex(Ionis + SAM Roll) TP Sets --
            sets.TP.Upukirex.Ionis.STP = set_combine(sets.TP.Upukirex.Ionis,{})
            sets.TP.Upukirex.MidACC.Ionis.STP = set_combine(sets.TP.Upukirex.Ionis.STP,{})
            sets.TP.Upukirex.HighACC.Ionis.STP = set_combine(sets.TP.Upukirex.MidACC.Ionis.STP,{})
     
            -- AM3 Rancor ON Mantle --
            sets.TP.Rancor = {back="Rancorous Mantle"}
     
            -- PDT/MDT Sets --
            sets.PDT = {
                            head="Ighwa Cap",
                            neck="Twilight Torque",
                            ear1="Brutal Earring",
                            ear2="Sanare Earring",
                            body="Xaddi Mail",
                            hands="Cizin Mufflers +1",
                            ring1="Patricius Ring",
                            ring2="Defending Ring",
                            back="Mollusca Mantle",
                            waist="Flume Belt",
                            legs="Cizin Breeches +1",
                            feet="Gorney Sollerets +1"}
     
            sets.MDT = set_combine(sets.PDT,{
                            ammo="Demonry Stone",
                            head="Ogier's Helm",
                            ear1="Merman's Earring",
                            ear2="Sanare Earring",
                            ring1="Shadow Ring",
                            ring2="Defending Ring",
                            waist="Nierenschutz",
                            back="Mubvumbamiri Mantle"})
     
            -- Hybrid Sets --
            sets.TP.Hybrid = set_combine(sets.PDT,{
                            head="Ighwa Cap",
                            neck="Twilight Torque",
                            ear1="Brutal Earring",
                            ear2="Tripudio Earring",
                            body="Xaddi Mail",
                            hands="Cizin Mufflers +1",
                            ring1="Patricius Ring",
                            ring2="Dark Ring",
                            back="Shadow Mantle",
                            waist="Dynamic Belt +1",
                            legs="Xaddi Cuisses",
                            feet="Mikinaak Greaves",})
            sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
            sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
     
     
            -- WS Base Set --
            sets.WS = {ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Flame Gorget",
                            ear1="Steelflash Earring",
                            ear2="Bladeborn Earring",
                            body="Miki.Breastplate",
                            hands="Mikinaak Gauntlets",
                            ring2="Rajas Ring",
                            ring1="Pyrosoul Ring",
                            back="Rancorous Mantle",
                            waist="Windbuffet Belt",
                            legs="Scuff. COsciales",
                            feet="Huginn Gambieras"}
     
            -- WS Sets --
            sets.WS.Drakesbane = {
                            ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Flame Gorget",
                            ear1="Brutal Earring",
                            ear2="Moonshade Earring",
                            body="Gorney Haubert +1",
                            hands="Mikinaak Gauntlets",
                            ring2="Rajas Ring",
                            ring1="Pyrosoul Ring",
                            back="Rancorous Mantle",
                            waist="Flame Belt",
                            legs="Scuff. Cosciales",
                            feet="Huginn Gambieras"}
            sets.WS.Drakesbane.MidACC = set_combine(sets.WS.Drakesbane,{
                            ammo="Ginsen",
                            head="Yaoyotl Helm",
                            back="Letalis Mantle",})
            sets.WS.Drakesbane.HighACC = set_combine(sets.WS.Drakesbane.MidACC,{
                            legs="Miki. Cuisses"})
     
            -- Drakesbane(Low Level Content) Set --
            sets.WS.Drakesbane.LowContent = set_combine(sets.WS.Drakesbane,{})
            -- Drakesbane(High Attack) Set --
            sets.WS.Drakesbane.HighATT = set_combine(sets.WS.Drakesbane,{})
     
            sets.WS.Stardiver = {ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Shadow Gorget",
                            ear1="Brutal Earring",
                            ear2="Moonshade Earring",
                            body="Gorney Haubert +1",
                            hands="Mikinaak Gauntlets",
                            ring2="Rajas Ring",
                            ring1="Pyrosoul Ring",
                            back="Buquwik Cape",
                            waist="Shadow Belt",
                            legs="Scuff. Cosciales",
                            feet="Mikinaak Greaves"}
            sets.WS.Stardiver.MidACC = set_combine(sets.WS.Stardiver,{})
            sets.WS.Stardiver.HighACC = set_combine(sets.WS.Stardiver.MidACC,{})
     
            -- Stardiver(High Attack) Set --
            sets.WS.Stardiver.HighATT = set_combine(sets.WS.Stardiver,{})
           
            sets.WS["Camlann's Torment"] = {ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Breeze Gorget",
                            ear1="Brutal Earring",
                            ear2="Moonshade Earring",
                            body="Phorcys Korazin",
                            hands="Mikinaak Gauntlets",
                            ring2="Spiral Ring",
                            ring1="Pyrosoul Ring",
                            back="Buquwik Cape",
                            waist="Caudata Belt",
                            legs="Scuff. Cosciales",
                            feet="Ejekamal Boots"}
            sets.WS["Camlann's Torment"].MidACC = set_combine(sets.WS.Stardiver,{})
            sets.WS["Camlann's Torment"].HighACC = set_combine(sets.WS.Stardiver.MidACC,{})
           
           
            sets.WS["Sonic Thrust"] = {ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Ganesha's Mala",
                            ear1="Brutal Earring",
                            ear2="Moonshade Earring",
                            body="Phorcys Korazin",
                            hands="Mikinaak Gauntlets",
                            ring2="Spiral Ring",
                            ring1="Pyrosoul Ring",
                            back="Buquwik Cape",
                            waist="Cuadata Belt",
                            legs="Scuff. Cosciales",
                            feet="Ejekamal boots"}
            sets.WS["Sonic Thrust"].MidACC = set_combine(sets.WS.Stardiver,{})
            sets.WS["Sonic Thrust"].HighACC = set_combine(sets.WS.Stardiver.MidACC,{})
           
            sets.WS.Geirskogul = {ammo="Thew Bomblet",
                            head="Otomi Helm",
                            neck="Snow Gorget",
                            ear1="Brutal Earring",
                            ear2="Moonshade Earring",
                            body="Phorcys Korazin",
                            hands="Mikinaak Gauntlets",
                            ring2="Rajas Ring",
                            ring1="Pyrosoul Ring",
                            back="Atheling Cape",
                            waist="Snow Belt",
                            legs="Scuff. Cosciales",
                            feet="Ejekamal Boots"}
            sets.WS.Geirskogul.MidACC = set_combine(sets.WS.Geirskogul,{})
            sets.WS.Geirskogul.HighACC = set_combine(sets.WS.Geirskogul.MidACC,{})
           
           
     
            -- JA Sets --
            sets.JA = {}
            sets.JA.Jump = {
                            ammo="Ginsen",
                            head="Otomi Helm",
                            neck="Ganesha's Mala",
                            ear1="Brutal Earring",
                            ear2="Tripudio Earring",
                            body="Xaddi Mail",
                            hands="Xaddi Gauntlets",
                            ring1="K'ayres Ring",
                            ring2="Rajas Ring",
                            back="Atheling Mantle",
                            waist="Windbuffet Belt",
                            legs="Lncr. Cuissots +2",
                            feet="Huginn Gambieras"}
            sets.JA.Jump.MidACC = set_combine(sets.JA.Jump,{
                            head="Yaoyotl Helm",
                            ear1="Steelflash Earring",
                            ear2="Bladeborn Earring",
                            back="Letalis Mantle",
                            waist="Anguinus Belt",})
            sets.JA.Jump.HighACC = set_combine(sets.JA.Jump.MidACC,{
                            neck="Iqabi Necklace",
                            body="Miki. Breastplate",
                            legs="Miki. Cuisses"})
     
            sets.JA["High Jump"] = set_combine(sets.JA.Jump,{legs="Wyrm Brais +2"})
            sets.JA["High Jump"].MidACC = set_combine(sets.JA.Jump.MidACC,{})
            sets.JA["High Jump"].HighACC = set_combine(sets.JA.Jump.HighACC,{})
     
            sets.JA["Spirit Jump"] = set_combine(sets.JA.Jump,{
                            feet="Lncr. Schynbld. +2"})
            sets.JA["Spirit Jump"].MidACC = set_combine(sets.JA["Spirit Jump"],{
                            head="Yaoyotl Helm",
                            ear1="Steelflash Earring",
                            ear2="Bladeborn Earring",
                            hands="Xaddi Gauntlets",
                            back="Letalis Mantle",
                            waist="Anguinus Belt"})
            sets.JA["Spirit Jump"].HighACC = set_combine(sets.JA["Spirit Jump"].MidACC,{
                            body="Miki. Breastplate",
                            legs="Miki. Cuisses",
                            neck="Iqabi Necklace"})
     
            sets.JA["Soul Jump"] = set_combine(sets.JA.Jump,{legs="Lancer's cuissots +2"})
            sets.JA["Soul Jump"].MidACC = set_combine(sets.JA.Jump.MidACC,{})
            sets.JA["Soul Jump"].HighACC = set_combine(sets.JA.Jump.HighACC,{})
     
            sets.JA.Angon = {ammo="Angon",ear1="Dragoon's Earring",hands="Pteroslaver Finger Gauntlets"}
            sets.JA["Ancient Circle"] = {"Vishap Brais"}
            sets.JA['Call Wyvern'] = {body="Pteroslaver Mail"}
            sets.JA['Spirit Surge'] = {body="Pteroslaver Mail"}
            sets.JA['Spirit Link'] = {head="Drachen Armet",
            hands="Lncr. Vmbrc. +2",
            feet="Pteroslaver Greaves"}
     
            sets.Pet = {}
            sets.Pet.WyvernHP = {
                            head="Pteroslaver Armet",
                            neck="Lancer's Torque",
                            body="Wyvern Mail",
                            back="Updraft Mantle",
                            ear1="Dragoon's Earring",
                            ear2="Onieros earring",
                            ring1="Kunaji ring",
                            waist="Glassblower's Belt",
                            legs="Vishap Brais",
                            feet="Pteroslaver Greaves"}
     
            sets.JA["Spirit Link"] = set_combine(sets.Pet.WyvernHP,{head="Drachen Armet",hands="Lncr. Vmbrc. +2",feet="Pteroslaver Greaves"})
            sets.Pet["Restoring Breath"] = set_combine(sets.Pet.WyvernHP)
            sets.Pet["Smiting Breath"] = set_combine(sets.Pet.WyvernHP)
            sets.Pet["Steady Wing"] = set_combine(sets.Pet.WyvernHP)
     
            -- Healing Breath Trigger --
            sets.HealingBreathTrigger = set_combine(sets.Pet.WyvernHP,{
                            head="Drachen Armet",
                            body="Gorney Haubert +1",
                            hands="Xaddi Gauntlets",
                            ring1="K'ayres Ring",
                            ring2="Meridian Ring",
                            back="Strendu Mantle",
                            legs="Osmium Cuisses",
                            feet="Gorney Sollerets +1"})
     
            -- Waltz Set --
            sets.Waltz = {}
     
            sets.Precast = {}
            -- Fastcast Set --
            sets.Precast.FastCast = {ear1="Loquac. Earring",head="Cizin Helm +1",
                            legs="Enif Cosciales",ring1="Prolix ring",hands="Buremte Gloves"}
     
            sets.Midcast = {}
            -- Magic Haste Set --
            sets.Midcast.Haste = set_combine(sets.PDT,{})
    end
     
    function pretarget(spell,action)
            if (spell.type:endswith('Magic') or spell.type == 'BardSong' or spell.type == 'Ninjutsu') and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
                    cancel_spell()
                    send_command('input /item "Echo Drops" <me>')
            elseif spell.english == "Spirit Jump" and not pet.isvalid then -- Change Spirit Jump To Jump If Wyvern Is Not Present --
                    cancel_spell()
                    send_command('Jump')
            elseif spell.english == "Soul Jump" and not pet.isvalid then -- Change Soul Jump To High Jump If Wyvern Is Not Present --
                    cancel_spell()
                    send_command('HighJump')
            elseif spell.english == "Dismiss" and pet.hpp < 100 then -- Cancel Dismiss If Wyvern's HP Is Under 100% --
                    cancel_spell()
                    add_to_chat(123, spell.english .. ' Canceled: [' .. pet.hpp .. ']')
                    return
            elseif spell.english =="Call Wyvern" and pet.isvalid then -- Change Call Wyvern To Dismiss If Wyvern Is Present --
                    cancel_spell()
                    send_command('Dismiss')
            elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
                    cancel_spell()
                    send_command('Aggressor')
            elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
                    cancel_spell()
                    send_command('ThirdEye')
            elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
                    cancel_spell()
                    add_to_chat(123, spell.name..' Canceled: [Out of Range]')
                    return
            end
    end
     
    function precast(spell,action)
            if spell.english == 'Ranged' then
                    equip({ammo="Pebble"})
            elseif spell.type == "WeaponSkill" then
                    if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
                            cancel_spell()
                            add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
                            return
                    else
                            equipSet = sets.WS
                            if equipSet[spell.english] then
                                    equipSet = equipSet[spell.english]
                            end
                            if equipSet[AccArray[AccIndex]] then
                                    equipSet = equipSet[AccArray[AccIndex]]
                            end
                            if equipSet[AttArray[AttIndex]] then
                                    equipSet = equipSet[AttArray[AttIndex]]
                            end
                            if spell.english == "Drakesbane" and string.find(spell.target.name,'Dynamis Lord') then -- Equip Phorcys Korazin When You Use Drakesbane On DL & ADL --
                                    equipSet = set_combine(equipSet,{body="Phorcys Korazin"})
                            end
                            equip(equipSet)
                    end
            elseif spell.type == "JobAbility" then
                    equipSet = sets.JA
                    if equipSet[spell.english] then
                            equipSet = equipSet[spell.english]
                    end
                    if equipSet[AccArray[AccIndex]] then
                            equipSet = equipSet[AccArray[AccIndex]]
                    end
                    if spell.english == "High Jump" and NM_For_Brais:contains(spell.target.name) and Brais == 'ON' then -- Use Vishap Brais +1 Toggle To Equip Vishap Brais +1 For High Jump --
                            equipSet = set_combine(equipSet,{legs="Vishap Brais"})
                    end
                    equip(equipSet)
            elseif spell.type:endswith('Magic') or spell.type == 'Ninjutsu' or spell.type == 'BardSong' then
                    if buffactive.silence or spell.target.distance > 16+target_distance then
                            cancel_spell()
                            add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
                            return
                    else
                            if string.find(spell.english,'Utsusemi') then
                                    if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
                                            cancel_spell()
                                            add_to_chat(123,'Utsusemi Canceled: [3+ Images]')
                                            return
                                    else
                                            equip(sets.Precast.FastCast)
                                    end
                            else
                                    equip(sets.Precast.FastCast)
                            end
                    end
            elseif spell.type == "Waltz" then
                    refine_waltz(spell,action)
                    equip(sets.Waltz)
            elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
                    cast_delay(0.2)
                    send_command('cancel Sneak')
            elseif spell.type == "PetCommand" then
                    equip(sets.Pet[spell.english])
            end
            if Twilight == 'Twilight' then
                    equip(sets.Twilight)
            end
    end
     
    function midcast(spell,action)
            if spell.english == 'Ranged' then
                    equip({ammo="Pebble"})
            elseif spell.type:endswith('Magic') or spell.type == 'BardSong' or spell.type == 'Ninjutsu' then
                    if string.find(spell.english,'Utsusemi') then
                            if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
                                    send_command('@wait 1.7;cancel Copy Image*')
                            end
                            equip(sets.Midcast.Haste)
                    elseif spell.english == 'Monomi: Ichi' then
                            if buffactive['Sneak'] then
                                    send_command('@wait 1.7;cancel sneak')
                            end
                            equip(sets.Midcast.Haste)
                    elseif HB_Mage_SubJob:contains(player.sub_job) and player.hpp < 61 and pet.isvalid then
                            equip(sets.HealingBreathTrigger)
                    elseif HB_DD_SubJob:contains(player.sub_job) and player.hpp < 34 and pet.isvalid then
                            equip(sets.HealingBreathTrigger)
                    else
                            equip(sets.Midcast.Haste)
                    end
            end
    end
     
    function aftercast(spell,action)
            if not spell.interrupted then
                    if spell.type == "WeaponSkill" then
                            send_command('wait 0.2;gs c TP')
                    elseif string.find(spell.english,'Jump') then
                            send_command('wait 0.2;gs c TP')
                    elseif spell.english == "Angon" then -- Angon Timer/Countdown --
                            timer_angon()
                            send_command('wait 80;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;timers delete "Angon";input /p '..spell.name..': [OFF]')
                    elseif spell.english == "Ancient Circle" then -- Ancient Circle Countdown --
                            send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
                    end
            elseif not string.find(spell.english,'Healing Breath') then
                    status_change(player.status)
            end
    end
     
    function status_change(new,old)
            if Armor == 'PDT' then
                    equip(sets.PDT)
            elseif Armor == 'MDT' then
                    equip(sets.MDT)
            elseif new == 'Engaged' then
                    equipSet = sets.TP
                    if Armor == 'Hybrid' and equipSet["Hybrid"] then
                            equipSet = equipSet["Hybrid"]
                    end
                    if equipSet[player.equipment.main] then
                            equipSet = equipSet[player.equipment.main]
                    end
                    if equipSet[AccArray[AccIndex]] then
                            equipSet = equipSet[AccArray[AccIndex]]
                    end
                    if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
                            if Rancor == 'ON' then -- Default Rancor Toggle Is Rancorous Mantle --
                                    equipSet = set_combine(equipSet["AM3"],sets.TP.Rancor)
                            else -- Use Rancor Toggle For Atheling Mantle --
                                    equipSet = equipSet["AM3"]
                            end
                    end
                   
                    equip(equipSet)
            else
                    equip(sets.Idle[IdleArray[IdleIndex]])
            end
            if Twilight == 'Twilight' then
                    equip(sets.Twilight)
            end
    end
     
    function buff_change(buff,gain)
            buff = string.lower(buff)
            if buff == "aftermath: lv.3" then -- AM3 Timer --
                    if gain then
                            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.]')
                    else
                            send_command('timers delete "Aftermath: Lv.3"')
                            add_to_chat(123,'AM3: [OFF]')
                    end
            elseif buff == 'weakness' then -- Weakness Timer --
                    if gain then
                            send_command('timers create "Weakness" 300 up')
                    else
                            send_command('timers delete "Weakness"')
                    end
            end
            if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
                    equip({neck="Berserker's Torque"})
            else
                    if not midaction() and not pet_midaction() then
                            status_change(player.status)
                    end
            end
    end
     
    function pet_midcast(spell,action)
            if string.find(spell.english,'Healing Breath') then
                    equip(sets.Pet["Restoring Breath"])
            end
    end
     
    function pet_aftercast(spell,action)
            status_change(player.status)
    end
     
    function pet_change(pet,gain)
            status_change(player.status)
    end
     
    -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
    function self_command(command)
            if command == 'C1' then -- Accuracy Level Toggle --
                    AccIndex = (AccIndex % #AccArray) + 1
                    add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
                    status_change(player.status)
            elseif command == 'C9' then -- Attack Toggle --
                    AttIndex = (AttIndex % #AttArray) + 1
                    add_to_chat(158,'Attack Level: '..AttArray[AttIndex])
                    status_change(player.status)
            elseif command == 'C5' then -- Auto Update Gear Toggle --
                    status_change(player.status)
                    add_to_chat(158,'Auto Update Gear')
            elseif command == 'C2' then -- Hybrid Toggle --
                    if Armor == 'Hybrid' then
                            Armor = 'None'
                            add_to_chat(123,'Hybrid Set: [Unlocked]')
                    else
                            Armor = 'Hybrid'
                            add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
                    end
                    status_change(player.status)
            elseif command == 'C7' then -- PDT Toggle --
                    if Armor == 'PDT' then
                            Armor = 'None'
                            add_to_chat(123,'PDT Set: [Unlocked]')
                    else
                            Armor = 'PDT'
                            add_to_chat(158,'PDT Set: [Locked]')
                    end
                    status_change(player.status)
            elseif command == 'C15' then -- MDT Toggle --
                    if Armor == 'MDT' then
                            Armor = 'None'
                            add_to_chat(123,'MDT Set: [Unlocked]')
                    else
                            Armor = 'MDT'
                            add_to_chat(158,'MDT Set: [Locked]')
                    end
                    status_change(player.status)
            elseif command == 'C16' then -- Rancor Toggle --
                    if Rancor == 'ON' then
                            Rancor = 'OFF'
                            add_to_chat(123,'Rancor: [OFF]')
                    else
                            Rancor = 'ON'
                            add_to_chat(158,'Rancor: [ON]')
                    end
                    status_change(player.status)
            elseif command == 'C10' then -- Vishap Brais +1 Toggle --
                    if Brais == 'ON' then
                            Brais = 'OFF'
                            add_to_chat(123,'Vishap Brais +1: [OFF]')
                    else
                            Brais = 'ON'
                            add_to_chat(158,'Vishap Brais +1: [ON]')
                    end
                    status_change(player.status)
            elseif command == 'C17' then -- SAM Roll Toggle --
                    if Samurai_Roll == 'ON' then
                            Samurai_Roll = 'OFF'
                            add_to_chat(123,'SAM Roll: [OFF]')
                    else
                            Samurai_Roll = 'ON'
                            add_to_chat(158,'SAM Roll: [ON]')
                    end
                    status_change(player.status)
            elseif command == 'C3' then -- Twilight Toggle --
                    if Twilight == 'Twilight' then
                            Twilight = 'None'
                            add_to_chat(123,'Twilight Set: [Unlocked]')
                    else
                            Twilight = 'Twilight'
                            add_to_chat(158,'Twilight Set: [locked]')
                    end
                    status_change(player.status)
            elseif command == 'C8' then -- Distance Toggle --
                    if player.target.distance then
                            target_distance = math.floor(player.target.distance*10)/10
                            add_to_chat(158,'Distance: '..target_distance)
                    else
                            add_to_chat(123,'No Target Selected')
                    end
            elseif command == 'C6' then -- Idle Toggle --
                    IdleIndex = (IdleIndex % #IdleArray) + 1
                    add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
                    status_change(player.status)
            elseif command == 'TP' then
                    add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
            elseif command:match('^SC%d$') then
                    send_command('//' .. sc_map[command])
            end
    end
     
    function timer_angon()
            local duration = 90
            send_command('timers create "Angon" '..tostring(duration)..' down')
    end
     
    function refine_waltz(spell,action)
            if spell.type ~= 'Waltz' then
                    return
            end
     
            if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
                    return
            end
     
            local newWaltz = spell.english
            local waltzID
     
            local missingHP
     
            if spell.target.type == "SELF" then
                    missingHP = player.max_hp - player.hp
            elseif spell.target.isallymember then
                    local target = find_player_in_alliance(spell.target.name)
                    local est_max_hp = target.hp / (target.hpp/100)
                    missingHP = math.floor(est_max_hp - target.hp)
            end
     
            if missingHP ~= nil then
                    if player.sub_job == 'DNC' then
                            if missingHP < 40 and spell.target.name == player.name then
                                    add_to_chat(123,'Full HP!')
                                    cancel_spell()
                                    return
                            elseif missingHP < 150 then
                                    newWaltz = 'Curing Waltz'
                                    waltzID = 190
                            elseif missingHP < 300 then
                                    newWaltz = 'Curing Waltz II'
                                    waltzID = 191
                            else
                                    newWaltz = 'Curing Waltz III'
                                    waltzID = 192
                            end
                    else
                            return
                    end
            end
     
            local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50, ['Curing Waltz IV'] = 65, ['Curing Waltz V'] = 80}
            local tpCost = waltzTPCost[newWaltz]
     
            local downgrade
     
            if player.tp < tpCost and not buffactive.trance then
     
                    if player.tp < 20 then
                            add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
                            cancel_spell()
                            return
                    elseif player.tp < 35 then
                            newWaltz = 'Curing Waltz'
                    elseif player.tp < 50 then
                            newWaltz = 'Curing Waltz II'
                    elseif player.tp < 65 then
                            newWaltz = 'Curing Waltz III'
                    elseif player.tp < 80 then
                            newWaltz = 'Curing Waltz IV'
                    end
     
                    downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
            end
     
            if newWaltz ~= spell.english then
                    send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
                    if downgrade then
                            add_to_chat(158, downgrade)
                    end
                    cancel_spell()
                    return
            end
     
            if missingHP > 0 then
                    add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
            end
    end
     
    function find_player_in_alliance(name)
            for i,v in ipairs(alliance) do
                    for k,p in ipairs(v) do
                            if p.name == name then
                                    return p
                            end
                    end
            end
    end
     
    function sub_job_change(newSubjob, oldSubjob)
            select_default_macro_book()
    end
     
    function set_macro_page(set,book)
            if not tonumber(set) then
                    add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
                    return
            end
            if set < 1 or set > 10 then
                    add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
                    return
            end
     
            if book then
                    if not tonumber(book) then
                            add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
                            return
                    end
                    if book < 1 or book > 20 then
                            add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
                            return
                    end
                    send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
            else
                    send_command('@input /macro set '..tostring(set))
            end
    end
     
    function select_default_macro_book()
            -- Default macro set/book
            if player.sub_job == 'SAM' then
                    set_macro_page(10, 2)
            elseif player.sub_job == 'DNC' then
                    set_macro_page(5, 5)
            elseif player.sub_job == 'WAR' then
                    set_macro_page(10, 2)
            elseif player.sub_job == 'WHM' then
                    set_macro_page(10, 2)
            elseif player.sub_job == 'NIN' then
                    set_macro_page(10, 2)
            else
                    set_macro_page(10, 2)
            end
    end

  7. #2307
    Smells like Onions
    Join Date
    Jul 2012
    Posts
    9
    BG Level
    0
    FFXI Server
    Bismarck
    WoW Realm
    Khadgar

    I was having a similar issue but I wouldn't say the same. I finished leveling Scholar yesterday and had my lua ready to go. Occasionally I would notice it not putting my idle set back on for about five minutes at a time. I would cast stun, or a cure and would be left in that set aftercast. It would switch to my next set when I would cast cast another type of spell or use a JA or whatever, but wouldn't set me back to idle. I would reload and unload/load and the problem would persist but then within a few minutes correct itself. I even changed the code I was using, first I used a friend's variation on Moten's:

    Code:
    -------------------------------------------------------------------------------------------------------------------
    -- Initialization function that defines sets and variables to be used.
    -------------------------------------------------------------------------------------------------------------------
    
    -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
       -- Supplementary files needed: 
          -- Mote-Globals
    	  -- Mote-Include
    	  -- Mote-Mappings
    	  -- Mote-SelfCommands
    	  -- Mote-TreasureHunter
    	  -- Mote-Utility
    
    --[[
    		Custom commands:
    
    		Shorthand versions for each strategem type that uses the version appropriate for
    		the current Arts.
    
    										Light Arts              Dark Arts
    
    		gs c scholar cost               Penury                  Parsimony
    		gs c scholar speed              Celerity                Alacrity
    		gs c scholar aoe                Accession               Manifestation
    		gs c scholar power              Rapture                 Ebullience
    		gs c scholar duration           Perpetuance
    		gs c scholar accuracy           Altruism                Focalization
    		gs c scholar enmity             Tranquility             Equanimity
    		gs c scholar skillchain                                 Immanence
    		gs c scholar addendum           Addendum: White         Addendum: Black
    --]]
    
    
    
    -- Initialization function for this job file.
    function get_sets()
    	-- Load and initialize the include file.
    	include('Mote-Include.lua')
    end
    
    -- Setup vars that are user-independent.
    function job_setup()
    	info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
    		"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
    
    	state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
    	update_active_strategems()
    end
    
    
    -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
    function user_setup()
    	-- Options: Override default values
    	options.CastingModes = {'Normal', 'Resistant'}
    	options.OffenseModes = {'None', 'Normal'}
    	options.DefenseModes = {'Normal'}
    	options.WeaponskillModes = {'Normal'}
    	options.IdleModes = {'Normal', 'Town', 'Field'}
    	options.RestingModes = {'Normal'}
    	options.PhysicalDefenseModes = {'PDT'}
    	options.MagicalDefenseModes = {'MDT'}
    
    	state.OffenseMode = 'None'
    	state.Defense.PhysicalMode = 'PDT'
    
    	info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
    	info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
    					   "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
    					   "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
    	info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
    
    	gear.macc_hagondes = {name="Hagondes Cuffs"}
    
    	send_command('bind ^` input /ma Stun <t>')
    	send_command('bind delete input /ja Light Arts <me>')
    	send_command('bind Home input /ja Perpetuance <me>')
    	send_command('bind End input /ja Accession <me>')
    end
    
    function job_file_unload()
    	send_command('unbind ^`')
    end
    
    
    -- Define sets and vars used by this job file.
    function init_gear_sets()
    	--------------------------------------
    	-- Start defining the sets
    	--------------------------------------
    
    	-- Precast Sets
    
    	-- Precast sets to enhance JAs
    
    	sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
    
    
    	-- Fast cast sets for spells
    
    	sets.precast.FC = {ammo="Impatiens",
    		head="Nahtirah Hat",ear2="Loquacious Earring",
    		body="Vanir Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",
    		back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots"}
    
    	sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
    
    	sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal"})
    
    	sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Nefer Kalasiris",back="Pahtli Cape"})
    
    	sets.precast.FC.Curaga = sets.precast.FC.Cure
    
    	sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
    
    
    	-- Midcast Sets
    
    	sets.midcast.FastRecast = {ammo="Impatiens",
    		head="Nahtirah Hat",ear2="Loquacious Earring",
    		body="Vanir Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",
    		back="Swith Cape +1",waist="Witful Belt",legs="Theurgist's Slacks",feet="Pedagogy Loafers"}
    
    	sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",ammo="Clarus Stone",
    		head="Buremte Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
    		body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
    		back="Tempered Cape",waist="Cascade Belt",legs="Nares Trews",feet="Pedagogy Loafers"}
    
    	sets.midcast.CureWithLightWeather = {main="Tamaxchi",sub="Genbu's Shield",ammo="Clarus Stone",
    		head="Buremte Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
    		body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
    		back="Tempered Cape",waist="Cascade Belt",legs="Nares Trews",feet="Pedagogy Loafers"}
    
    	sets.midcast.Curaga = set_combine(sets.midcast.Cure, {ring1="Aquasoul Ring",ring2="Aqua Ring"})
    
    	sets.midcast.Regen = {main="Bolelabunga",head="Savant's Bonnet +2"}
    
    	sets.midcast.Cursna = {
    		neck="Malison Medallion",ring1="Ephedra Ring",feet="Gendewitha Galoshes"}
    
    	sets.midcast['Enhancing Magic'] = {ammo="Savant's Treatise",
    		head="Buremte Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",body="Gendewitha Bliaut",
    		hands="Lurid Mitts",ring1="Aquasoul Ring",ring2="Aqua Ring",back="Pahtli Cape",
    		waist="Cascade Belt",legs="Theurgist's Slacks",feet="Literae Sabots"}
    
    	sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash",neck="Stone Gorget"})
    
    	sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers"})
    
    	sets.midcast.Protect = {ring1="Sheltered Ring"}
    	sets.midcast.Protectra = sets.midcast.Protect
    
    	sets.midcast.Shell = {ring1="Sheltered Ring"}
    	sets.midcast.Shellra = sets.midcast.Shell
    
    
    	-- Custom spell classes
    	sets.midcast.MndEnfeebles = {main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    		head="Artsieq Hat",neck="Enfeebling Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
    		body="Gendewitha Bliaut",hands="Lurid Mitts",ring1="Aquasoul Ring",ring2="Sangoma Ring",
    		back="Refraction Cape",waist="Aswang Sash",legs="Artsieq Hose",feet="Artsieq Boots"}
    
    	sets.midcast.IntEnfeebles = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Kalboron Stone",
    		head="Artsieq Hat",neck="Enfeebling Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    		body="Hedera Cotehardie",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Sangoma Ring",
    		back="Refraction Cape",waist="Aswang Sash",legs="Artsieq Hose",feet="Artsieq Boots"}
    
    	sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
    
    	sets.midcast['Dark Magic'] = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Incantor Stone",
    		head="Nahtirah Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    		body="Hedera Cotehardie",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Sangoma Ring",
    		back="Bookworm's Cape",waist="Crimson Belt",legs="Artsieq Hose",feet="Artsieq Boots"}
    
    	sets.midcast.Kaustra = {main="Ngqoqwanb",sub="Wise Strap",ammo="Witchstone",
    		head="Hagondes Hat",neck="Eddy Necklace",ear1="Novio Earring",ear2="Friomisi Earring",
    		body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Acumen Ring",ring2="Strendu Ring",
    		back="Toro Cape",waist="Aswang Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
    
    	sets.midcast.Drain = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Incantor Stone",
    		head="Nahtirah Hat",neck="Aesir Torque",ear1="Hirudinea Earring",ear2="Loquacious Earring",
    		body="Hedera Cotehardie",hands="Hagondes Cuffs",ring1="Strendu Ring",ring2="Sangoma Ring",
    		back="Refraction Cape",waist="Crimson Belt",legs="Artsieq Hose",feet="Academic's Loafers"}
    
    	sets.midcast.Aspir = sets.midcast.Drain
    
    	sets.midcast.Stun = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Incantor Stone",
    		head="Pedagogy Mortarboard",neck="Eddy Necklace",ear1="Gwati Earring",ear2="Loquac. Earring",
    		body="Hedera Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
    		back="Swith Cape +1",waist="Ninurta's Sash",legs="Artsieq Hose",feet="Academic's Loafers"}
    
    	sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {main="Ngqoqwanb"})
    
    
    	-- Elemental Magic sets are default for handling low-tier nukes.
    	sets.midcast['Elemental Magic'] = {main="Ngqoqwanb",sub="Wise Strap",ammo="Whichstone",
    		head="Hagondes Hat",neck="Eddy Necklace",ear1="Novio Earring",ear2="Friomisi Earring",
    		body="Hagondes Coat",hands="Otomi Gloves",ring1="Strendu Ring",ring2="Acumen Ring",
    		back="Bookworm's Cape",waist=gear.ElementalObi,legs="Hagondes Pants",feet="Umbani Boots"}
    
    	sets.midcast['Elemental Magic'].Resistant = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Whichstone",
    		head="Hagondes Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    		body="Hagondes Coat",hands=gear.macc_hagondes,ring1="Strendu Ring",ring2="Acumen Ring",
    		back="Bookworm's Cape",waist=gear.ElementalObi,legs="Hagondes Pants",feet="Artsieq Boots"}
    
    	-- Custom refinements for certain nuke tiers
    	sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {hands="Yaoyotl Gloves",feet="Hagondes Sabots",back="Toro Cape"})
    
    	sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant, {})
    
    	sets.midcast.Impact = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Kalboron Stone",
    		head=empty,neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    		body="Twilight Cloak",hands=gear.macc_hagondes,ring1="Angha Ring",ring2="Sangoma Ring",
    		back="Refraction Cape",waist="Aswang Sash",legs="Artsieq Hose",feet="Artsieq Boots"}
    
    
    	-- Sets to return to when not performing an action.
    
    	-- Resting sets
    	sets.resting = {main="Boonwell Staff",sub="Mephitis Grip",ammo="Clarus Stone",
    		neck="Eidolon Pendant",body="Gendewitha Bliaut",hands="Serpentes Cuffs",ring1="Star Ring",ring2="Angha Ring",
    		back="Felicitas Cape",waist="Austerity Belt",legs="Nisse Slacks",feet="Chelona Boots"}
    
    
    	-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
    
    	sets.idle.Town = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
    		
    	sets.idle.Field = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
    
    	sets.idle.Field.PDT = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
    
    	sets.idle.Field.Stun = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
    
    	sets.idle.Weak = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Slipor Sash",legs="Nares Trews",feet="Herald's Gaiters"}
    
    	-- Defense sets
    
    	sets.defense.PDT = {main="Earth staff",sub="Mephitis Grip",ammo="Impatiens",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    		ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Witful Belt",legs="Tatsumaki sitagoromo",feet="Herald's Gaiters"}
    
    	sets.defense.MDT = {main="Earth staff",sub="Mephitis Grip",ammo="Vanir Battery",
    		head="Wivre Hairpin",neck="Twilight Torque",ear1="Black Earring",ear2="Ethereal Earring",
    		body="Gendewitha Bliaut",hands="Serpentes Cuffs",
    		ring1="Shadow Ring",ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    		back="Repulse Mantle",waist="Witful Belt",legs="Tatsumaki sitagoromo",feet="Herald's Gaiters"}
    
    	sets.Kiting = {feet="Herald's Gaiters"}
    
    	sets.latent_refresh = {waist="Fucho-no-obi"}
    
    	-- Engaged sets
    
    	-- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    	-- sets if more refined versions aren't defined.
    	-- If you create a set with both offense and defense modes, the offense mode should be first.
    	-- EG: sets.engaged.Dagger.Accuracy.Evasion
    
    	-- Normal melee group
    	sets.engaged = {
    		head="Zelus Tiara",
    		body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Rajas Ring",
    		waist="Ninurta's Sash",legs="Hagondes Pants",feet="Hagondes Sabots"}
    
    
    
    	-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
    	sets.buff['Ebullience'] = {head="Savant's Bonnet +2"}
    	sets.buff['Rapture'] = {head="Savant's Bonnet +2"}
    	sets.buff['Perpetuance'] = {hands="Savant's Bracers +2"}
    	sets.buff['Immanence'] = {hands="Savant's Bracers +2"}
    	sets.buff['Penury'] = {legs="Savant's Pants +2"}
    	sets.buff['Parsimony'] = {legs="Savant's Pants +2"}
    	sets.buff['Celerity'] = {feet="Pedagogy Loafers"}
    	sets.buff['Alacrity'] = {head="Nahtirah Hat",feet="Chelona Boots +1"}
    
    	sets.buff['Klimaform'] = {feet="Savant's Loafers +2"}
    
    	sets.buff.FullSublimation = {head="Academic's Mortarboard",ear1="Savant's Earring",body="Pedagogy Gown"}
    	sets.buff.PDTSublimation = {head="Academic's Mortarboard",ear1="Savant's Earring"}
    
    	--sets.buff['Sandstorm'] = {feet="Desert Boots"}
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Job-specific hooks that are called to process player actions at specific points in time.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
    -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
    function job_precast(spell, action, spellMap, eventArgs)
    	if state.Buff[spell.english] ~= nil then
    		state.Buff[spell.english] = true
    	end
    end
    
    -- Run after the general midcast() is done.
    function job_post_midcast(spell, action, spellMap, eventArgs)
    	if spell.action_type == 'Magic' then
    		apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
    	end
    end
    
    -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
    function job_aftercast(spell, action, spellMap, eventArgs)
    	if state.Buff[spell.english] ~= nil then
    		state.Buff[spell.english] = not spell.interrupted or buffactive[spell.english]
    	end
    end
    
    
    -------------------------------------------------------------------------------------------------------------------
    -- Customization hooks for idle and melee sets, after they've been automatically constructed.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Custom spell mapping.
    function job_get_spell_map(spell, default_spell_map)
    	if spell.action_type == 'Magic' then
    		if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
    			if world.weather_element == 'Light' then
    				return 'CureWithLightWeather'
    			end
    		elseif spell.skill == 'Enfeebling Magic' then
    			if spell.type == 'WhiteMagic' then
    				return 'MndEnfeebles'
    			else
    				return 'IntEnfeebles'
    			end
    		elseif spell.skill == 'Elemental Magic' then
    			if info.low_nukes:contains(spell.english) then
    				return 'LowTierNuke'
    			elseif info.mid_nukes:contains(spell.english) then
    				return 'MidTierNuke'
    			elseif info.high_nukes:contains(spell.english) then
    				return 'HighTierNuke'
    			end
    		end
    	end
    end
    
    function customize_idle_set(idleSet)
    	if state.Buff['Sublimation: Activated'] then
    		if state.IdleMode == 'Normal' then
    			idleSet = set_combine(idleSet, sets.buff.FullSublimation)
    		elseif state.IdleMode == 'PDT' then
    			idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
    		end
    	end
    
    	if player.mpp < 51 then
    		idleSet = set_combine(idleSet, sets.latent_refresh)
    	end
    
    	return idleSet
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- General hooks for change events.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Called when a player gains or loses a buff.
    -- buff == buff gained or lost
    -- gain == true if the buff was gained, false if it was lost.
    function job_buff_change(buff, gain)
    	if state.Buff[buff] ~= nil then
    		state.Buff[buff] = gain
    	end
    
    	if buff == "Sublimation: Activated" then
    		handle_equipping_gear(player.status)
    	end
    end
    
    -- Handle notifications of general user state change.
    function job_state_change(stateField, newValue, oldValue)
    	if stateField == 'OffenseMode' then
    		if newValue == 'Normal' then
    			disable('main','sub')
    		else
    			enable('main','sub')
    		end
    	elseif stateField == 'Reset' then
    		if state.OffenseMode == 'None' then
    			enable('main','sub')
    		end
    	end
    end
    
    
    -------------------------------------------------------------------------------------------------------------------
    -- User code that supplements self-commands.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Called for direct player commands.
    function job_self_command(cmdParams, eventArgs)
    	if cmdParams[1]:lower() == 'scholar' then
    		handle_strategems(cmdParams)
    		eventArgs.handled = true
    	end
    end
    
    
    -- Called by the 'update' self-command.
    function job_update(cmdParams, eventArgs)
    	if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
    					   buffactive['addendum: white'] or buffactive['addendum: black']) then
    		if state.IdleMode == 'Stun' then
    			send_command('@input /ja "Dark Arts" <me>')
    		else
    			send_command('@input /ja "Light Arts" <me>')
    		end
    	end
    
    	update_active_strategems()
    	update_sublimation()
    end
    
    
    -- Function to display the current relevant user state when doing an update.
    -- Return true if display was handled, and you don't want the default info shown.
    function display_current_job_state(eventArgs)
    	local defenseString = ''
    	if state.Defense.Active then
    		local defMode = state.Defense.PhysicalMode
    		if state.Defense.Type == 'Magical' then
    			defMode = state.Defense.MagicalMode
    		end
    
    		defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
    	end
    
    	local meleeString = ''
    	if state.OffenseMode == 'Normal' then
    		meleeString = 'Melee: Weapons locked, '
    	end
    
    	add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
    		'Kiting: '..on_off_names[state.Kiting])
    
    	eventArgs.handled = true
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Utility functions specific to this job.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Reset the state vars tracking strategems.
    function update_active_strategems()
    	state.Buff['Ebullience'] = buffactive['Ebullience'] or false
    	state.Buff['Rapture'] = buffactive['Rapture'] or false
    	state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
    	state.Buff['Immanence'] = buffactive['Immanence'] or false
    	state.Buff['Penury'] = buffactive['Penury'] or false
    	state.Buff['Parsimony'] = buffactive['Parsimony'] or false
    	state.Buff['Celerity'] = buffactive['Celerity'] or false
    	state.Buff['Alacrity'] = buffactive['Alacrity'] or false
    
    	state.Buff['Klimaform'] = buffactive['Klimaform'] or false
    end
    
    function update_sublimation()
    	state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
    end
    
    -- Equip sets appropriate to the active buffs, relative to the spell being cast.
    function apply_grimoire_bonuses(spell, action, spellMap)
    	if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
    		equip(sets.buff['Perpetuance'])
    	end
    	if state.Buff.Alacrity and spell.english == "Stun" then
    	    equip(sets.buff['Alacrity'])
    	end	
    	if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
    		equip(sets.buff['Rapture'])
    	end
    	if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
    		if state.Buff.Ebullience and spell.english ~= 'Impact' then
    			equip(sets.buff['Ebullience'])
    		end
    		if state.Buff.Immanence then
    			equip(sets.buff['Immanence'])
    		end
    		if state.Buff.Klimaform and spell.element == world.weather_element then
    			equip(sets.buff['Klimaform'])
    		end
    	end
    
    	if state.Buff.Penury then equip(sets.buff['Penury']) end
    	if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
    	if state.Buff.Celerity then equip(sets.buff['Celerity']) end
    	if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
    end
    
    
    -- General handling of strategems in an Arts-agnostic way.
    -- Format: gs c scholar <strategem>
    function handle_strategems(cmdParams)
    	-- cmdParams[1] == 'scholar'
    	-- cmdParams[2] == strategem to use
    
    	if not cmdParams[2] then
    		add_to_chat(123,'Error: No strategem command given.')
    		return
    	end
    	local strategem = cmdParams[2]:lower()
    
    	if buffactive['light arts'] or buffactive['addendum: white'] then
    		if strategem == 'cost' then
    			send_command('@input /ja Penury <me>')
    		elseif strategem == 'speed' then
    			send_command('@input /ja Celerity <me>')
    		elseif strategem == 'aoe' then
    			send_command('@input /ja Accession <me>')
    		elseif strategem == 'power' then
    			send_command('@input /ja Rapture <me>')
    		elseif strategem == 'duration' then
    			send_command('@input /ja Perpetuance <me>')
    		elseif strategem == 'accuracy' then
    			send_command('@input /ja Altruism <me>')
    		elseif strategem == 'enmity' then
    			send_command('@input /ja Tranquility <me>')
    		elseif strategem == 'skillchain' then
    			add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
    		elseif strategem == 'addendum' then
    			send_command('@input /ja "Addendum: White" <me>')
    		else
    			add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
    		end
    	elseif buffactive['dark arts']  or buffactive['addendum: black'] then
    		if strategem == 'cost' then
    			send_command('@input /ja Parsimony <me>')
    		elseif strategem == 'speed' then
    			send_command('@input /ja Alacrity <me>')
    		elseif strategem == 'aoe' then
    			send_command('@input /ja Manifestation <me>')
    		elseif strategem == 'power' then
    			send_command('@input /ja Ebullience <me>')
    		elseif strategem == 'duration' then
    			add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
    		elseif strategem == 'accuracy' then
    			send_command('@input /ja Focalization <me>')
    		elseif strategem == 'enmity' then
    			send_command('@input /ja Equanimity <me>')
    		elseif strategem == 'skillchain' then
    			send_command('@input /ja Immanence <me>')
    		elseif strategem == 'addendum' then
    			send_command('@input /ja "Addendum: Black" <me>')
    		else
    			add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
    		end
    	else
    		add_to_chat(123,'No arts has been activated yet.')
    	end
    end
    
    
    -- Gets the current number of available strategems based on the recast remaining
    -- and the level of the sch.
    function get_current_strategem_count()
    	-- returns recast in seconds.
    	local allRecasts = windower.ffxi.get_ability_recasts()
    	local stratsRecast = allRecasts[231]
    
    	local maxStrategems
    
    	if player.main_job_level >= 90 then
    		maxStrategems = 5
    	elseif player.main_job_level >= 70 then
    		maxStrategems = 4
    	elseif player.main_job_level >= 50 then
    		maxStrategems = 3
    	elseif player.main_job_level >= 30 then
    		maxStrategems = 2
    	elseif player.main_job_level >= 10 then
    		maxStrategems = 1
    	else
    		maxStrategems = 0
    	end
    
    	local fullRechargeTime = 4*60
    
    	local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
    
    	return currentCharges
    end
    Then tried a Bokura variant:

    Code:
    -- *** Credit goes to Flippant for helping me with Gearswap *** --
    -- ** I Use Motenten's Macro Book Function ** --
    -- Last Updated: 06/30/14 12:00 AM *Fixed Magic Sets* --
    
    function get_sets()
    	AccIndex = 1
    	AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
    	IdleIndex = 1
    	IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
    	Armor = 'None'
    	StunIndex = 0
    	Obi = 'ON' -- Turn Default Obi ON or OFF Here --
    	target_distance = 5 -- Set Default Distance Here --
    
    	Non_Obi_Spells = S{
    			'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
    			'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
    
    	Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
    	Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
    	sc_map = {SC1 = "LightArts", SC2 = "Perpetuance", SC3 = "Accession"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
    
    	-- Idle Sets --
    	sets.Idle = {}
    	sets.Idle.Refresh = {
    			main="Earth staff",
    			sub="Mephitis Grip",
    			ammo="Impatiens",
    			head="Wivre Hairpin",
    			neck="Twilight Torque",
    			ear1="Black Earring",
    			ear2="Ethereal Earring",
    			body="Gendewitha Bliaut",
    			hands="Serpentes Cuffs",
    			ring1={name="Dark Ring",augments={"Phys. dmg. taken -6%","Breath dmg. taken -4%","Magic dmg. taken -4%"}},
    			ring2={name="Dark Ring",augments={"Enemy crit. hit rate -2","Phys. dmg. taken -5%","Magic dmg. taken -6%"}},
    			back="Repulse Mantle",
    			waist="Slipor Sash",
    			legs="Nares Trews",
    			feet="Herald's Gaiters"}
    	sets.Idle.Movement = set_combine(sets.Idle.Refresh,{})
    	sets.Resting = set_combine(sets.Idle.Refresh,{main="Boonwell Staff",ammo="Clarus Stone",
    			body="Gendewitha Bliaut",head="Orvail Corona",neck="Eidolon Pendant",ear2="Antivenom Earring",
    			hands="Nares Cuffs",ring1="Star Ring",ring2="Angha Ring",back="Felicitas Cape",waist="Austerity Belt",
    			legs="Nisse Slacks",feet="Chelona Boots"})
    
    	-- PDT Set --
    	sets.PDT = {}
    
    	sets.Sublimation = {
    			ear1="Savant's Earring",body="Pedagogy Gown +1"}
    
    	sets.Precast = {}
    	-- Fastcast Sets --
    	sets.Precast.FastCast = {ammo="Impatiens",
    			head="Nahtirah Hat",ear2="Loquacious Earring",
    			body="Vanir Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",
    			back="Swith Cape +1",waist="Witful Belt",legs="Theurgist's Slacks",feet="Pedagogy Loafers"}
    
    	-- Elemental Staves --
    	sets.Precast.Thunder = {main='Apamajas I'}
    	sets.Precast.Water = {main='Haoma I'}
    	sets.Precast.Fire = {main='Atar I'}
    	sets.Precast.Ice = {main='Vourukasha I'}
    	sets.Precast.Wind = {main='Vayuvata I'}
    	sets.Precast.Earth = {main='Vishrava I'}
    	sets.Precast.Light = {main='Arka I'}
    	sets.Precast.Dark = {main='Xsaeta I'}
    
    	-- Precast Enhancing Magic --
    	sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
    
    	-- Precast Cure Set --
    	sets.Precast.Cure = {
    			main="Tamaxchi",sub="Genbu's Shield",ammo="Impatiens",
    			head="Nahtirah Hat",neck="Colossus's Torque",ear2="Loquac. Earring",
    			body="Nefer Kalasiris",hands="Gendewitha Gages",ring1="Prolix Ring",
    			back="Pahtli Cape",waist="Witful Belt";legs="Theurgist's Slacks",feet="Chelona Boots"}
    
    	-- Midcast Base Set --
    	sets.Midcast = {}
    
    	-- Haste Set --
    	sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{})
    
    	-- Cure Set --
    	sets.Midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",ammo="Clarus Stone",
    			head="Buremte Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
    			body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
    			back="Tempered Cape",waist="Cascade Belt",legs="Nares Trews",feet="Pedagogy Loafers"}
    
    	-- Curaga Set --
    	sets.Midcast.Curaga = set_combine(sets.Midcast.Cure,{
    			ring1="Aquasoul Ring",
                ring2="Aqua Ring",})
    
    	-- Enhancing Magic --
    	sets.Midcast['Enhancing Magic'] = {ammo="Savant's Treatise",
    			head="Buremte Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",body="Gendewitha Bliaut",
    			hands="Lurid Mitts",ring1="Aquasoul Ring",ring2="Aqua Ring",back="Pahtli Cape",
    			waist="Cascade Belt",legs="Theurgist's Slacks",feet="Literae Sabots"}
    
    	-- Stoneskin --
    	sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{head="Umuthi Hat",neck="Stone Gorget"})
    
    	-- Cursna --
    	sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
    			neck="Malison Medallion",ring1="Ephedra Ring",feet="Gendewitha Galoshes"})
    
    	-- Stun Sets --
    	sets.Midcast.Stun = {
    			main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    			head="Nahtirah Hat",neck="Stoicheion Medal",
    			ear1="Gwati Earring",ear2="Loquac. Earring",
    			body="Hagondes Coat",hands="Gendewitha Gages",
    			ring1="Sangoma Ring",ring2="Perception Ring",
    			back="Swith Cape",waist="Witful Belt",
    			legs="Theurgist's Slacks",feet="Pedagogy Loafers"}
    	sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
    	sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
    
    	-- Dark Magic Sets --
    	sets.Midcast['Dark Magic'] = {main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    			head="Nahtirah Hat",neck="Aesir Torque",
    			ear1="Gwati Earring",ear2="Loquac. Earring",
    			body="Hagondes Coat",hands="Lurid Mitts",
    			ring1="Sangoma Ring",ring2="Perception Ring",
    			back="Refraction Cape",waist="Crimson Belt",
    			legs="Hagondes Pants",feet="Manabyss Pigaches"}
    	sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
    	sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
    	
    	sets.Midcast.Drain = {main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    			head="Nahtirah Hat",neck="Aesir Torque",
    			ear1="Gwati Earring",ear2="Loquac. Earring",
    			body="Hagondes Coat",hands="Lurid Mitts",
    			ring1="Sangoma Ring",ring2="Perception Ring",
    			back="Refraction Cape",waist="Crimson Belt",
    			legs="Hagondes Pants",feet="Manabyss Pigaches"}
    
    	sets.Midcast.Aspir = set_combine(sets.Midcast.Drain,{})
    
    	-- Elemental Sets --
    	sets.Midcast['Elemental Magic'] = {main="Baqil Staff",sub="Mephitis Grip",ammo="Witchstone",
    			head="Hagondes Hat",neck="Stoicheion Medal",
    			ear1="Friomisi Earring",ear2="Crematio Earring",
    			body="Hagondes Coat",hands="Yaoyotl Gloves",
    			ring1="Acumen Ring",ring2="Icesoul Ring",
    			back="Toro Cape",waist="Wanion Belt",
    			legs="Hagondes Pants",feet="Manabyss Pigaches"}
    	sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{})
    	sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
    
    	-- Enfeebling Sets --
    	sets.Midcast['Enfeebling Magic'] = {main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    			head="Buremte Hat",neck="Enfeebling Torque",
    			ear1="Gwati Earring",ear2="Loquac. Earring",
    			body="Hagondes Coat",hands="Lurid Mitts",
    			ring1="Sangoma Ring",ring2="Perception Ring",
    			back="Refraction Cape",waist="Cascade Belt",
    			legs="Hagondes Pants",feet="Manabyss Pigaches"}
    	sets.Midcast['Enfeebling Magic'].MidACC =  set_combine(sets.Midcast['Enfeebling Magic'],{})
    	sets.Midcast['Enfeebling Magic'].HighACC = set_combine(sets.Midcast['Enfeebling Magic'].MidACC,{})
    
    	-- Impact --
    	sets.Midcast.Impact = {
    			main="Cagliostro's Rod",sub="Genbu's Shield",ammo="Kalboron Stone",
    			neck="Enfeebling Torque",
    			ear1="Gwati Earring",ear2="Loquac. Earring",
    			body="Twilight Cloak",hands="Lurid Mitts",
    			ring1="Sangoma Ring",ring2="Perception Ring",
    			back="Refraction Cape",waist="Cascade Belt",
    			legs="Hagondes Pants",feet="Manabyss Pigaches"}
    
    	-- Elemental Obi/Twilight Cape --
    	sets.Obi = {}
    	sets.Obi.Thunder = {back="Twilight Cape",waist='Rairin Obi'}
    	sets.Obi.Water = {back="Twilight Cape",waist='Suirin Obi'}
    	sets.Obi.Fire = {back="Twilight Cape",waist='Karin Obi'}
    	sets.Obi.Ice = {back="Twilight Cape",waist='Hyorin Obi'}
    	sets.Obi.Wind = {back="Twilight Cape",waist='Furin Obi'}
    	sets.Obi.Earth = {back="Twilight Cape",waist='Dorin Obi'}
    	sets.Obi.Light = {back="Twilight Cape",waist='Korin Obi'}
    	sets.Obi.Dark = {back="Twilight Cape",waist='Anrin Obi'}
    
    	-- JA Sets --
    	sets.JA = {}
    	sets.JA['Tabula Rasa'] = {legs="Argute Pants +2"}
    	sets.JA.Sublimation = {body="Pedagogy Gown +1",ear1="Savant's Earring"}
        sets.JA['Light Arts'] = {legs="Academic's Pants"}
    	sets.JA['Dark Arts'] = {body="Scholar's Gown"}
    	sets.JA['Addendum: Black'] = {body="Savant's Gown +2"}
    	sets.JA['Addendum: White'] = {body="Savant's Gown +2"}
    	sets.JA.Parsimony = {legs="Savant's Pants +2"}
    	sets.JA.Penury = {legs="Savant's Pants +2"}
    	sets.JA.Rapture = {head="Svnt. Bonnet +2"}
    	sets.JA.Ebullience = {head="Svnt. Bonnet +2"}
    	sets.JA.Perpetuance = {hands="Svnt. Bracers +2"}
    	sets.JA.Immenance = {hands="Svnt. Bracers +2"}
    	sets.JA.Enlightenment = {body="Pedagogy Gown +1"}
    
    	-- Melee Set --
    	sets.Melee = set_combine(sets.Midcast.Haste,{})
    
    	-- WS Base Set --
    	sets.WS = {}
    	sets.WS.Shattersoul = {}
    	sets.WS.Myrkr = {}
    	sets.WS.Omniscience = {}
    end
    
    function pretarget(spell,action)
    	if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
    		cancel_spell()
    		send_command('input /item "Echo Drops" <me>')
    	elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
    		degrade_spell(spell,Cure_Spells)
    	elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
    		degrade_spell(spell,Curaga_Spells)
    	elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
    		if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
    			cancel_spell()
    			send_command('input /ja Addendum: White <me>')
    		elseif spell.english == "Manifestation" then
    			cancel_spell()
    			send_command('input /ja Accession <me>')
    		elseif spell.english == "Alacrity" then
    			cancel_spell()
    			send_command('input /ja Celerity <me>')
    		elseif spell.english == "Parsimony" then
    			cancel_spell()
    			send_command('input /ja Penury <me>')
    		end
    	elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
    		if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
    			cancel_spell()
    			send_command('input /ja Addendum: Black <me>')
    		elseif spell.english == "Accession" then
    			cancel_spell()
    			send_command('input /ja Manifestation <me>')
    		elseif spell.english == "Celerity" then
    			cancel_spell()
    			send_command('input /ja Alacrity <me>')
    		elseif spell.english == "Penury" then
    			cancel_spell()
    			send_command('input /ja Parsimony <me>')
    		end
    	end
    end
    
    function precast(spell,action)
    	if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
    		if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
    			cancel_spell()
    			add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
    			return
    		else
    			if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
    				equip(sets.Precast.Cure)
    			elseif spell.english == "Impact" then
    				equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
    			elseif string.find(spell.english,'Utsusemi') then
    				if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
    					cancel_spell()
    					add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
    					return
    				else
    					equip(sets.Precast.FastCast)
    				end
    			elseif sets.Precast[spell.skill] then
    				equip(sets.Precast[spell.skill])
    			else
    				equip(sets.Precast.FastCast)
    			end
    		end
    	elseif spell.type == "WeaponSkill" then
    		if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
    			cancel_spell()
    			add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
    			return
    		else
    			if sets.WS[spell.english] then
    				equip(sets.WS[spell.english])
    			end
    		end
    	elseif spell.type == "JobAbility" then
    		if sets.JA[spell.english] then
    			equip(sets.JA[spell.english])
    		end
    	elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
    		cast_delay(0.2)
    		send_command('cancel Sneak')
    	end
    	if sets.Precast[spell.element] then
    		equip(sets.Precast[spell.element])
    	end
    	if StunIndex == 1 then
    		equip(sets.Midcast.Stun)
    	end
    end
    
    function midcast(spell,action)
    	equipSet = {}
    	if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
    		equipSet = sets.Midcast
    		if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
    			if string.find(spell.english,'Cure') then
    				equipSet = equipSet.Cure
    			elseif string.find(spell.english,'Cura') then
    				equipSet = equipSet.Curaga
    			end
    			if buffactive.Rapture then -- Equip Svnt. Bonnet +2 When Rapture Is Up For Curaga Spells --
    				equipSet = set_combine(equipSet,{head="Svnt. Bonnet +2"})
    			end
    		elseif spell.english == "Stoneskin" then
    			if buffactive.Stoneskin then
    				send_command('@wait 2.8;cancel stoneskin')
    			end
    			equipSet = equipSet.Stoneskin
    		elseif spell.english == "Sneak" then
    			if spell.target.name == player.name and buffactive['Sneak'] then
    				send_command('cancel sneak')
    			end
    			equipSet = equipSet.Haste
    		elseif string.find(spell.english,'Regen') then -- Equip Svnt. Bonnet +2 For Regen Spells --
    			equipSet = set_combine(equipSet,{head="Svnt. Bonnet +2"})
    		elseif string.find(spell.english,'Banish') then
    			equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
    		elseif spell.english == "Stun" and buffactive.Alacrity then -- Equip Argute loafers +2 When Alacrity Is Up And Thunder Weather --
    			equipSet = set_combine(equipSet,{head="Nahtirah Hat",feet="Argute loafers +2"})
    		elseif string.find(spell.english,'Utsusemi') then
    			if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
    				send_command('@wait 1.7;cancel Copy Image*')
    			end
    			equipSet = equipSet.Haste
    		elseif spell.english == 'Monomi: Ichi' then
    			if buffactive['Sneak'] then
    				send_command('@wait 1.7;cancel sneak')
    			end
    			equipSet = equipSet.Haste
    		else
    			if equipSet[spell.english] then
    				equipSet = equipSet[spell.english]
    			end
    			if equipSet[spell.skill] then
    				equipSet = equipSet[spell.skill]
    			end
    			if equipSet[AccArray[AccIndex]] then
    				equipSet = equipSet[AccArray[AccIndex]]
    			end
    			if equipSet[spell.type] then
    				equipSet = equipSet[spell.type]
    			end
    			if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia')) and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' then -- Use Obi Toggle To Equip Normal Waist Gear --
    				equipSet = set_combine(equipSet,sets.Obi[spell.element])
    			end
    		end
    	end
    	if buffactive.Perpetuance and spell.skill == "Enhancing Magic" then
    		equipSet = set_combine(equipSet,{hands="Svnt. Bracers +2"})
    	elseif equipSet[spell.english] then
    		equipSet = equipSet[spell.english]
    	end
    	equip(equipSet)
    	if StunIndex == 1 then
    		equip(sets.Midcast.Stun)
    	end
    end
    
    function aftercast(spell,action)
    	if not spell.interrupted then
    		if spell.english == "Sleep II" then -- Sleep II Countdown --
    			send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
    		elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
    			send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
    		elseif spell.english == "Banish II" then -- Banish II Countdown --
    			send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
    		end
    	end
    	status_change(player.status)
    end
    
    function status_change(new,old)
    	if Armor == 'PDT' then
    		equip(sets.PDT)
    	elseif buffactive["Sublimation: Activated"] then
    		equip(sets.Sublimation)
    	elseif new == 'Engaged' then
    		equip(sets.Melee)
    	elseif new == 'Idle' then
    		equip(sets.Idle[IdleArray[IdleIndex]])
    	elseif new == 'Resting' then
    		equip(sets.Resting)
    	end
    	if StunIndex == 1 then
    		equip(sets.Midcast.Stun)
    	end
    end
    
    function buff_change(buff,gain)
    	buff = string.lower(buff)
    	if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
    		if gain then
    			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.]')
    		else
    			send_command('timers delete "Aftermath: Lv.3"')
    			add_to_chat(123,'AM3: [OFF]')
    		end
    	elseif buff == 'weakness' then -- Weakness Timer --
    		if gain then
    			send_command('timers create "Weakness" 300 up')
    		else
    			send_command('timers delete "Weakness"')
    		end
    	end
    	if not midaction() then
    		status_change(player.status)
    	end
    end
    
    -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
    function self_command(command)
    	if command == 'C1' then -- Magic Accuracy Toggle --
    		AccIndex = (AccIndex % #AccArray) + 1
    		add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
    		status_change(player.status)
    	elseif command == 'C5' then -- Auto Update Gear Toggle --
    		status_change(player.status)
    		add_to_chat(158,'Auto Update Gear')
    	elseif command == 'C2' then -- Stun Toggle --
    		if StunIndex == 1 then
    			StunIndex = 0
    			add_to_chat(123,'Stun Set: [Unlocked]')
    		else
    			StunIndex = 1
    			add_to_chat(158,'Stun Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C3' then -- Obi Toggle --
    		if Obi == 'ON' then
    			Obi = 'OFF'
    			add_to_chat(123,'Obi: [OFF]')
    		else
    			Obi = 'ON'
    			add_to_chat(158,'Obi: [ON]')
    		end
    		status_change(player.status)
    	elseif command == 'C7' then -- PDT Toggle --
    		if Armor == 'PDT' then
    			Armor = 'None'
    			add_to_chat(123,'PDT Set: [Unlocked]')
    		else
    			Armor = 'PDT'
    			add_to_chat(158,'PDT Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C8' then -- Distance Toggle --
    		if player.target.distance then
    			target_distance = math.floor(player.target.distance*10)/10
    			add_to_chat(158,'Distance: '..target_distance)
    		else
    			add_to_chat(123,'No Target Selected')
    		end
    	elseif command == 'C6' then -- Idle Toggle --
    		IdleIndex = (IdleIndex % #IdleArray) + 1
    		add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
    		status_change(player.status)
    	elseif command:match('^SC%d$') then
    		send_command('//' .. sc_map[command])
    	end
    end
    
    function actualCost(originalCost)
    	if buffactive["Penury"] then
    		return originalCost*.5
    	elseif buffactive["Light Arts"] then
    		return originalCost*.9
    	else
    		return originalCost
    	end
    end
    
    function degrade_spell(spell,degrade_array)
    	spell_index = table.find(degrade_array,spell.name)
    	if spell_index > 1 then
    		new_spell = degrade_array[spell_index - 1]
    		change_spell(new_spell,spell.target.raw)
    		add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
    	end
    end
    I was concerned with Mote's I'd been just hitting a bind and switching a state that I shouldn't have. However, this second one has no binds since it doesn't reference the include and they are not set in my init.txt. I hope I've provided enough information.

    Edit: Just started up for today, went into abyssea and cast sleep on a mob. Gear stayed on until well after sleep wore off and then randomly a few more minutes later reverted to idle.

  8. #2308
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    Quote Originally Posted by Motenten View Post
    First, please try taking your classes in English writing and grammar seriously.

    Second, just add gear.ElementalObi (a variable, so not placed in quotes) as the waist item of the weaponskills in question. It will automatically set the obi if it matches the day or weather element of the action (weaponskill, in this case). Same for the ring, using gear.ElementalRing.

    If the day/weather does not match the element, it will default to using whatever gear you specify in the gear.default.obi_waist and gear.default.obi_ring variables. You can use whatever the defaults happen to be, or specify your own.

    Thus (aside from regular gear):

    gear.default.obi_waist = "Soil Gorget"
    gear.default.obi_ring = "Stormsoul Ring"
    sets.precast.WS.Wildfire = {waist=gear.ElementalObi, ring2=gear.ElementalRing}




    30 years to late for "engrish" classes hoss but insults aside thanks for the help kiddo <3

  9. #2309
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    Ok i tried what you said but its not using the obi at all no clue what to do with it~
    With the gear.ElementalObi in the waist slot it wont change the waist at all now below is the ws set
    Btw am sitting in limbus with double weather up just to test still nothing

    sets.precast.WS['Leaden Salute'] = {ammo=gear.MAbullet,
    head="Uk'uxkaj Cap",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Moonshade Earring",
    body="Lanun Frac",hands="Thurandaut gloves +1",ring1="Stormsoul Ring",ring2="Stormsoul Ring",
    back="Gunslinger's cape",waist=gear.ElementalObi,legs="Shneddick tights +1",feet="Wayfarer clogs"}

  10. #2310
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    By "at all" do you mean with and without appropriate day/weather? I assume you have the appropriate obi in inventory or wardrobe. Please explain exactly how you're testing the setup. Also, you are using //gs showswaps to see the gear that's being equipped, right? Have you tried turning on //gs debugmode to see what gear is -not- being equipped?

  11. #2311
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    its changing everything except teh waist the waist slot is staying in my tp shot belt as for testing im engaged with my back turned n hitting my ws macro
    as for //ga showswaps i didnt know that existed i just switched to gearswap

  12. #2312
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    [00:11:09]----------------------------------------------------------------
    [00:11:13]------------------------- precast -------------------------
    [00:11:13]head Uk'uxkaj Cap
    [00:11:13]legs Shned. Tights +1
    [00:11:13]ammo Bronze Bullet
    [00:11:13]left_ring Stormsoul Ring
    [00:11:13]body Lanun Frac
    [00:11:13]back Gunslinger's Cape
    [00:11:13]neck Stoicheion Medal
    [00:11:13]right_ear Moonshade Earring
    [00:11:13]hands Thur. Gloves +1
    [00:11:13]left_ear Hecate's Earring
    [00:11:13]right_ring Stormsoul Ring
    [00:11:13]feet Wayfarer Clogs
    [00:11:13]----------------------------------------------------------------



    not even attempting to change the waist

  13. #2313
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    1) Turn on debugmode: //gs debugmode

    That will show you what gear was -not- equipped, if it tried to equip something you don't have in your inventory.

    2) Was that test with or without dark weather?

    3) What (if anything) have you defined for gear.default.obi_waist? (Note: Was a typo in my above example code; it referenced Soil Gorget when it should have been Soil Belt)

  14. #2314
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    [00:20:50]Default precast set selection for Leaden Salute : sets.precast.WS["Leaden Salute"]
    [00:20:50]------------------------- precast -------------------------
    [00:20:50]back Gunslinger's Cape
    [00:20:50]left_ear Hecate's Earring
    [00:20:50]neck Stoicheion Medal
    [00:20:50]feet Wayfarer Clogs
    [00:20:50]legs Shned. Tights +1
    [00:20:50]ammo Bronze Bullet
    [00:20:50]hands Thur. Gloves +1
    [00:20:50]body Lanun Frac
    [00:20:50]----------------------------------------------------------------
    [00:20:50]GearSwap (Debug Mode): Entering midcast


    this is what debugmode is showing 2. double dark weather i am inside Apolloyn 3. the default was set to windbuffet belt just so id know it was working

  15. #2315
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    minor update the windbuffet is kicking in now so i know the default is working but with double dark weather up it still is not equipping my Anrin Obi


    (eddit)
    the default issue was my own stupidity (had the include/global files in the data folder didnt know they should have been in the libs) but that still leaves the Anrin not equipping with double weather up idk where to go from here~

  16. #2316
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Just ran a quick test with Wildfire and Firestorm as cor/sch, and it worked fine with the Karin Obi. Let me check on if double weather might affect it differently.

  17. #2317
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    i just ran out to the mire was single dark weather up so i did 3 ws's with leaden salute it used my default waist still no obi.. maby its just a bug with the anrin ?

    [01:00:05]The Marsh Murre takes 97 points of damage.
    [01:00:05]GearSwap (Debug Mode): Entering pretarget
    [01:00:05]GearSwap (Debug Mode): Entering precast
    [01:00:05]Default precast set selection for Leaden Salute : sets.precast.WS["Leaden Salute"]
    [01:00:05]------------------------- precast -------------------------
    [01:00:05]waist Soil Belt
    [01:00:05]head Uk'uxkaj Cap
    [01:00:05]legs Shned. Tights +1
    [01:00:05]ammo Bronze Bullet
    [01:00:05]left_ring Stormsoul Ring
    [01:00:05]body Lanun Frac
    [01:00:05]back Gunslinger's Cape
    [01:00:05]neck Stoicheion Medal
    [01:00:05]right_ear Moonshade Earring
    [01:00:05]hands Thur. Gloves +1
    [01:00:05]left_ear Hecate's Earring
    [01:00:05]right_ring Stormsoul Ring
    [01:00:05]feet Wayfarer Clogs
    [01:00:05]----------------------------------------------------------------
    [01:00:05]GearSwap (Debug Mode): Entering midcast
    [01:00:06]Orthanc readies Leaden Salute.
    [01:00:06]GearSwap (Debug Mode): Entering aftercast
    [01:00:06]Default aftercast set selection for Leaden Salute : sets.engaged.Ranged
    [01:00:06]------------------------- aftercast -------------------------

  18. #2318
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    OK, found out why it's not equipping the proper gear, but now I'm stuck on exactly what's going on.

    Seems that GearSwap's weather information is all screwed up. If you check the current weather (//gs eval print_set(world), if debugmode is on), I get Earth weather when there's no weather present (outside in sea), as well as Earth weather when there's Dark weather (in Apollyon zone).

    So, as long as the default gear is working, everything's fine in my include libraries. Just have to figure out what's going on with weather, now, before it will equip the proper obi.

  19. #2319
    RIDE ARMOR
    Join Date
    Jul 2014
    Posts
    10
    BG Level
    1

    at least you found the problem lol thats a + in my book

  20. #2320
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by dlsmd View Post
    Code:
    	if midaction() or pet_midaction() then
    		cancel_spell()
    		return
    	end
    this would stop gearswap from doing anything beyond and it cancel any spell you try to cast if your casting or your pet is casting
    the best place to put it is at the top of your precast
    Tried this finally and it worked like a charm, thanks dlsmd!
    I noticed a strange thing happening though, it was my first time playing as SCH after patch so I'm not sure if this is the cause.
    Basically I noticed that a couple of times I was unable to use certain spells or mainly JAs. Like stratagems and Dark Arts.
    I was pressing the macro and nothing would happen, no error, no swap, nothing.
    I had to manually use the JA/spell from the menu or type the full form (/ja name <me>) for it to finally work and get out of this "lock".

    Again: maybe it has nothing to do with this new rule, and it only happened to me a few times, but it was like sometimes when I was interrupting an action (by moving or getting interrupted) I was entering a "lock" status and had to what I described above to get out of it.
    It's... hard to explain.
    Am I being paranoid and this was caused by lag, Shortcuts or other addons, or could it be something related to this new rule I added to my GS SCH lua?

Page 116 of 302 FirstFirst ... 66 106 114 115 116 117 118 126 166 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45