Ok thanks for nothing.
Ok thanks for nothing.
i dont know what that was for i was not trying to be rude or anything just stating facts
but if you want the latest version you can find the link on the gearswap shop thread
or you can just go here
https://github.com/smd111/Gearswap-Skillup
Speaking of... I just downloaded your skill up file (via the zip) and am getting the following in the console when I try to load it:
16:11:06 > GearSwap: Loaded your skillup.lua Lua file!
16:11:06 > GearSwap: Lua error (runtime) - ...m Files (x86)/Windower4//addons/gearswap/refresh.lua:151: GearSwap: File failed to load:
16:11:06 > ...rogram Files (x86)\Windower4\addons/libs/packets.lua:18: attempt to index global '_addon' (a nil value)
Any idea what I'm doing wrong?
your on the live version correct?
if so you need to copy this
to /gearswap/refresh.luaCode:_addon = _addon,
between lines 97 and 113
the best place is to put on this line
like thisCode:user_env = {gearswap = _G, _global = _global, _settings = _settings,
after doing this you will eather need toCode:user_env = {gearswap = _G, _global = _global, _settings = _settings,_addon = _addon,
lua reload gearswap
or
reload luacore
Worked like a charm. Thanks!
The Geo Lua
The Alljobs Include
Reposting question in case it was missed amongst all that other stuff that came after it. There aren't any GEO luas anywhere that I have seen, so I made my own. I think it works fine for me without being overly complicated. But I do have a question about setting up a custom timer for indi spells. I dont have a whole lot of experience with lua except what i have managed to blunder thru so far.
With the code below, it will set up a timer for when I gain an indi spell effect. It will restart the timer when I use a different indi spell before the timer expires. It will delete the timer when the indi effect is gone AKA wore off. But what it will not do is restart the timer if I use the same indi spell before the first timer expired. Is there a way by using tables or some kind of variable somehow to do this? Like maybe store a value of the last indi spell name and if it matches what i just casted to restart the timer?
Code:function indi_change(indi_table,gain) if gain then send_command('@timers c Indi-Spell 180 up IndiAura.png') else send_command('@timers d Indi-Spell;input /echo :::: :::: Indi-Spell Has Expired Or Been Overwritten! Recast If Needed! :::: ::::') end end
you might want to have it clears the timer when you are im midcast when casting an indy spell (how i dont know)
but you could try this
Code:function indi_change(indi_table,gain) if gain then indi_timmer = true send_command('@timers c Indi-Spell 180 up IndiAura.png') else indi_timmer = false send_command('@timers d Indi-Spell;input /echo :::: :::: Indi-Spell Has Expired Or Been Overwritten! Recast If Needed! :::: ::::') end end and in mid_cast do this if spell.name:startswith(Indi-) and indi_timmer then indi_timmer = false coroutine.schedule(send_command('@timers d Indi-Spell;input /echo :::: :::: Indi-Spell Has Expired Or Been Overwritten! Recast If Needed! :::: ::::'), (spell.cast_time - 1)) end
Thank you dlsmd, is there a reason you used indi_timmer instead of indi_timer ?
I made the changes to try it out, except i changed timmer to timer and i had to put startswith('Indi-') to fix a lua error when i loaded it. and then i cast 1 spell and it put the echo in the chat log. then i cast a second spell and game crashed.
The dump
Thanks for the help and any in the future here. Also will your code change the timer even if i am spell interrupted? That is what i was going to test when i crashed.
EDIT: even with timmer it still crashed. And again it crashed on the second cast.
the timmer/timer thing was just a mis print (my fingers dont always do what i want and then i copied and pasted it in to the other lines with out rechecking if it was correct)
as far as the crash i have no clue
was any thing in the windower command window??
but it could be because of the coroutine.schedule
try this
and in mid_cast do thisCode:indi_timer = false function indi_change(indi_table,gain) if gain then indi_timer = true send_command('@timers c Indi-Spell 180 up IndiAura.png') else end_indi_timer() end end function end_indi_timer() send_command('@timers d Indi-Spell;input /echo :::: :::: Indi-Spell Has Expired Or Been Overwritten! Recast If Needed! :::: ::::') indi_timer = false end
Code:if spell.name:startswith("Indi-") and indi_timmer then coroutine.schedule(end_indi_timer, (spell.cast_time - 1)) end
By the way, the _addon = _addon fix has been pushed live yesterday, so you just need to restart Windower for that to work and don't need to add anything yourself.
OK the good news is that didn't crash me now.The bad news is sometimes it will send that echo twice on casting. and Sometimes a couple seconds later the new timer will delete after casting.
However, I was looking through some other luas today and noticed "spell.interrupted" in someone's code. One of the problems with how i wanted to do this was It would mess with timers even if i was interrupted (I want to keep the old timer if my new spell was interrupted and before my idea would have deleted it regardless). So now with that in my knowledge bank Ive come up with something.
I also spotted someone had "info.aftermath.weaponskill = spell.english" in their code and it gave me an idea of how to use that (similar to variables in spellcast) as well. It makes the old timer delete and the new timer create, which means the timer will refresh even if using the same spell, as well as show the specific spell name in the timer. And it will show a chat log message when the indi spell wears or changes to a new effect. It wont show in chat log when you refresh the same spell but i think i am fine with that (As long as the timer restarts and it shows message in log when it eventually wears, I am good.). The only problem i had was the chat log message cant show the specific spell name that just wore or changed (So i just used "Indi-Spell") because there seems to be a bit of lag between aftercast and indi_change happening. If indi_change could realize the difference between an indi effect being lost and an indi effect being overwritten by another effect I could do this better but I think I am happy with what i got here. And omg I have no idea how I will deal with Entrust tomorrow evening! (EDIT: I think i got it workin for Entrust preliminarily.)
I just added this code to my Lua in the following sections.
function get_sets()
function precast(spell)Code:Now_Indi = "None" Last_Indi = "None"
function aftercast(spell)Code:if spell.skill == 'Geomancy' then Now_Indi = spell.name equip(sets.FC.Geo) end
function indi_change(indi_table,gain)Code:if spell.name:startswith('Indi-') and not spell.interrupted then send_command('@timers d '..Last_Indi..';timers c '..Now_Indi..' 180 up IndiAura.png') Last_Indi = spell.name end
Code:if not gain then add_to_chat(158, '::O:: ::O:: ::O:: ::O:: Indi-Spell Has Expired Or Been Overwritten!') end
in that case try this
try this
and in mid_cast do thisCode:indi_timer = false function indi_change(indi_table,gain) if gain and not indi_timer then indi_timer = true send_command('@timers c Indi-Spell 180 up IndiAura.png') elseif not gain and indi_timer then end_indi_timer() end end function end_indi_timer() send_command('@timers d Indi-Spell;input /echo :::: :::: Indi-Spell Has Expired Or Been Overwritten! Recast If Needed! :::: ::::') indi_timer = false end
Code:if spell.name:startswith("Indi-") and indi_timer then coroutine.schedule(end_indi_timer, (spell.cast_time - 1)) end
Is the buff ID known for indi-haste?
Code:function job_buff_change(buff, gain) -- If we gain or lose any haste buffs, adjust which gear set we target. if S{'haste','march','geo-haste','indi-haste','embrava','haste samba','aftermath'}:contains(buff:lower()) then determine_haste_group() handle_equipping_gear(player.status) elseif state.Buff[buff] ~= nil then state.Buff[buff] = gain handle_equipping_gear(player.status) end -- If we gain Aftermath if buff == 'Aftermath: Lv.3' then if player.equipment.main == 'Nagi' then if (buff == "Aftermath: Lv.3" and gain) or buffactive['Aftermath: Lv.3'] then classes.CustomMeleeGroups:append('AM') else determine_haste_group() handle_equipping_gear(player.status) end end end if buff == 'Aftermath: Lv.3' then handle_equipping_gear(player.status) end endCode:function determine_haste_group() classes.CustomMeleeGroups:clear() if buffactive.embrava and (buffactive.march == 2 or (buffactive.march and buffactive[33])) then classes.CustomMeleeGroups:append('MaxHaste') elseif buffactive.march == 2 and buffactive[33] then classes.CustomMeleeGroups:append('MaxHaste') elseif buffactive.march and buffactive[580] then classes.CustomMeleeGroups:append('MaxHaste') elseif buffactive[33] and buffactive[580] then classes.CustomMeleeGroups:append('MaxHaste') elseif buffactive.embrava and (buffactive[33] or buffactive.march) then classes.CustomMeleeGroups:append('EmbravaHaste') elseif buffactive.march == 1 and buffactive[33] and buffactive['haste samba'] then classes.CustomMeleeGroups:append('HighHaste') elseif buffactive.march == 2 then classes.CustomMeleeGroups:append('HighHaste') elseif buffactive[580] then classes.CustomMeleeGroups:append('HighHaste') elseif buffactive[33] then classes.CustomMeleeGroups:append('LowHaste') end if player.equipment.main == 'Nagi' then if buffactive[272] then classes.CustomMeleeGroups:append('AM') end end end
I'm actually getting stuck in WS gear sometimes. I'm not sure what triggers it yet. I'll WS then my gear doesn't change afterwards, even if I alt F12. I have to reload gearswap.
Is there a way to add an extra custom idle group for pet only engaged? Right now this works for my pet and I, but I want different gears for pet only.
Code:-- If the pet is engaged, adjust potential idle and melee groups. if pet.isvalid and pet.status == 'Engaged' then classes.CustomIdleGroups:append('PetEngaged') end
i dont use motes includes but i think it would be something like this
Code:if pet.isvalid and pet.status == 'Engaged' and player.in_combat then classes.CustomIdleGroups:append('PetPlayerEngaged') elseif pet.isvalid and pet.status == 'Engaged' and not player.in_combat then classes.CustomIdleGroups:append('PetEngaged') end
Your job_buff_change() has redundant code. The first time you call determine_haste_group, it's going to append the AM group. Then, you are checking for AM again, and appending it again.
This should work. I'm going to ignore the buff = 'ability' and gain part from my earlier example. Your determine_haste_group() function should take care of everything.
Otherwise, I'm not entirely sure why Mote checks if buff == 'Ability' and gain when he handles custom groups. Perhaps it has something to do with trying to use an ability, and getting blocked by paralysis, amnesia, etc. I'm not entirely sure, but he doesn't check 'gain' when determining haste groups in job_buff_change, so it should be safe with aftermath, since it's not an ability you can attempt to use and get blocked. Perhaps buffactive returns true when you try using an ability, but it fails? no idea..Code:function job_buff_change(buff, gain) -- If we gain or lose any haste buffs, adjust which gear set we target. if S{'haste','march','geo-haste','indi-haste','embrava','haste samba','aftermath'}:contains(buff:lower()) then determine_haste_group() handle_equipping_gear(player.status) elseif state.Buff[buff] ~= nil then state.Buff[buff] = gain handle_equipping_gear(player.status) end end