GS And Flurry.

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » FFXI » Jobs » Ranger » GS and Flurry.
GS and Flurry.
 Asura.Hrohj
Offline
Server: Asura
Game: FFXI
Posts: 98
By Asura.Hrohj 2019-11-06 21:25:12
Link | Quote | Reply
 
Tyring to write my own Ranger GS (as in completely; not using different parts from a dozen other peoples' .lua files) and I'm having a bit of trouble. I have this part:

function precast(spell,action)

if spell.english == 'Ranged' then
equip(sets.precastrangedattackTF0)
end

if buffactive['Flurry'] then
equip(sets.precastrangedattackTF1)
end

if buffactive['Flurry II'] then
equip(sets.precastrangedattackTF2)
end

end

F0 works fine. However, even when buffed with Flurry II from a RDM, it still uses the F1 set. I can see that when you manually inspect your buffs, it still says "Flurry" and not "Flurry II", which is what I'm assuming is causing the issue. Is there some work-around for this? I'm stumped.
 Leviathan.Comeatmebro
Offline
Server: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2019-11-06 22:17:25
Link | Quote | Reply
 
Flurry and Flurry 2 are the same buff(which is called Flurry), you need a bit more advanced code to check which spell was last cast on you to be able to differentiate them. The buff icon won't do it, and that's what gearswap is checking.
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 832
By Shiva.Arislan 2019-11-06 22:18:47
Link | Quote | Reply
 
Quote:
I can see that when you manually inspect your buffs, it still says "Flurry" and not "Flurry II", which is what I'm assuming is causing the issue.

Bingo.

The only way to automatically differentiate between states of Flurry (and Haste) is to packet sniff for the spell's unique param.

Otherwise, you gotta set up a manual toggle.
 Asura.Hrohj
Offline
Server: Asura
Game: FFXI
Posts: 98
By Asura.Hrohj 2019-11-06 22:57:49
Link | Quote | Reply
 
One of my friends searched around for me and found that the ID for Flurry is 265 and the ID for Flurry II is 581. When I substituted this into my existing code, it sort of worked, but not really:

if buffactive[265] then
equip(sets.precastrangedattackTF1)
end

if buffactive[581] then
equip(sets.precastrangedattackTF2)
end

Now it's just using my F2 set for both. If I snip out the part concerning buff 265 and my F1 set, it just seems to default to using the F2 set even if I'm being buffed with Flurry and not Flurry II. Is there some way to be more specific to fix this?
 Bahamut.Ivebian
Offline
Server: Bahamut
Game: FFXI
user: Smg1388
Posts: 34
By Bahamut.Ivebian 2019-11-06 23:46:11
Link | Quote | Reply
 
The first flurry effect is a beneficial pathos, has nothing to do with the RDM spells.
 Asura.Hrohj
Offline
Server: Asura
Game: FFXI
Posts: 98
By Asura.Hrohj 2019-11-06 23:56:58
Link | Quote | Reply
 
Can someone smarter than me tell me how to go about finding out the ID for Flurry then? Or just tell me? :(
Offline
Posts: 107
By Unzero 2019-11-07 00:19:24
Link | Quote | Reply
 
Windower\plugins\resources\spells.xml
Offline
Posts: 107
By Unzero 2019-11-07 00:19:56
Link | Quote | Reply
 
<s id="80" index="845" prefix="/magic" english="Flurry" japanese="スナップ" type="WhiteMagic" element="Wind" targets="Self, Party, Ally, NPC" skill="EnhancingMagic" mpcost="40" casttime="3" recast="20" duration="180" alias="" />

<s id="81" index="846" prefix="/magic" english="Flurry II" japanese="スナップII" type="WhiteMagic" element="Wind" targets="Self, Party, Ally, NPC" skill="EnhancingMagic" mpcost="80" casttime="3" recast="20" duration="180" alias="" />
Offline
Posts: 107
By Unzero 2019-11-07 00:20:46
Link | Quote | Reply
 
845 and 846 for Flurry 1 and 2 respectively
 Leviathan.Comeatmebro
Offline
Server: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2019-11-07 00:21:26
Link | Quote | Reply
 
There is no ID that will differentiate Flurry and Flurry 2 using that function.

You need to track the incoming action packet, record which was last cast on you, and use that to be able to tell the difference.

There may be someone with that code already written, there may not, but that is the only way to do it besides having a manual toggle.
[+]
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 832
By Shiva.Arislan 2019-11-07 00:36:13
Link | Quote | Reply
 
Code
function precast(spell,action)
    if spell.action_type == 'Ranged Attack' then
        if flurry == 2 then
            equip(sets.precastrangedattackTF2)
        elseif flurry == 1 then
            equip(sets.precastrangedattackTF1)
        end
    end
end

Code
function buff_change(name,gain)
    if S{'flurry'}:contains(buff:lower()) then
        if not gain then
            flurry = nil
            add_to_chat(122, "Flurry status cleared.")
        end
    end
end

Code
windower.register_event('action',
    function(act)
        --check if you are a target of spell
        local actionTargets = act.targets
        playerId = windower.ffxi.get_player().id
        isTarget = false
        for _, target in ipairs(actionTargets) do
            if playerId == target.id then
                isTarget = true
            end
        end
        if isTarget == true then
            if act.category == 4 then
                local param = act.param
                if param == 845 and flurry ~= 2 then
                    add_to_chat(122, 'Flurry Status: Flurry I')
                    flurry = 1
                elseif param == 846 then
                    add_to_chat(122, 'Flurry Status: Flurry II')
                    flurry = 2
              end
            end
        end
    end)
[+]
Offline
Posts: 14
By Demhar 2019-11-08 11:58:51
Link | Quote | Reply
 
What about when you have Barrage active? How are you gonna not make it swap to to midshot?
 Shiva.Spynx
Offline
Server: Shiva
Game: FFXI
user: auron86
Posts: 350
By Shiva.Spynx 2019-11-08 14:18:34
Link | Quote | Reply
 
Flurry kicks in precast while barrage gear will affect midcast so no issue there.
Offline
Posts: 14
By Demhar 2019-11-13 11:18:06
Link | Quote | Reply
 
.lua:80: attempt to call global 'ChangeGear' (a nil value)


any ideas?



----------------------------------------------------

function get_sets()

-- Preshot --
sets.Preshot1 = {
head="Taeon Chapeau",
neck="Scout's Gorget +2",
body="Amini caban +1",
hands="Carmine Fin. Ga. +1",
back={ name="Belenus's Cape", augments={'"Snapshot"+10',}},
waist="Impulse Belt",
legs="Orion Braccae +3",
feet="Meg. Jam. +2",
}

-- Preshot --
sets.Preshot2 = {
head="Orion beret +3",
neck="Scout's Gorget +2",
body="Amini caban +1",
hands="Carmine Fin. Ga. +1",
back={ name="Belenus's Cape", augments={'"Snapshot"+10',}},
waist="Yemaya Belt",
legs="Adhemar Kecks +1",
feet="Arcadian Socks +3",
}


-- Midshot --
sets.Midshot = {
head="Arcadian Beret +3",
neck="Scout's Gorget +2",
ear1="Dedition Earring",
ear2="Telos Earring",
body="Orion Jerkin +3",
hands="Adhemar Wrist. +1",
ring1="Rajas ring",
ring2="Ilabrat Ring",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
waist="Yemaya belt",
legs="Adhemar Kecks +1",
feet="Adhe. Gamashes +1",
}
-- Barrage --
sets.Barrage = {
head="Orion Beret +3",
neck="Scout's Gorget +2",
ear1="Enervating Earring",
ear2="Telos Earring",
body="Orion Jerkin +3",
hands="Orion Bracers +3",
ring1="Regal Ring",
ring2="Cacoethic Ring +1",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
waist="Kwahu Kachina Belt",
legs="Adhemar Kecks +1",
feet="Orion Socks +3",
}
-- Double Shot --
sets.DoubleShot = {
head="Arcadian Beret +3",
body="Arc. Jerkin +3",
back={ name="Belenus's Cape", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10',}},
feet="Osh. Leggings +1",
}



end


function autoRA()
send_command('@wait 2.5; input /ra <t>')
end

function precast(spell,action)
if spell.english == 'Ranged' then
if buffactive['Flurry II'] then
ChangeGear(sets.Preshot2)
else
ChangeGear(sets.Preshot1)
end
end

function midcast(spell,action)
if spell.english == 'Ranged' then
if state.Buff['Barrage'] then
ChangeGear(sets.Barrage)
elseif state.Buff['Double Shot'] then
ChangeGear(sets.DoubleShot)
else
ChangeGear(sets.Midshot)
end
end

end


function ChangeGear(GearSet)
equipSet = GearSet
equip(GearSet)
end
end
Offline
Posts: 107
By Unzero 2019-11-13 12:28:12
Link | Quote | Reply
 
How are we supposed to know what line 81 is
 Shiva.Spynx
Offline
Server: Shiva
Game: FFXI
user: auron86
Posts: 350
By Shiva.Spynx 2019-11-13 12:47:57
Link | Quote | Reply
 
What's even the point of the changeGear function, just use the 'equip' one directly.
Offline
Posts: 14
By Demhar 2019-11-13 13:24:18
Link | Quote | Reply
 
Unzero said: »
How are we supposed to know what line 81 is

 Asura.Nebohh
Offline
Server: Asura
Game: FFXI
user: Kealohaa
Posts: 52
By Asura.Nebohh 2019-11-13 14:38:50
Link | Quote | Reply
 
Next time just use the syntax:
[ code ] paste your code inside here [ /code ]
Just remove the extra spacing above.
 Asura.Hrohj
Offline
Server: Asura
Game: FFXI
Posts: 98
By Asura.Hrohj 2019-11-13 16:02:38
Link | Quote | Reply
 
Demhar,

Have you verified with //gs showswaps on that the correct gear is swapping for Flurry or Flurry II? From the responses to this thread so far, it seems like if buffactive['Flurry II'] won't work... it's never worked for me so far, anyway.

Also, just try removing this bit and see if it will load:

function autoRA()
send_command('@wait 2.5; input /ra <t>')
end


Also, I thought the consensus was that automated ranged attacks were sort of dumb since they don't ever really account for Rapid Shot activation..?
Offline
Posts: 14
By Demhar 2019-11-13 17:17:04
Link | Quote | Reply
 
Asura.Nebohh said: »
Next time just use the syntax:
[ code ] paste your code inside here [ /code ]
Just remove the extra spacing above.

Thank you!
Offline
Posts: 14
By Demhar 2019-11-13 17:17:34
Link | Quote | Reply
 
Have you verified with //gs showswaps on that the correct gear is swapping for Flurry or Flurry II? From the responses to this thread so far, it seems like if buffactive['Flurry II'] won't work... it's never worked for me so far, anyway.

Also, just try removing this bit and see if it will load:

function autoRA()
send_command('@wait 2.5; input /ra <t>')
end




Thank you! Will test that tonight.
 Shiva.Arislan
Offline
Server: Shiva
Game: FFXI
user: Arislan
Posts: 832
By Shiva.Arislan 2019-11-13 17:44:15
Link | Quote | Reply
 
If you're not sure what you're doing, it would save you (and others) a lot of trouble if you didn't try to write something from scratch.

There's ready-made RNG luas out there. Tinker with those.
 Asura.Hrohj
Offline
Server: Asura
Game: FFXI
Posts: 98
By Asura.Hrohj 2019-11-13 17:56:11
Link | Quote | Reply
 
No way to really learn about the way any of this works if people keep pushing pre-fabricated .lua onto us. Some of us don't want all of the bells and whistles.
[+]
Log in to post.