Err... the latter is more accurate. Equipment window will miss things.
Err... the latter is more accurate. Equipment window will miss things.
i have seen both miss gearswap
equipwindow:
misses fast gearchanges(like when your doing JA'S)
show_swaps:
will sometimes say a piece of gear is swapped but it actually is not (i know this for a fact w=because of my sleep buff gear change, this one is so random that it might take 100 swaps to show when the gear does not change)
here is my sleep buff code
Code:sets.sleep = {neck="Opo-opo Necklace",back="Aries Mantle"} function buff_change(name,gain) sleepset(name,gain) end function sleepset(name,gain) if name == "sleep" then if gain then enable("neck","back") equip({neck="Opo-opo Necklace",back="Aries Mantle"}) disable("neck","back","main","sub","range","ammo") else enable("neck","back","main","sub","range","ammo") equip(sets[player.status]) end end end function midcast(spell) gearchang_stopper(spell) end function aftercast(spell) gearchang_stopper(spell) equip(sets[player.status]) end function gearchang_stopper(spell) if buffactive['sleep'] then return end end
showswaps should print out the set just before the equip packets are sent, so if the gear doesn't swap then the server is rejecting the attempt to swap gear for some reason.
is there a way to add to a list
i.e
this way i can build a list of things dynamically while gearswap is runningCode:mylist = {} if not mylist:contains(spell.name) then if -- check something then --do something elseif --check something then --do something else --add spell name to the list of spells (this is what i need to figure out) end else --do something end
would it be something like or something els
mylist = mylist + ["spell.name"]
Yeah.
Mylist = L{}
Mylist:append(spell.name)
I wanted to say a (very) late thank you for this and the link to your GearSwap for BRD - between that and the pretarget hint I was able to get something working in Mote's LUA. It has served me well for a few months now!
I do seem to run into the Pianissimo-loop issue sometimes, though. To me, it always seems to happen if Pianissimo tries to fire (whether via auto-Pianissimo or pressing it manually) but is unable to go off due to either having just finished a spell and not enough time has passed yet for another action, OR Pianissimo itself is not back up yet and is still waiting on recast. If Pianissimo attempts to fire under either of these conditions, I almost always end up in the Pianissimo-loop.
Anyways, there are a lot of helpful people in this thread, and I think that is awesome ^^b.
I don't really use gearswap, but this is a gear question, and I'm actually not quite sure which way to turn, I would test it myself but the way the naakual gear augments work atm, I'm not quite sure i have the time.
On RDM, atm I nuke my Tier 2 spells in Artsieq Cap with +7 INT & +20 MAB augment. I finally grabbed a Buremete Hat and tested the 2 of them while doing Hurkan last night. Artsieq Cap with the augment was doing 2404 Stone II unresisted to Hurkan with my current gear, when i swapped to Buremte Hat with no augments I was doing 2385. The difference between the two is +35 Magic Damage vs +2 INT/+20 MAB. Considering how much Magic Damage is on the Buremte Hat and it still came out a little under the Artsieq Cap I'm kind of up in there air atm whether to get the +8 INT augment or the +4 Magic Damage augment, based on the numbers I saw my gut is leaning towards the +8 INT augment, but trying to get some verification before I choose. Is there anyone that knows mathematically which augment would be better on ilvl targets?
Also those numbers were before gain int. +25 int boosted that by another 220ish damage
Can cast_delay be dynamically changed after its been set? IE
if not buffactive[x] then
cast_delay(1.5)
command
end
if not buffactive[y] then
cast_delay(3)
command
end
Or will I need to calculate all the delays first that are needed and then set that?
or more likely like thisCode:if not buffactive[x] then cast_delay(1.5) elseif not buffactive[y] then cast_delay(3) end
the second one will only add the cast delay if a specific buff is activeCode:if buffactive[a] then cast_delay(3) elseif buffactive[b] then cast_delay(1.5) end
or you could do it this way
if you wanted to add up the cast delays you would do it like thisCode:local castpause = 0 if not buffactive[x] then castpause = 1.5 end if not buffactive[y] then castpause = 3 end cast_delay(castpause)
but if you want to change the cast_delay that was set during pretarget and precast after precast as far as i know you cantCode:local castpause = 0 if not buffactive[x] then castpause + 1.5 end if not buffactive[y] then castpause + 3 end cast_delay(castpause)
Could someone help me with ws variables? I know it don't look like the best method, but for example when I Fudo at 3000 tp I would like it to use my Fudo variable with Flame pearl or else use the normal Fudo variable which has my moonshades. And this bit of code errors out. Here's the whole function I have.
Code:function precast(spell,action) if spell.type == 'WeaponSkill' then equip(sets.WS) elseif spell.name == "Tachi: Kaiten" then equip(sets.Kaiten[Kaiten_Set_Names[Kaiten_Index]]) elseif spell.name == "Tachi: Rana" then equip(sets.Rana[Rana_Set_Names[Rana_Index]]) elseif spell.name == "Tachi: Fudo" and (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then equip(sets.Fudo[Fudo_Set_Names[Fudo_Index]],{ear1="Flame Pearl"}) else equip(sets.Fudo[Fudo_Set_Names[Fudo_Index]]) end elseif spell.name == "Tachi: Shoha" and (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then equip(sets.Shoha[Shoha_Set_Names[Shoha_Index]],{ear1="Flame Pearl"}) else equip(sets.Shoha[Shoha_Set_Names[Shoha_Index]]) end elseif spell.type == "Ninjutsu" then if string.find(spell.english,'Utsusemi') then if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then cancel_spell() add_to_chat(167, spell.english .. ' Canceled: [3+ Images]') return else equip(sets.precast.Utsusemi) end else equip(sets.precast.FastCast) 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 end
change your code to this
the reason for this is with this codeCode:function precast(spell,action) if spell.type == 'WeaponSkill' then if spell.name == "Tachi: Kaiten" then equip(sets.Kaiten[Kaiten_Set_Names[Kaiten_Index]]) elseif spell.name == "Tachi: Rana" then equip(sets.Rana[Rana_Set_Names[Rana_Index]]) elseif spell.name == "Tachi: Fudo" then if (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then equip(sets.Fudo[Fudo_Set_Names[Fudo_Index]],{ear1="Flame Pearl"}) else equip(sets.Fudo[Fudo_Set_Names[Fudo_Index]]) end elseif spell.name == "Tachi: Shoha" then if (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then equip(sets.Shoha[Shoha_Set_Names[Shoha_Index]],{ear1="Flame Pearl"}) else equip(sets.Shoha[Shoha_Set_Names[Shoha_Index]]) end else equip(sets.WS) end end if spell.type == "Ninjutsu" then if string.find(spell.english,'Utsusemi') then if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then cancel_spell() add_to_chat(167, spell.english .. ' Canceled: [3+ Images]') return else equip(sets.precast.Utsusemi) end else equip(sets.precast.FastCast) end end if spell.type == "JobAbility" then if sets.JA[spell.english] then equip(sets.JA[spell.english]) end end if spell.english == 'Spectral Jig' and buffactive.Sneak then cast_delay(0.2) send_command('cancel Sneak') end end
sence the first line says if spell.type == 'WeaponSkill' and the next check is elseif spell.name == "Tachi: Kaiten" it will always go to the first one because its going to always be a WeaponSkillCode:if spell.type == 'WeaponSkill' then equip(sets.WS) elseif spell.name == "Tachi: Kaiten" then
so after the first check it will never check any of these rules if its a ws
Code:elseif spell.name == "Tachi: Kaiten" then elseif spell.name == "Tachi: Rana" then elseif spell.name == "Tachi: Fudo" and (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then elseif spell.name == "Tachi: Shoha"
Thanks dlsmd! When and where to put if and elseif tags always confuses me. Thanks for explaining it though, it makes more sense now seeing it.
it works like this
if -- first thing you want to check
elseif --the second -> last thing you want to check
else --if the above checks dont match then do this
now if you have it always works like this
if you want to do some reading here http://www.lua.org/pil/1.htmlCode:if if elseif else end elseif if elseif else end else if elseif else end end
Regarding buffactive:
It is my understanding that the buff packet is kind of slow, both for gaining a buff and losing a buff, so that the buff_change() event can be an unreliable indicator of your actual state. The accepted way of getting around this is to set a flag in aftercast and remove it when you gain the buff. Then compare, for example, buffactive['Sneak Attack'] or sneak_attack_boolean, etc. when applying gear. I remember reading a conversation where someone discussed using this to avoid the following type of situation: if you use sneak attack, land a melee hit, and then weapon skill, you may occasionally weapon skill in sneak attack equipment despite no longer having the buff. However, since the buff loss packet lags, wouldn't this cause buffactive['Sneak Attack'] to remain true after the buff had worn, causing the error to persist? Am I correct that, while the method does ensure that buffs are correctly marked as present, it does not necessarily ensure that they haven't already worn?
Yeah, that method favors false positives. In general, though, you're either using SA and stacking it with a WS or you're using SA solo because you don't have enough TP for a WS (and thus won't be WSing immediately), so in practice it shouldn't matter unless you fuck up.
Cool Thanks dlsmd! Yeah I was just curious if it was possible or if I have to add the extra code thank...
Another question Any way to determine if your busy casting or shooting range or weaponskilling so I can cancel spells if busy?
yes
for jobs with a pet if you want to not change gear when a pet does something use this
for nonpet jobs or when you do not care if a pet is doing something use thisCode:if midaction() or pet_midaction() then cancel_spell() return end
this needs to be at the top of your percastCode:if midaction() then cancel_spell() return end
if you do not want to cancel the spell just remove the line cancel_spell()