Gearswap Support Thread |
||
Gearswap Support Thread
Ok different approach is all. I am totally stealing your SCH functions though. :P
Fenrir.Brimstonefox
Offline
Just FYI I think I got the stuff working at the top of the previous page.
Short answer put schedule in aftercast like flippant suggested, (I just had to fiddle with the delay since aftercast delay for ws is longer). Then rather than you if/elseif I was able to use if/return (to quit the function early) like Selindrille suggested. Long answer: Code function job_post_aftercast(spell, action, spellMap, eventArgs) -- add_to_chat(7,'post aftercast '..spell.name) if spell.type == 'WeaponSkill' then delay = 4 else delay = 1 end if player.sub_job == 'SAM' then handle_sam_ja:schedule(delay) end if player.sub_job == 'WAR' then handle_war_ja:schedule(delay) end end function handle_sam_ja() if not areas.Cities:contains(world.area) and not (buffactive.Sneak or buffactive.Invisible) then local abil_recasts = windower.ffxi.get_ability_recasts() if state.Stance.value == 'Offensive' then if not buffactive.Hasso and player.status == "Engaged" and abil_recasts[138] == 0 then windower.send_command('@input /ja "Hasso" <me>') return end if player.tp < 400 and abil_recasts[134] == 0 then windower.send_command('@input /ja "Meditate" <me>') return end if player.tp > 2000 and abil_recasts[140] == 0 and player.status == "Engaged" then windower.send_command('@input /ja "Sekkanoki" <me>') return end if not buffactive.ThirdEye and abil_recasts[133] == 0 and player.status == "Engaged" then windower.send_command('@input /ja "Third Eye" <me>') return end end if state.Stance.value == 'Defensive' then if not buffactive.Seigan and abil_recasts[139] == 0 then windower.send_command('@input /ja "Seigan" <me>') return end if not buffactive.ThirdEye and abil_recasts[133] == 0 then windower.send_command('@input /ja "Third Eye" <me>') return end end end end Next question! Bind to cycle through weapons in every set? Is this possible? This is what I have so far. I looked for examples for "Cycle Weapons" and "Gearswap weapon toggle" I came up dry. It sorta works as I can cycle through the weapons but it doesn't update on my character unless I rest or cast or do an action.
Code state.MainWeapon = M{['description']='Staff', 'Lathi_A', 'Lathi_D', 'Grioavolr', 'Boonwell'} Code send_command('bind ^f gs c cycle MainWeapon') Code ---------------------------------------------------------------- -- Select Main Weapon for all sets ---------------------------------------------------------------- main_weapon() Code ---------------------------------------------------------------- -- Weapons ---------------------------------------------------------------- gear.Grioavolr = {name="Grioavolr", augments={stuff}} gear.Lathi_A = {name="Lathi", augments={stuff}} gear.Lathi_D = {name="Lathi", augments={stuff}} gear.Boonwell = {main="Boonwell Staff"} gear.MainWeapon = gear.Lathi_A Code main=gear.MainWeapon Code function job_update(cmdParams, eventArgs) main_weapon() end Code ---------------------------------------------------------------------------- -- Cycle between different Main Weapons to suit situation ---------------------------------------------------------------------------- function main_weapon() if state.MainWeapon.value == 'Lathi_A' then gear.MainWeapon.name = gear.Lathi_A end if state.MainWeapon.value == 'Lathi_D' then gear.MainWeapon.name = gear.Lathi_D end if state.MainWeapon.value == 'Grioavolr' then gear.MainWeapon.name = gear.Grioavolr end if state.MainWeapon.value == 'Boonwell' then gear.MainWeapon.name = gear.Boonwell end end You would need to make sure that
But I'm skeptical about any of that working as intended. First, your Boonwell is using 'main' as the index instead of 'name.' Second, you're setting the 'name' index of gear.MainWeapon equal to a table. Third, you're using a variable that's pointing to another table in memory, so you're actually changing the value of gear.Lathi_A.name each time you go through main_weapon(). In fact, you're going to end up with an inception of tables if you don't change the value. Your table would look like each of these upon load, first call, and second call: {name="Lathi", augments={stuff}} {name={name="Lathi", augments={stuff}}, augments={stuff}} {name={name={name={name="Lathi", augments={stuff}}, augments={stuff}}, augments={stuff}}, augments={stuff}} You need to make sure that gear.MainWeapon is its own table, which can have the same values as your current Lathi_A table. Code gear.Grioavolr = {name="Grioavolr", augments={stuff}} gear.Lathi_A = {name="Lathi", augments={stuff}} gear.Lathi_D = {name="Lathi", augments={stuff}} gear.Boonwell = {name="Boonwell Staff",augments=nil} gear.MainWeapon = {name="Lathi",augments={stuff}} Then you need to set MainWeapon.name and MainWeapon.augments to point to the associating values. You cannot just point to the table, because the 'main' in your sets is pointing to gear.MainWeapon's table in memory, not the actual variable. Code function main_weapon() if gear[state.MainWeapon.value] then gear.MainWeapon.name = gear[state.MainWeapon.value].name gear.MainWeapon.augments = gear[state.MainWeapon.value].augments end end I'm curious as to why'd you'd need to call a weapon change with a function and not just specify the appropriate weapon in the appropriate set?
That said, if you want the function you wrote to change your weapon to the appropriate one just add this to the function: handle_equipping_gear(player.status) I tried incorporating both suggestions in to a function like so
Code ---------------------------------------------------------------------------- -- Cycle between different Main Weapons to suit situation ---------------------------------------------------------------------------- function main_weapon() if gear[state.MainWeapon.value] then gear.MainWeapon.name = gear[state.MainWeapon.value].name gear.MainWeapon.augments = gear[state.MainWeapon.value].augments handle_equipping_gear(player.status) end end I corrected the above variables. Code ---------------------------------------------------------------- -- Cycle Weapons in any set ---------------------------------------------------------------- state.MainWeapon = M{['description']='Staff', 'Lathi_A', 'Boonwell'} Code ---------------------------------------------------------------- -- Weapons ---------------------------------------------------------------- gear.Lathi_A = {name="Lathi", augments={'MP+80','INT+20','"Mag.Atk.Bns."+20',}} gear.Boonwell = {name="Boonwell Staff",augments=nil} gear.MainWeapon = {name="Lathi", augments={'MP+80','INT+20','"Mag.Atk.Bns."+20',}} Selindrile is right to bring up a question of practicality. I do understand why you wouldn't want to explicitly assign weapons to various sets, since you wouldn't want to lose TP, and because you may want to change just your weapon at any time. But there's plenty of other, simpler ways you could handle it. The easiest (aside from just manually equipping, which I prefer) is to just use the equip function.
Code function main_weapon() if gear[state.MainWeapon.value] then equip(gear[state.MainWeapon.value]) end end And just get rid of the MainWeapon variable altogether. There'd be no reason to try to handle it like Mote handles obi or NIN movement speed since this would apply to all sets. I mean, the way Mote handles it by default is that you can simply hit F9 to lock your weapons (if your offense mode isn't none on a mage, it wont' swap weapons), or you could simply put an exception to disallow weapon swapping if TP is above a certain number, or if a certain mode is active and tp is over a certain number.... I'm just not seeing why this is practical at all.
Its really not practical. I think we can file this in the bin of bad ideas. Thank you for trying to help though.
Ragnarok.Flippant said: » There'd be no reason to try to handle it like Mote handles obi or NIN movement speed since this would apply to all sets. Also trying to enable quick access to significant amounts of MACC without going into a full-on resist set. Think Reisenjima T1 + T2 vs T3 and Helms, Ru'Aun T1-3's vs AA's, Kirin, WoC. Fenrir.Brimstonefox
Offline
I can post links if you're interested but I have a version of Mote's stuff which expects you to put your weapons in your sets (and can be toggled via hot keys)
It disables main/sub/ranged if tp > some threshold (I think i set to 1000 but easy to change, might have to be engaged too) Additionally I have a holdtp toggle (on for melee, off for mages by default) so if I don't want my weapon to change I just turn it on/off. That's what resist modes are -for-? you can go up as many tiers as you like.... why make it just based around the staff?
Hello,
Is someone knows a gearswap rules to equip elementary obi during day/weather for the elementals weaponskill ? Thank you Code sets.ElementalObi = {waist="Hachirin-no-Obi"} if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' and spell.english ~= 'Impact' then if spell.element == world.weather_element or spell.element == world.day_element then equip(sets.ElementalObi) end end Thank you Selindrile,
But i think what you wrote is only for spells, not for weaponskill (i tested Vidohunir(dark elem WS) during dark weather and it doesn't switch my obi) Code sets.ElementalObi = {waist="Hachirin-no-Obi"} if spell.type == "WeaponSkill" then if spell.element == world.weather_element or spell.element == world.day_element then equip(sets.ElementalObi) end end Try that. What would be the best way to write a toggle that would equip a set and then immediately un-equip it and put you back in whatever set you were in before the toggle was pushed?
Sorcerers Ring activation. I have a clunky way of doing it through the idle modes but is there a better way? Phoenix.Keido said: » Code sets.ElementalObi = {waist="Hachirin-no-Obi"} if spell.type == "WeaponSkill" then if spell.element == world.weather_element or spell.element == world.day_element then equip(sets.ElementalObi) end end Try that. Thank you that's ok ! Phoenix.Keido said: » What would be the best way to write a toggle that would equip a set and then immediately un-equip it and put you back in whatever set you were in before the toggle was pushed? Sorcerers Ring activation. I have a clunky way of doing it through the idle modes but is there a better way? Once again it would probably be better to automate sorc ring in post_midcast, nested into your other checks, but the line itself simply: Code sets.SorcRing = {ring2="Sorcerer's Ring"} if player.hpp < 75 then equip(sets.SorcRing) end Just make sure you get your replacements done in least important > most important, like put archon ring last in these replacements so it's the one that gets equipped in the case of dark magic, as it's the most important peice. Though I just thought about it, this doesn't take into account the fact that Sorcerer's Ring Does not take gear that "Converts HP to MP", Max HP Boost or Max HP Down into account... but does take HP+ into account... so I'm not quite sure how to account for that, actually. Hi
I am having some issues with equipment during magic casting. In particular I wish to equip the pavor gauntlets and the Chuparrosa mantle for my absorbs. And the Fallen finger gauntlets+1 paired with my Niht mantle for my drains. I have kept the lua to simple sets for now. I will update precast6 sets etc later when this works. Can anyone show me my errors please Code sets.Precast = {} -- Fastcast Set -- sets.Precast.FastCast = { ammo="Seeth. Bomblet +1", head="Pixie Hairpin +1", body={ name="Found. Breastplate", augments={'Accuracy+10','Attack+9','"Mag.Atk.Bns."+9',}}, hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, legs="Heath. Flanchard +1", feet={ name="Odyssean Greaves", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon Skill Acc.+14','AGI+2','Mag. Acc.+15',}}, neck="Dark Torque", waist="Casso Sash", left_ear="Dark Earring", right_ear="Abyssal Earring", left_ring="Evanescence Ring", right_ring="Archon Ring", back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} } -- Precast Dark Magic -- sets.Precast['Dark Magic'] = set_combine(sets.Precast.FastCast,{head="Pixie Hairpin +1"}) -- Midcast Base Set -- sets.Midcast = { ammo="Seeth. Bomblet +1", head="Pixie Hairpin +1", body={ name="Found. Breastplate", augments={'Accuracy+10','Attack+9','"Mag.Atk.Bns."+9',}}, hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, legs="Heath. Flanchard +1", feet={ name="Odyssean Greaves", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon Skill Acc.+14','AGI+2','Mag. Acc.+15',}}, neck="Dark Torque", waist="Casso Sash", left_ear="Dark Earring", right_ear="Abyssal Earring", left_ring="Evanescence Ring", right_ring="Archon Ring", back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} } -- Magic Haste Set -- sets.Midcast.Haste = set_combine(sets.PDT,{}) -- Dark Magic Set -- sets.Midcast['Dark Magic'] = { ammo="Seeth. Bomblet +1", head="Pixie Hairpin +1", body={ name="Found. Breastplate", augments={'Accuracy+10','Attack+9','"Mag.Atk.Bns."+9',}}, hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, legs="Heath. Flanchard +1", feet={ name="Odyssean Greaves", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon Skill Acc.+14','AGI+2','Mag. Acc.+15',}}, neck="Dark Torque", waist="Casso Sash", left_ear="Dark Earring", right_ear="Abyssal Earring", left_ring="Evanescence Ring", right_ring="Archon Ring", back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} } -- Stun Sets -- sets.Midcast.Stun = set_combine(sets.Midcast['Dark Magic'],{}) sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{}) sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{}) -- Endark Set -- sets.Midcast.Endark = set_combine(sets.Midcast['Dark Magic'],{}) -- Enfeebling Magic Set -- sets.Midcast['Enfeebling Magic'] = {body="Igno. Cuirass +1"} -- Elemental Magic Set -- sets.Midcast['Elemental Magic'] = {} -- Drain Set -- sets.Midcast.Drain = set_combine(sets.Midcast['Dark Magic'],{ hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} }) -- Aspir Set -- sets.Midcast.Aspir = set_combine(sets.Midcast['Dark Magic'],{ hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} }) -- Absorb Set -- sets.Midcast.Absorb = set_combine(sets.Midcast['Dark Magic'],{ hands="Pavor Gauntlets", feet={ name="Odyssean Greaves", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon Skill Acc.+14','AGI+2','Mag. Acc.+15',}}, back="Chuparrosa Mantle", }) -- Dread Spikes Set -- sets.Midcast['Dread Spikes'] = { ammo="Seeth. Bomblet +1", head="Pixie Hairpin +1", body="Heath. Cuirass +1", hands={ name="Fall. Fin. Gaunt. +1", augments={'Enhances "Diabolic Eye" effect',}}, legs="Crimson Cuisses", feet={ name="Odyssean Greaves", augments={'Mag. Acc.+14 "Mag.Atk.Bns."+14','Weapon Skill Acc.+14','AGI+2','Mag. Acc.+15',}}, neck="Sanctity Necklace", waist="Casso Sash", left_ear="Dark Earring", right_ear="Abyssal Earring", left_ring="Evanescence Ring", right_ring="Archon Ring", back={ name="Niht Mantle", augments={'Attack+11','Dark magic skill +7','"Drain" and "Aspir" potency +24','Weapon skill damage +2%',}} } end function pretarget(spell,action) if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced -- cancel_spell() send_command('input /item "Echo Drops" <me>') 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.english == "Meditate" and player.tp > 2990 then -- Cancel Meditate If TP Is Above 290 -- cancel_spell() add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]') 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 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 == "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 Attack == 'ON' then equipSet = equipSet["ATT"] end if equipSet[AccArray[AccIndex]] then equipSet = equipSet[AccArray[AccIndex]] end if spell.english == "Catastrophe" and (world.day_element == 'Dark' or world.day_element == 'Earth') and Mekira == 'ON' then -- Equip Mekira-oto +1 On Darksday or Earthsday -- equipSet = set_combine(equipSet,{head="Mekira-oto +1"}) end if spell.english == "Resolution" or spell.english == "Entropy" then if spell.english == "Resolution" and (world.day_element == 'Thunder' or world.day_element == 'Wind' or world.day_element == 'Earth') and Mekira == 'ON' then -- Equip Mekira-oto +1 On Lightningday or Windsday or Earthsday -- equipSet = set_combine(equipSet,{}) elseif spell.english == "Entropy" and (world.day_element == 'Dark' or world.day_element == 'Earth' or world.day_element == 'Water') and Mekira == 'ON' then -- Equip Mekira-oto +1 On Darksday or Earthsday or Watersday -- equipSet = set_combine(equipSet,{}) end if player.tp > 299 or buffactive.Sekkanoki then -- Equip Bale Earring When You Have 300 TP or Sekkanoki -- equipSet = set_combine(equipSet,{ear1="Bale Earring"}) end end equip(equipSet) end elseif spell.type == "JobAbility" then if sets.JA[spell.english] then equip(sets.JA[spell.english]) end elseif spell.action_type == 'Magic' 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 spell.english == "Stun" then if buffactive.Hasso or buffactive.Seigan then -- Cancel Hasso or Seigan When You Use Stun -- cast_delay(0.2) send_command('cancel Hasso,Seigan') end equip(sets.Precast.FastCast) 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.name .. ' 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 == "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') end if Twilight == 'Twilight' then equip(sets.Twilight) 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,'Absorb') then if buffactive["Dark Seal"] then -- Equip Aug'd Abs. Burgeonet +2 When You Have Dark Seal Up -- equipSet = set_combine(equipSet,{back="Chuparrosa Mantle",}) end elseif string.find(spell.english,'Drain') or string.find(spell.english,'Aspir') or string.find(spell.english,'Bio') then if world.day == "Darksday" or world.weather_element == "Dark" then -- Equip Anrin Obi On Darksday or Dark Weather -- equipSet = set_combine(equipSet,{waist="Hachirin-no-Obi"}) end elseif spell.english == "Stoneskin" then if buffactive.Stoneskin then send_command('@wait 1.7;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,'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[AccArray[AccIndex]] then equipSet = equipSet[AccArray[AccIndex]] end if equipSet[spell.skill] then equipSet = equipSet[spell.skill] end if equipSet[spell.type] then equipSet = equipSet[spell.type] end end elseif equipSet[spell.english] then equipSet = equipSet[spell.english] end equip(equipSet) end Check your midcast function. The if/then block checks for Absorbs, but it doesn't set the proper gearset.
Something like this would allow sets.Midcast.Absorb to be equipped. Code if string.find(spell.english,'Absorb') then equipSet = equipSet.Absorb elseif ..... The same goes for Drain/Aspir. Your lua has a rule to equip an Obi, but nothing to assign gearsets. (beyond sets.Midcast) You would fix that the same way. I am getting an error stating
'end' expected (to close 'function' at line 1033) near 'else if' Code function midcast(spell,action) equipSet = {} if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then equipSet = sets.Midcast if string.find(spell.english,'Absorb') then equipSet = equipSet.Absorb end elseif string.find(spell.english,'Drain') or string.find(spell.english,'Aspir') or string.find(spell.english,'Bio') then equipSet = equipSet.Drain end elseif spell.english == "Stoneskin" then if buffactive.Stoneskin then send_command('@wait 1.7;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,'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[AccArray[AccIndex]] then equipSet = equipSet[AccArray[AccIndex]] end if equipSet[spell.skill] then equipSet = equipSet[spell.skill] end if equipSet[spell.type] then equipSet = equipSet[spell.type] end end elseif equipSet[spell.english] then equipSet = equipSet[spell.english] end equip(equipSet) end Do i need to type end twice? Please advise and explain the meaning of what it's trying to do thanks Ok got it to work by removing the end in the command on line 7 and 10
Siren.Bloodlusty said: » Ok got it to work by removing the end in the command on line 7 and 10 Cool, yeah that was the issue. Here is a little pseudo-code example, to simplify what is going on in your midcast. -- create empty gear set equipSet -- test if we're casting magic if spell == 'magic' then -- assign our default magic gear set to the empty set we created equipSet = sets.Midcast -- if we're casting Absorb, we point our set to a more specific gear set equipSet = sets.Midcast.Absorb -- if we're casting Drain or Aspir we change the set equipSet = sets.Midcast.Drain -- here we end the "casting magic test we did earlier end -- finally, we equip the set, whatever it may be. equip(equipSet) Quetzalcoatl.Orestes said: » Cool, yeah that was the issue. Here is a little pseudo-code example, to simplify what is going on in your midcast. -- create empty gear set equipSet -- test if we're casting magic if spell == 'magic' then -- assign our default magic gear set to the empty set we created equipSet = sets.Midcast -- if we're casting Absorb, we point our set to a more specific gear set equipSet = sets.Midcast.Absorb -- if we're casting Drain or Aspir we change the set equipSet = sets.Midcast.Drain -- here we end the "casting magic test we did earlier end -- finally, we equip the set, whatever it may be. equip(equipSet) Thanks man :) Offline
I'm getting ready to redo my PLD script and was wondering if there was a way to set up a cure cheat rule. Preferably, I'd like it to fire off if my HP is above a certain percentage.
Is there a way to detect if you have a debuff active on you from Gearswap such as Doom and if so equip sets to help with removal of this?
Arona said: » I'm getting ready to redo my PLD script and was wondering if there was a way to set up a cure cheat rule. Preferably, I'd like it to fire off if my HP is above a certain percentage. Exemple: Code if player.hpp >90 then equip(sets.midcast.CureCheat) end That would switch to your cure cheat set if your HP is over 90% So the whole rule would be: Code if string.find(spell.english, 'Cure') then if player.hpp >90 and spell.target.type == 'Self' then equip(sets.midcast.CureCheat) else equip(sets.midcast.Cure) end end Asura.Brennski said: » Is there a way to detect if you have a debuff active on you from Gearswap such as Doom and if so equip sets to help with removal of this? Using buffactive would be my guess paired with status change, altho I am not sure if doom debuff is seen as doom, I think it's still under curse, but I would assume it would work regardless. Something like this in aftercast/status change: Code if buffactive['Curse'] then equip(sets.aftercast.Doom) status_change(player.status) end Do not put status_change line in the status_change fonction, only in aftercast. Having a status change category in your lua is mandatory for this to work though. It will look for constant change but if you put it aftercast only without a status change, it will only switch gears after you done an action. PS: That rule would be slightly annoying with Yakshi because of the Curse aura, so be warned. I am just unsure if Doom debuff is seen as doom or curse. If it's wrote as doom than change the buffactive['Curse'] for buffactive['Doom']. The status is called doom. So buffactive.Doom or buffactive['Doom']. And calling status_change would probably overwrite the equip change unless it was already in that statuts_change function, in which case there'd be no need to check from aftercast.
But definitely should put it in buff_change function so that it doesn't rely on an action occuring to register the check (or call statuts_change from buff_change, but I can't guarantee that the buffactive table is updated at the time in the procedure). Code function buff_change(buff,gain,bufftable) if buff:lower()=="doom" and gain then --equip gear end end |
||
All FFXI content and images © 2002-2024 SQUARE ENIX CO., LTD. FINAL
FANTASY is a registered trademark of Square Enix Co., Ltd.
|