Jump to content


Photo

How to set Keybind cycle through Gear sets

keybindgearset cycle

Best Answer sdahlka , 01 July 2015 - 01:39 PM

yes if you want to cycle through the gear while in battle as in change the gear on the fly

but if you use "gs c cycleengaged" even outside of battle it will autoequip your engaged set

function self_command(command)
    if command == "cycleengaged" then
        engaged_set_typs_count = (engaged_set_typs_count % #engaged_set_typs) + 1
        equip(sets.engaged[engaged_set_typs[engaged_set_typs_count]])
    end
end
Go to the full post


    4 replies to this topic

    #1 phoenixjasper

    phoenixjasper

      Member

    • Members
    • PipPip
    • 11 posts

      Posted 01 July 2015 - 12:02 AM

      I am hoping to find a quick explanation for how to cycle through gear sets using a keybind.  I've tried using the guide here and here, but have been unable to create anything that works.  Below is my code I've been using.  I apologize as it is extremely basic and I am still learning how to use .lua.  I only want to cycle between sets.engaged.Tank and sets.engaged.Tank.Safe using the keybind (I think F9 is the popular choice).

       

      function get_sets()
          sets.aftercast = {}
      	sets.aftercast.Resting = {body="",waist="",neck=""}
      	
      	sets.idle = {}
      	sets.idle.Town = {ammo="",
      			head="Panther mask +1",neck="Spike Necklace",ear1="Brutal Earring",ear2="Fowling earring",neck="Spike Necklace",
      			body="Royal Guard Livery",hands="Gothic gauntlets",ring1="San D'Orian Ring",ring2="Bastokan ring",
      			back="Fourth Mantle",waist="Ninurta's sash",Feet="Hermes' Sandals +1"}
      
      	sets.precast = {}
      	sets.precast.RNG = {}
      	
      	sets.precast.STR = {}
      
      	sets.precast.Provoke = {head="Iron Ram Sallet",waist="Warwolf Belt",body="Fighter's lorica",ring1="Mermaid's ring",ring2="Hercules' ring",
      		ear1="Hades earring +1",ear2="Hades earring +1",hands="Gothic gauntlets",back="Toreador's cape",legs="Iron Ram Hose",feet="Hermes' Sandals +1"}
      	
      	sets.precast.WS = {main="",sub="",
              head="Ares' Mask",neck="Bull Necklace",ear1="Brutal Earring",ear2="Fowling Earring",
              body="Ares's cuirass",hands="Ares' Gauntlets",ring1="Flame Ring",ring2="Flame Ring",
              back="Amemet Mantle +1",waist="Grenadier Belt",legs="Hachiryu Haidate",feet="Fighter's Calligae"}
      	
      	sets.precast.WSpm = {main="",sub="",
              head="Ares' Mask",neck="Bull Necklace",ear1="Brutal Earring",ear2="Vampire Earring",
              body="Ares's cuirass",hands="Ares' Gauntlets",ring1="Flame Ring",ring2="Flame Ring",
              back="Amemet Mantle +1",waist="Grenadier Belt",legs="Hachiryu Haidate",feet="Fighter's Calligae"}
      	
      	sets.engaged = {}
      	sets.engaged.Tank = {sub="",
      			head="Walahra turban",neck="Berserker's Torque",ear1="Brutal Earring",ear2="Fowling Earring",
      			body="Hachiryu haramaki",hands="Ares' Gauntlets",ring1="Soldier's ring",ring2="Headsman's ring",
      			back="Fourth Division Mantle",waist="Ninurta's sash",legs="Byakko's Haidate",feet="Fighter's Calligae"}
      	sets.engaged.Tank.Safe = set_combine(sets.engaged.Tank, {neck="Spike Necklace",ring1="Mars's Ring"})
      	
      	
      	end
      	
      
      
      function status_change(new,old)
          if new=='Engaged' then
      		equip(sets.engaged.Tank)
      	elseif new=='Resting' then
      		equip(sets.aftercast.Resting)
      	elseif new=='Idle' then
              idle()
      	end
      end
      
      function precast(spell)	
      	if spell.english == 'Provoke' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Warcry' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Hasso' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Aggressor' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Retaliation' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Defender' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Warding Circle' then
      		equip(sets.precast.Provoke)
      	end
      	
      	if spell.action_type == 'Ranged Attack' then
      		equip(sets.precast.RNG)
      	elseif spell.type == 'WeaponSkill' and world.time >= 17*60 or world.time < 7*60 then
      		equip(sets.precast.WSpm)
      	elseif spell.type == 'WeaponSkill' then
      		equip(sets.precast.WS)
      	end
      end
      
      function midcast(spell)	
      	if spell.english=='Provoke' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Warcry' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Hasso' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Aggressor' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Retaliation' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Defender' then
      		equip(sets.precast.Provoke)
      	elseif spell.english == 'Warding Circle' then
      		equip(sets.precast.Provoke)
      	end	
      	
      	if spell.action_type == 'Ranged Attack' then
      		equip(sets.precast.RNG)
      	elseif spell.type == 'WeaponSkill' and world.time >= 17*60 or world.time < 7*60 then
      		equip(sets.precast.WSpm)
      	elseif spell.type == 'WeaponSkill' then
      		equip(sets.precast.WS)
      
      	end
      end	
      
      
      	
      function aftercast(spell)	
      	if spell.english~='Spirit Link' and player.status == 'Engaged' then
      		equip(sets.engaged.Tank)
      	else equip(sets.idle.Town)
      	end	
      	
      	if spell.action_type=='Ranged Attack' then
      		equip(sets.engaged.Tank)
      	end
      	
      	if spell.type == 'WeaponSkill' then
      		equip(sets.engaged.Tank)
      	end
      
      end
      
      	
      function idle()
          equip(sets.idle.Town)
         	end
      


      #2 sdahlka

      sdahlka

        Advanced Member

      • Members
      • PipPipPip
      • 324 posts

        Posted 01 July 2015 - 12:22 AM

        here is a simple example

        just use "gs c cycleengaged"  to cycle through the different sets

        sets.engaged.tank = {}
        sets.engaged.tank_safe = {}
        engaged_set_typs = {"tank","tank_safe"}
        engaged_set_typs_count = 1
        function status_change(new,old)
            if new=='Engaged' then
                equip(sets.engaged[engaged_set_typs[engaged_set_typs_count]])
            elseif new=='Resting' then
                equip(sets.aftercast.Resting)
            elseif new=='Idle' then
                idle()
            end
        end
        
        
        function self_command(command)
            if command == "cycleengaged" then
                engaged_set_typs_count = (engaged_set_typs_count % #engaged_set_typs) + 1
            end
        end
        

        • phoenixjasper likes this

        #3 phoenixjasper

        phoenixjasper

          Member

        • Members
        • PipPip
        • 11 posts

          Posted 01 July 2015 - 01:13 PM

          I sincerely apologize.  After I added your code, I think I may be screwing this up still.  

           

          When I input //gs c cycleengaged, I have to be disengaged.  And when I re-engage, only then it will cycle to the next gear set.  In other words, I cannot cycle through gear sets if I am actually engaged and fighting a mob.  Did I do everything correctly if this is what happens?

           

          Thanks so much again for your time.

           

          here is a simple example

          just use "gs c cycleengaged"  to cycle through the different sets



          #4 sdahlka

          sdahlka

            Advanced Member

          • Members
          • PipPipPip
          • 324 posts

            Posted 01 July 2015 - 01:39 PM   Best Answer

            yes if you want to cycle through the gear while in battle as in change the gear on the fly

            but if you use "gs c cycleengaged" even outside of battle it will autoequip your engaged set

            function self_command(command)
                if command == "cycleengaged" then
                    engaged_set_typs_count = (engaged_set_typs_count % #engaged_set_typs) + 1
                    equip(sets.engaged[engaged_set_typs[engaged_set_typs_count]])
                end
            end
            

            • phoenixjasper likes this

            #5 phoenixjasper

            phoenixjasper

              Member

            • Members
            • PipPip
            • 11 posts

              Posted 01 July 2015 - 02:38 PM

              Awesome!  Tysm for the help!






              1 user(s) are reading this topic

              0 members, 1 guests, 0 anonymous users