Writing my PUP lua and got some questions:
- There is no specific category for "Maneuvers" (prefix is /pet and action_type is "Petcommand"). To use a single precast set for all 8 maneuvers I used a spell.english:endswith('Maneuver') line. Any better way to do it?
- Can you use the normal checks you can do for players even for automaton? Like can I check for spell.skill['Dark Magic'] and if I place this line into a Pet_midcast/Pet_aftercast function, then GS will check for such an action performed by the Pet and not myself. Correct?
- Trying to make a rule to equip Sheltered Ring when I'm engaged and my automaton starts casting either Protect or Shell ON ME. Would this work?
Spoiler: show- Something strange now. I have a special mode called "Pet Mode" which I'm gonna track somehow. When I activate this I need to swap my idle sets according to pet.status. If it's engaged it needs to swap PLAYER idle to a different one. If it's not engaged then it needs to return to the default idle set. This is because when I'm in "Pet Mode" I don't engage the target myself, only my automaton does.
Now... how could I track this? Let's say I already have two idle sets: sets.Idle.normal and sets.Idle.Pet.
I know how to perform the check since I can just use the pet.status variable.
The question is: where/when should I put this check? There is no correspondant pet version for "function status_change", which is what I use to discriminate between engaged true/false for the main player and swap sets accordingly.
Thanks!
How to fix it: Change it back from ['Blue Magic'] to BlueMagic. That is, from what you described, you changed it from PhysicalBlueMagic to Physical['Blue Magic']. That is fundamentally wrong. PhysicalBlueMagic is one word naming a single table, and is in no way dependent on the spell.skill value (though that may not be immediately apparent, due to the way Bokwus built his file). Physical['Blue Magic'] describes a table called 'Physical' that contains a sub-table called 'Blue Magic' that is dependent on spell.skill. Two very different things.Originally Posted by Infinite
Essentially, from the original file, Do Not Change Anything.
That should be spell.type, not spell.action_type (and PetCommand, not Petcommand).
Unfortunately there's no way to better isolate them based on what Windower resources. You could, perhaps, create a set naming the maneuvers and refer to that, though.
Code:Maneuvers = S{'Fire Maneuver', 'Wind Maneuver', 'Water Maneuver', etc} if Maneuvers:contains(spell.english) then
Correct.Can you use the normal checks you can do for players even for automaton? Like can I check for spell.skill['Dark Magic'] and if I place this line into a Pet_midcast/Pet_aftercast function, then GS will check for such an action performed by the Pet and not myself. Correct?
No. You need to use a standard equip() function command in the pet_midcast code. Otherwise, yes.Trying to make a rule to equip Sheltered Ring when I'm engaged and my automaton starts casting either Protect or Shell ON ME. Would this work?
Spoiler: show
pet_status_change() is a thing. I specifically asked Byrth to add it a few months back. However.. it looks like it didn't get added to the documentation. Will need to fix that.Something strange now. I have a special mode called "Pet Mode" which I'm gonna track somehow. When I activate this I need to swap my idle sets according to pet.status. If it's engaged it needs to swap PLAYER idle to a different one. If it's not engaged then it needs to return to the default idle set. This is because when I'm in "Pet Mode" I don't engage the target myself, only my automaton does.
Now... how could I track this? Let's say I already have two idle sets: sets.Idle.normal and sets.Idle.Pet.
I know how to perform the check since I can just use the pet.status variable.
The question is: where/when should I put this check? There is no correspondant pet version for "function status_change", which is what I use to discriminate between engaged true/false for the main player and swap sets accordingly.
Thanks Motenten!
So pet_status_change() does exist! Then I'll just use that and put my "if" checks inside that, and everything should work in theory.
Another small thing, in the "equip sheltered ring" code I posted above there are 3 conditions that need to be true for the following line to be processed.
The last condition is "spell.target == 'Sechs'", which is ok but would work only for me. If another PUP were to use that lua, it wouldn't work for them.
Is there a variable I can use for that? player.name?
So I would just have to change that last part to: spell.target = player.name ?
spell.target.type == 'SELF'
EDIT: WRONG THREAD.
Wanted to add a self cure pot rule for BLU GS and was unsure the best way to do it.
table reference code:
Midcast Code:Code:bluSpells = T{["Magic Fruit"]="CurePot", ["Plenilune Embrace"]="CurePot", ["White Wind"]="CurePot"}
gear sets:Code:elseif bluSpells[spell.english] then equip(sets.midcast.BlueMagic[bluSpells[spell.english]])
Normally it will call the spellset that matches the nameCode:sets.midcast.BlueMagic.CurePot = {ammo="Aqua Sachet", head="Weath. Corona +1", neck="Phalaina Locket", lear="Loquac. Earring", rear="Lifestorm Earring", body="Chelona Blazer", hands="Weath. Cuffs +1", lring="Aquasoul Ring", rring="Aquasoul Ring", back="Tempered Cape", waist="Cascade Belt", legs="Magavan Slops", feet="Weath. Souliers +1"} sets.midcast.BlueMagic.CurePot.Self = set_combine(sets.midcast.BlueMagic.CurePot, { hands="Buremte Gloves", lring="Kunaji Ring", waist="Chuq'aba Belt"})
I wanted to add if self cure then use a different set without having to write out each spell to over ride.
would something like this work:
or:Code:if bluSpell = "CurePot" and spell.target.type == 'SELF' then equip(sets.midcast.BlueMagic[bluSpells[spell.english]].Self)
if that is too sloppy or just wrong any help to correct would be wonderful.Code:if bluSpell = "CurePot" and spell.target.type == 'SELF' then equip(sets.midcast.BlueMagicCurePot.Self)
Thank you.
i think this will work but im not sure
function sets
sets.midcast.BlueMagic.CurePot = {ammo="Aqua Sachet",
head="Weath. Corona +1", neck="Phalaina Locket", lear="Loquac. Earring", rear="Lifestorm Earring",
body="Chelona Blazer", hands="Weath. Cuffs +1", lring="Aquasoul Ring", rring="Aquasoul Ring",
back="Tempered Cape", waist="Cascade Belt", legs="Magavan Slops", feet="Weath. Souliers +1"}
sets.midcast.BlueMagic.CurePot.Self = set_combine(sets.midcast.BlueMagic.CurePot, {
hands="Buremte Gloves", lring="Kunaji Ring",
waist="Chuq'aba Belt"})
bluSpells = T{["Magic Fruit"]="CurePot", ["Plenilune Embrace"]="CurePot", ["White Wind"]="CurePot"}
function precast
local bluspell = [bluSpells[spell.english]]
if bluSpell = "CurePot" and spell.target.type == 'SELF' then
equip(sets.midcast.BlueMagic[bluSpells[spell.english]].Self)
elseif bluSpells[spell.english] then
equip(sets.midcast.BlueMagic[bluSpells[spell.english]])
ok i am confused... My BLU lua (and others) stopped switching gear for spells (didn't even equip fast cast gear) some of my other lua's switched to fast cast still but not end cast. I was under the impression that all BlueMagic in my lua would be changed to ['Blue Magic'] is that not the case and only some of it needs to be converted to ['Blue Magic']? if so what needs changing and what doesn't? please... sorry for the noobness
So baisicly writing out each spell(not that many) is the best way to do it then?
I don't see why this wouldn't work.Unless there are other keys in the table with values other than CurePot, though, it's kind of weird.Code:if bluSpells[spell.english]=="CurePot" and spell.target.type == 'SELF' then equip(sets.midcast.BlueMagic[bluSpells[spell.english]].Self) elseif bluSpells[spell.english] then equip(sets.midcast.BlueMagic[bluSpells[spell.english]]) end
That's more orderly.Code:if bluSpells:contains(spell.english) then if spell.target.type == 'SELF' then equip(sets.midcast.BlueMagic[bluSpells[spell.english]].Self) else equip(sets.midcast.BlueMagic[bluSpells[spell.english]]) end end
JA broken atm with mothenten files.
Thks in advance for your works mothenten
=> can't use any Ja with rdm, need to unload GS, use Ja, reload GS
update windower it was fixed(issue with resources)
well precast for JA's arent working... just tested Boost, Chakra, Mantra...
but it is working for spells...
There was indeed a change in formatting for magic skills. The value of spell.skill changed so that "BlueMagic" became "Blue Magic". However this is only relevant if your lua made decisions based on the value of spell.skill. If you had code like:
Then you needed to change the set name from sets.midcast.BlueMagic to sets.midcast['Blue Magic']. However that's not what you have in your lua. You have:Code:sets.midcast.BlueMagic = {} function midcast(spell) if sets.midcast[spell.skill] then equip(sets.midcast[spell.skill]) end end
You'll note that nowhere in there does it even look at spell.skill; it just does an explicit check against a predefined set of spell names. Therefore changing the table and set names does absolutely nothing except break your lua file.Code:PhysicalBlueMagic = S{ 'Asuran Claws','Bludgeon','Body Slam','Feather Storm','Mandibular Bite', 'Queasyshroom','Power Attack','Ram Charge','Screwdriver','Sickle Slash', 'Smite of Rage','Spinal Cleave','Spiral Spin','Terror Touch'} sets.midcast.PhysicalBlueMagic = {} function midcast(spell) if PhysicalBlueMagic:contains(spell.english) then equip(sets.midcast.PhysicalBlueMagic) end end
Ok, so once GS started working , my Daub dummy macro isn't working. my macro is /console gs c set daurdabla Dummy and when I try to use it doesn't put my daub in and it says Unknown mode value. pls help , how do I fix this?
I figured it out. ty