I understand the code but dont really understand that syntax or how LUA works with that, so cant really check it, tried removing <me> since I guess it cant got just like that.. and was just casting the song on me w/o using pianissimo and even if my initial target was a player
I might not have explained it right, I was using that WS code as an example, I want to do the BLU spells this way.
for example:
Amorphic Spikes|Bloodrake|Disseverment|Glutinous Dart|Goblin Rush
all use a STR set, where:
Cannonball|Delta Thrust|Quad. Continuum
use a VIT set.
If I wanted to use a generic call in the precast function then in the get_sets part I need to list the spells. So if several spells would all use STR set how could i list serveral spells at once in the same set? In spellcast you would just pipe|pipe them but not sure about GS.
Motenten gave me an example he would use, and I am grateful but for my style of doing things if it is possible to do it my way without being crap was hoping to.
is there any way to add a delay on the aftercast gearswap?... It is giving me the impression that is swapping to aftercast too fast... would like to even see the character in the WS gear (w/ blinkmenot disabled)
let me see if can explain this
someone gave you this
the first partCode:bluSpellStats = T{"spell1"="stat1", "spell2"="stat1", "spell3"="stat1", "spell4"="stat2", "spell5"="stat2", etc... } bluSpells = {default fallback gear set} bluSpells.stat1 = {default gear set for stat 1} bluSpells.stat2 = {default gear set for stat 2} bluSpells.spell1 = {unique gear set for spell 1} bluSpells.spell2 = set_combine(bluSpells.stat1, {some other item}) if spell.skill=="BlueMagic" then if bluSpells[spell.english] then equip(bluSpells[spell.english]) elseif bluSpellStats[spell.english] then equip(bluSpells[bluSpellStats[spell.english]]) else equip(bluSpells) end end
is a matrix, where you list the spell and their "stat" ex.Code:bluSpellStats = T{"spell1"="stat1", "spell2"="stat1", "spell3"="stat1", "spell4"="stat2", "spell5"="stat2", etc... }
stat1 is your vit setCode:bluSpellStats = T{"Cannonball"="stat1", "Delta Thrust"="stat1", "Quad. Continuum"="stat1", "Amorphic Spikes"="stat2", "Blooddrake"="stat2"}
stat2 is your str set
hope you can get the ideaCode:bluSpells = {default fallback gear set} >> this part.. not sure -_-... bluSpells.stat1 = {Vit Gear here} bluSpells.stat2 = {STR gear here}
So I wasn't really clear from the xml file that was included. If I check world.weather_element for "light", does it account for the SCH weather spells, or do I need to check for buffactive("Aurorastorm")?
Sorry, documentation slip-up. They respect scholar spells.
I'm not going to make Gearswap slower.
Correct. I didn't bother breaking up where each bit of code belonged. Set definitions go in get_sets(), selection rules would go in midcast() (assuming fast cast is in precast()).
I just gave a very simple example to match what you said. You can easily set up another variable to choose your weaponskill.
Various alternatives:
I'd go with #3, as then you can do this in the rules:Code:1: sets.precast.WS['Chant du Cygne'] = {head="Uk'uxkaj Cap",neck="Light Gorget",lear="Bladeborn Earring",rear="Steelflash Earring", body="Assim. Jubbah +1",hands="Assim. Bazu. +1", back="Rancorous Mantle",waist="Wanion Belt",legs="Manibozho Brais",feet="Assim. Charuqs +1"} sets.precast.WS['Requiescat'] = sets.precast.WS['Chant du Cygne'] 2: sets.precast.WS['Chant du Cygne'] = {head="Uk'uxkaj Cap",neck="Light Gorget",lear="Bladeborn Earring",rear="Steelflash Earring", body="Assim. Jubbah +1",hands="Assim. Bazu. +1", back="Rancorous Mantle",waist="Wanion Belt",legs="Manibozho Brais",feet="Assim. Charuqs +1"} sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS['Chant du Cygne'], {other gear that's different}) 3) sets.precast.WS = {head="Uk'uxkaj Cap",neck="Light Gorget",lear="Bladeborn Earring",rear="Steelflash Earring", body="Assim. Jubbah +1",hands="Assim. Bazu. +1", back="Rancorous Mantle",waist="Wanion Belt",legs="Manibozho Brais",feet="Assim. Charuqs +1"} sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {other gear that's different}) sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {other gear that's different})
That's also what I meant by 'fallback' -- if you don't have a set specifically set up for a given spell/weaponskill/etc, just use the parent table (sets.precast.WS in this case).Code:if sets.precast.WS[spell.english] then equip(sets.precast.WS[spell.english]) else equip(sets.precast.WS) end
Those aren't nested single quotes. Each set of single quotes encloses a text area, and then they're concatenated with variables using the .. (two adjacent periods) operator.
myVar = 'to illustrate'
'Some text '..myVar..' how it works.'
becomes:
'Some text to illustrate how it works.'
The enclosed quotes were double quotes, and would be treated as normal text since they're inside single quotes. For gear I prefer going the other way, using double quotes on the outside so that apostrophes in gear names won't be annoying. For example, you can either have:
"Uk'uxkaj Cap"
or
'Uk\'uxkaj Cap'
In the second case, the embedded apostrophe had to be escaped. In the first case, that's not necessary.
Lua does not support the alternation operator (the pipe character, used to indicate 'or' between multiple patterns). Therefore that's not directly possible, as written
That's why I wrote the dictionary table at the start. mySpells = {"spell1"="stat1", "spell2"="stat1", etc}. As written, the value of mySpells['spell1'] == 'stat1'. So if you want to know what stat set to apply to a spell, just check mySpells[spell.name].
Edit: And I should have written that as: mySpells = {["spell1"]="stat1", ["spell2"]="stat1", etc}
There are other ways of putting it together, but they all seem more clumsy and verbose. You could, for example, create a set of all str spells:
strSpells = S{"spell1", "spell2", "spell3", etc}
Where S{} indicates you're creating a set, which is a table where the keys are given, and the value of each key is true. Thus you can say:
That's fairly clean in its own way, but it requires you create the if/elseif/etc chain to check all the possible stat categories. My earlier example maps you directly to the category with the table, so you could skip that step.Code:if strSpells[spell.name] then equip(strGear) end
I assume by the nature of BLU spells i shouldnt precast in fast cast and then midcast in STR DEX etc but to how fast they cast? Or is GS able to change them fast enough?
Read Byrth's post (#125) at the top of the page.
I'm sorry I really am, I just worry alot about things and this seems to be one of them, please forgive my OCD
TP Bonus, stats, etc. are all calculated at midcast for WSs as far as I can tell (basically, no interesting findings).
Though we do not get a "readies" message for JAs, it appears that they do have a "readies" phase on the server and respect midcast gear assignments as well.
Test:
I went out to East Ron on DNC and used Aeolian Edge at just-shy of 300 TP with the three files below. Controls were a 300 TP Aeolian Edge (no file) with the gear listed in the set (832 damage) and a 300 TP Aeolian Edge with just weapons (624 damage). The top two files did 832 damage and the bottom file did 621 damage with 296 TP. The top two files also successfully swapped JA pieces while the bottom one did not.
Spoiler: show
Wanted to thank the folks that help tonight with my questons, i fear I have even more still.
Had help converting this SC code:
To GS:Code:<if notbuffactive="Berserk" subjob="WAR" advanced='"$ActivateBerserk" == "0"'> <if notbuffactive="Obliviscence|Paralysis"> <var cmd="set ActivateBerserk 1" /> <cmd>wait 3;%Spell %SpellTargetRaw;</cmd> <cmd>Berserk;wait 1.3;Warcry;wait 300; sc var set ActivateBerserk 0</cmd> <cancelspell /> <return /> </if> </if>
It is suppose to check when I try to WS to activate Berserk and Warcry then fire the WS if I am /WAR and no Obliviscence|Paralysis debuff active.Code:elseif spell.name == 'Chant du Cygne' or spell.name == 'Requiescat' and not buffactive.berserk and not buffactive.oblivescence and not buffactive.paralysis and player.subjob == 'WAR' and windower.ffxi.get_ability_recasts()[1] < 10 then send_command('berserk;wait 1.3;warcry;wait 1.3;input '..spell.prefix..' '..spell.name..' '..spell.target.raw') cancel_spell() return end
I tried to get the GS code to work tonight but it seems like it doesnt want to.
if I use Requiescat then it doesnt return any error(i was /RDM sub)
If i try to use Chant du Cygne it will return an error:
attempt to concatenate field 'raw' (a nil value)
Not sure why Chant du Cygne wants to case this and not sure how to fix it. Any help would be amazing.
EDIT:
Was also wondering if I could use a variable:
Want to be able to use different TP belt depending if I have Ionis up or not.Code:sets.melee.TP.Norm = {waist="TPWaist"} TPWaist = "Twilight Belt" function buff_change(g_or_l) if buff == 'Ionis' and g_or_l == 'gain' then TPWaist = 'Cetl Belt' else TPWaist = 'Twilight Belt' end end
Doesnt seem to do it, so not sure what I am missing.
GS don't support those kind of variable iirc. Use different sets, use combine set and just add the belt. And on engage/aftercast check if got ionis.
They are many ways to do those things even if they give the same result.
edit:
another way. using part of you idea
TP sets
buff changeCode:sets.TP = {} sets.TP.DD = { ammo="Hagneia Stone", head="Whirlpool Mask", body="Thaumas Coat", hands="Otronif Gloves", legs="Quiahuiz Leggings", feet="Manibozho boots", neck="Asperity Necklace", waist="Windbuffet Belt", left_ear="Bladeborn Earring", right_ear="Steelflash Earring", left_ring="Epona's Ring", right_ring="K'ayres Ring", back="Atheling Mantle", } sets.TP.ionis = set_combine(sets.TP.DD, { waist="Cetl Belt", })
when you get IONIS you default TP set will be changed to the iones one, but I think this will give some issues, what about if you get signet ? you dont lose Ionis it get overwrited so you will stay in IONIS TP Gear.Code:function buff_change(g_or_l) if buff == 'Ionis' and g_or_l == 'gain' then sets.TP = sets.TP.ionis else sets.TP = sets.TP.DD end end
so I would use
not tested.. just got the logic behind it.. ~.~Code:function status_change(new,old) if new == 'Engaged' then if buffactive.ionis then sets.tp = sets.tp.ionis equip(sets.TP) else sets.tp = sets.tp.DD equip(sets.TP) end else equip(sets.Idle) end end
No, it supports variables. There are a few minor problems in your code, depending which version of GearSwap you're using, Nikia:
Assuming you're on the dev version, the above code would work. The problems were:Code:TPWaist = "Twilight Belt" sets.melee.TP.Norm = {waist=TPWaist} function buff_change(buff,g_or_l) if buff == 'Ionis' and g_or_l then TPWaist = 'Cetl Belt' else TPWaist = 'Twilight Belt' end end
* sets.melee.TP.Norm = {waist="TPWaist"} makes the "waist" key equal to a string "TPWaist". Removing the quotes makes it equal to the variable TPWaist.
* You have to define the variable TPWaist before you use it
* You were missing buff from the incoming arguments of your buff_change function (so it always would have been nil)
* If you're using the dev version, buff_change passes true for "gain" and false for "loss", so you just need to test whether it is true (or g_or_l) to see that you're gaining the buff. If you're not on the dev version, your g_or_l == 'gain' is correct.
* The above function won't change your gear if the variable changes. You would have to do another equip command for that. It would be something like putting this code before the final "end":
Code:if not midaction() then equip(sets.melee.TP.Norm) end
Should also be noted that variable assignment for strings in Lua does not hold a reference to the variable, it just copies the string, so that code is actually doing nothing unless you reassign sets.melee.TP.Norm.waist.
Spellcast only allowed this sort of syntax because it iterated over the file every time.