Jump to content


Photo

Gearswap to deal with level Synch


    6 replies to this topic

    #1 bruced

    bruced

      Newbie

    • Members
    • Pip
    • 4 posts

      Posted 03 February 2016 - 07:26 PM

      I have been trying to write a simple routine in gearswap that will lower a spell tier automatically if I'm party synced below it's available level, For instance, as a 47 BLM, I have Fire II available to me but if I party sync to level 18 in the dunes only Fire, is available to me. Which is all well fine and dandy to edit a single macro but I don't want to edit an entire macro palette just for few hours in a level sync party or something like that.

       

      Below is what I thought might do the trick but it doesn't work... Any suggestions on how to achieve what I'm talking about here?

       

      if spell.english:startswith('Fire')and spell.interrupted then

              if spell.english:endswith('IV')then
                  send_command('@input /ma "Fire III" <t>')
              elseif spell.english:endswith('III')then
                  send_command('@input /ma "Fire II" <t>')
              elseif spell.english:endswith('II')then
                  send_command('@input /ma "Fire" <t>')
              end
          end
       
      And obviously, Stone, Water, Aero, Blizzard, and Thunder for the other spells.
       
      Thanks,
      Bruce


      #2 sdahlka

      sdahlka

        Advanced Member

      • Members
      • PipPipPip
      • 324 posts

        Posted 04 February 2016 - 01:42 PM

        I have been trying to write a simple routine in gearswap that will lower a spell tier automatically if I'm party synced below it's available level, For instance, as a 47 BLM, I have Fire II available to me but if I party sync to level 18 in the dunes only Fire, is available to me. Which is all well fine and dandy to edit a single macro but I don't want to edit an entire macro palette just for few hours in a level sync party or something like that.
         
        Below is what I thought might do the trick but it doesn't work... Any suggestions on how to achieve what I'm talking about here?
         
        if spell.english:startswith('Fire') and spell.interrupted then
                if spell.english:endswith('IV') then
                    send_command('@input /ma "Fire III" <t>')
                elseif spell.english:endswith('III') then
                    send_command('@input /ma "Fire II" <t>')
                elseif spell.english:endswith('II') then
                    send_command('@input /ma "Fire" <t>')
                end
            end
         
        And obviously, Stone, Water, Aero, Blizzard, and Thunder for the other spells.
         
        Thanks,
        Bruce

        here is a quick example (i think it needs to be in filtered_action or precast)

        it changes your fire spell to the highest lvl you can cast

         

        spell_convert = {
            Fire = {"Fire VI","Fire V","Fire IV","Fire III","Fire II","Fire"}
            ...
        }
            if spell_convert[spell.name] then
                local new_spell = spell.name
                local change_spell = false
                for _,v in pairs(spell_convert[spell.element]) do
                    local spelln = gearswap.res.spells:with('name', v)
                    if spelln.levels[player.main_job_id] <= player.main_job_level then
                        new_spell = spelln.name
                        change_spell = true
                        break
                    end
                end
                if change_spell then
                    cancel_spell()
                    send_command('input /ma "'..new_spell..'" '..spell.target.raw)
                    return
                end
            end
         

        its untested so take it with a grain of salt



        #3 bruced

        bruced

          Newbie

        • Members
        • Pip
        • 4 posts

          Posted 05 February 2016 - 02:06 PM

          Unfortunately this didn't seem to work, maybe I put it in the wrong place in my LUA or something. Thanks for giving it a try though.



          #4 sdahlka

          sdahlka

            Advanced Member

          • Members
          • PipPipPip
          • 324 posts

            Posted 05 February 2016 - 02:25 PM

            Unfortunately this didn't seem to work, maybe I put it in the wrong place in my LUA or something. Thanks for giving it a try though.

            try this one it should only trigger on /ma "Fire" or /ma "Blizzard"

             

            spell_convert = {
                trigger_spells = S{"Fire","Blizzard"}--the spells you want to use in your macros go here(to add more just add them)
                ["Fire"] = {"Fire VI","Fire V","Fire IV","Fire III","Fire II","Fire"}--you need a list of all the spell for each spell you use in macro (highest level first)
                ["Blizzard"] = {"Blizzard VI","Blizzard V","Blizzard IV","Blizzard III","Blizzard II","Blizzard"}--this is how you add more spells
            }
                if spell_convert.trigger_spells.contains(spell.name) then
                    local new_spell = spell.name
                    local change_spell = false
                    for _,v in pairs(spell_convert[new_spell]) do
                        local spelln = gearswap.res.spells:with('name', v)
                        if spelln.levels[player.main_job_id] <= player.main_job_level then
                            new_spell = spelln.name
                            change_spell = true
                            break
                        end
                    end
                    if change_spell then
                        cancel_spell()
                        send_command('input /ma "'..new_spell..'" '..spell.target.raw)
                        return
                    end
                end
             


            #5 bruced

            bruced

              Newbie

            • Members
            • Pip
            • 4 posts

              Posted 05 February 2016 - 02:55 PM

              try this one it should only trigger on /ma "Fire" or /ma "Blizzard"

               

              would it work if I used the shortcut plugin/addon and typed /fire or /blizzard?



              #6 sdahlka

              sdahlka

                Advanced Member

              • Members
              • PipPipPip
              • 324 posts

                Posted 05 February 2016 - 10:23 PM

                try this one it should only trigger on /ma "Fire" or /ma "Blizzard"

                would it work if I used the shortcut plugin/addon and typed /fire or /blizzard?

                it should

                the only issue i can think of is if your using motes include

                and thats because i dont know muck about how it works



                #7 bruced

                bruced

                  Newbie

                • Members
                • Pip
                • 4 posts

                  Posted 07 February 2016 - 01:44 PM

                  Do I need to do something special to get them to use them?

                   

                  I don't seem to have any luck getting GS to even work for anything at this point...

                   

                  I have used an example script and plugged in my gear and no gear changes, I even typed //gs r when I zoned and it ackonwledged the file loaded, still nothing.

                   

                  function get_sets()
                  
                  --	sets.precast = {}
                  	
                  --	sets.precast.fc = {sub="Vivid Strap +1",feet="Rostrum Pumps"}
                  -----------------------
                  	sets.midcast = {}
                  	
                  	sets.midcast.ring = {ring1="Sorcerer's Ring"}	
                  	
                  	sets.midcast.earth = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.water = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.wind = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.fire = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.ice = {main="Aquilo's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.thunder = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.dark = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	sets.midcast.light = {main="Chatoyant's Staff",sub="Bugard Strap +1"}
                  	
                  	sets.midcast.nuke ={ammo="Morion Talthum",
                  	head="Seers Crown +1",neck="Solon Torque",ear1="Phantom Earring +1",ear2="Phantom Earring +1",
                  	body="Flora Cotehardie",hands="Marine M Gloves",ring1="Genius Ring +1",ring2="Genius Ring +1",
                  	back="Gramary Cape",waist="Penitent's Rope",legs="Druid's Slops",feet="Mahant Sandals"}
                  -----------------------
                  	sets.aftercast = {}
                          sets.aftercast.engaged = {}
                  
                  	sets.aftercast.idle = {main="Terra's Staff",
                  	body="Royal Cloak", hands="Scentless Armlets",
                  	feet="Custom M Boots"}
                  
                  	sets.aftercast.rest = {main="Chatoyant Staff",sub="Bugard Strap +1",ammo="Morion Talthum",
                  	head="Seers Crown +1",neck="Beak Necklace +1",ear1="Phantom Earring +1",ear2="Phantom Earring +1",
                  	body="Salutary Robe +1",hands="Marine M Gloves",ring1="Genius Ring +1",ring2="Genius Ring +1",
                  	back="Gramary Cape",waist="Penitent's Rope",legs="Druid's Slops",feet="Mahant Sandals"}
                  
                  end
                  
                  -----------------------------------------------------------------------------------
                  
                  --function precast(spell)
                  
                  --	if spell.type:contains('Magic') then
                  --		equip(sets.precast.fc)
                  --	end
                  
                  --end
                  
                  -----------------------------------------------------------------------------------
                  
                  function midcast(spell)
                  
                  	if spell.element == "Earth" then
                  		equip(sets.midcast.earth)
                  	elseif spell.element == "Water" then
                  		equip(sets.midcast.water)
                  	elseif spell.element == "Wind" then
                  		equip(sets.midcast.wind)
                  	elseif spell.element == "Fire" then
                  		equip(sets.midcast.fire)
                  	elseif spell.element == "Ice" then
                  		equip(sets.midcast.ice)
                  	elseif spell.element == "Thunder" then
                  		equip(sets.midcast.thunder)
                  	elseif spell.element == "Dark" then
                  		equip(sets.midcast.dark)
                  	elseif spell.element == "Light" then
                  		equip(sets.midcast.light)
                  	end
                  	
                  	
                  	if spell.skill == "Elemental Magic" then
                  		equip(sets.midcast.nuke)
                  		if player.hpp < 76 and player.tp < 100 then
                  			equip(sets.midcast.ring)
                  		end
                  	end
                  
                  end
                  
                  -----------------------------------------------------------------------------------
                  
                  function aftercast(spell)
                  
                  	if player.status == "Engaged" then
                  		equip(sets.aftercast.engaged)
                  	elseif player.status == "Idle" then
                  		equip(sets.aftercast.idle)
                  	end
                  
                  end
                  
                  -----------------------------------------------------------------------------------
                  
                  function status_change(new,old)
                  
                  	if new == 'Idle' then
                  		equip(sets.aftercast.idle)
                  	elseif new == 'Resting' then
                  		equip(sets.aftercast.rest)
                  	elseif new == 'Engaged' then
                  		equip(sets.aftercast.engaged)
                  	end
                  
                  end
                  
                  -----------------------------------------------------------------------------------
                  
                  function buff_change(name,gain)
                  
                  	if name == "silence" and gain =="True" then
                  		send_command('@input /item "Echo Drops" <me>')
                  	end
                  
                  end
                  
                  -----------------------------------------------------------------------------------
                  





                  1 user(s) are reading this topic

                  0 members, 1 guests, 0 anonymous users