:E There's a reason why I went engineer and not programmer.
if you look at my code
Registered_Events in my include: https://github.com/smd111/Gearswap/b...red_Events.lua
The Display Control System i built for my include:
https://github.com/smd111/Gearswap/b...re/Display.lua
https://github.com/smd111/Gearswap/b...isplay_sub.lua
you can do almost anything in gearswap
also i never knew how to code other then batch file/xml before windower added lua to its system and in less then 6 months i created my include and a few addons
tho i did do it with help from others
Working on a gearswap for pld (Motenten's with addition of a few acc arrays and AM3 now) and added this to the function customize_melee_set(meleeSet)
Code
Code:if buffactive['Aftermath: Lv.3'] then meleeSet = set_combine(meleeSet, sets.engaged.aftermath, sets.engaged.aftermath[state.OffenseMode.value]) end
Not sure if this was the correct spot, but I know it works fine, it equips my AM3 set with all the acc levels when I toggle through them. The only problem I'm having now is that my PDT set will not equip/lock-in while I'm meleeing with AM3 up. It will lock me in my PDT set when I do not have AM3 up though, and when I'm disengaged.
Byrth,
Any thought on my earlier conundrum?
I am getting a random error when ever inventory changes in my inventory; selling/buying/drops/etc.
This has happened from the very start before any modifications to anything. I've also tried redownloading.
"Lua runtime error: gearswap/gearswap.lua:362: attempt to index field '?' (a nil value)"
Looking at the lua..
Line 362 is:Code:elseif id == 0x01E then local bag = to_windower_api(res.bags[data:byte(0x09)].english) local slot = data:byte(0x0A) local count = data:unpack('I',5) if not items[bag][slot] then items[bag][slot] = make_empty_item_table(slot) end items[bag][slot].count = count if count == 0 then items[bag][slot].id = 0 items[bag][slot].bazaar = 0 items[bag][slot].status = 0 end
if not items[bag][slot] then items[bag][slot] = make_empty_item_table(slot) end
I have access to all 8 bags, so not real sure why this is happening.
Needless to say when I am in a jp pt and killing mobs every 30 sec or so.. it's a lot of errors popping up.
I'm assuming it would be probably a bad idea commenting that section out if all else fails?
Anything I can do to provide logs/debug?
The only thing I can think of is that there's something wrong with your copy of gearswap or your resources.
Here is everything it relies on:
windower/plugins/LuaCore.dll: https://www.dropbox.com/s/la5jz88ftj...aCore.dll?dl=0
windower/addons/gearswap: https://www.dropbox.com/s/01xcoic7x1...rSwap.zip?dl=0
windower/res: https://www.dropbox.com/s/u5nspsotmeoxowj/res.zip?dl=0
I'll try it from those locations and will let you know.
Thanks.
Yup, that did the trick!
Not sure why downloading through windower would be an issue. Is it pointing to a different repository or something?
No, but Windower somewhat misuses GitHub's zip download option. Occasionally people get a cached version of the zip, which results in their code being out of date. For whatever reason, this happens most often for Libraries.
Something something the internet is a series of tubes something.
I did something like this some time ago but then I deleted that part and I don't remember how I did it anymore ><
Basically equip specific set/equipment when in a specific area.
It's easy enough with the world.zone thing, but I remember I had a custom function that was changing my gear on zone change, without me performing any action etc.
What did I use? Status_change(new, old)?
What do you people use to perform specific actions on zone-change?
http://dev.windower.net/doku.php?id=...i:events:start
Code:town_ids = S{138, 23842, 3892832} etc. windower.register_event('zone change',function(new_id,old_id) if town_ids[new_id] then equip(that_gear) else equip(that_other_gear) end end)
Thanks Byrth!
Oh wow if i could figure that out it would be a dream. ive been using autoexec for zone changing my gears, like councilers stuffs for adoulin
this is what i use for zone change
Code:function zone_change(new_id,old_id) --zone change event local zones = gearswap.res.zones local new = zones[new_id].name local old = zones[old_id].name coroutine.sleep(4) --do what you want; new = new zone name string,old = old zone name string end windower.raw_register_event('zone change', zone_change)
This might be too complex for GS, but worth asking.
I was wondering if there was a way to ensure a CP buff from a ring is applied if it's worn off. Checking for a buff and changing gear is easy, but the items have a timer before they can be used after being equipped so thats where I'm drawing a blank.
Also the items have a global timer, like 2 hours for Trizek Ring, so that alone might throw my plan off anyways. I don't wan't it trying to use the item every few seconds when it can't for another hour.
Probably a pipe dream I guess. Seems like it would more than likely require a plugin to manage.
You could do it pretty easily using the extdata library, but I can't tell you exactly what you would have to write.
Thanks I'll check it out. Can probably model it after the aecho addon and just add a timer check for the item.
here you go
Code:--XP CP Rings rings = L{"Vocation Ring","Trizek Ring","Capacity Ring","Undecennial Ring","Decennial Ring","Allied Ring","Novennial Ring","Kupofried's Ring","Anniversary Ring", "Emperor Band","Empress Band","Chariot Band","Duodec. Ring","Expertise Ring"} rings_count = 1 --set this to the ring # in rings you want to use function get_item_next_use(name)--returns time that you can use the item again for _,n in pairs({"inventory","wardrobe"}) do for _,v in pairs(gearswap.items[n]) do if type(v) == "table" and v.id ~= 0 and gearswap.res.items[v.id].en == name then return gearswap.extdata.decode(v) end end end end function xp_cp_ring_equip(ring)--equips given ring if auto_ring then enable("left_ring") gearswap.equip_sets('equip_command',nil,{left_ring=ring}) disable("left_ring") end end function schedule_xpcp_ring()--schedules equip of selected ring local ring_time = os.time(os.date("!*t", get_item_next_use(rings[rings_count]).next_use_time))-os.time() if type(xpcpcoring) == "thread" then coroutine.close(xpcpcoring) end xpcpcoring = coroutine.schedule(xp_cp_ring_equip:prepare(rings[rings_count]),(ring_time > 0 and ring_time or 1)) end function check_ring_buff()-- returs true if you do not have the buff from xp cp ring local xpcprings = {cp=S{"Vocation Ring","Trizek Ring","Capacity Ring"}, xp=S{"Undecennial Ring","Decennial Ring","Allied Ring","Novennial Ring","Kupofried's Ring","Anniversary Ring","Emperor Band", "Empress Band","Chariot Band","Duodec. Ring","Expertise Ring"}} if xpcprings.xp:contains(rings[rings_count]) and buffactive['Dedication'] == (check_in_party("Kupofried") and 1 or nil) then return true elseif xpcprings.cp:contains(rings[rings_count]) and not buffactive['Commitment'] then return true end return false end
Damn thanks!
i forgot to put this one in there my bad
Code:function check_in_party(name)--returs true if given name is in allience for pt_num,pt in ipairs(alliance) do for pos,party_position in ipairs(pt) do if party_position.name == name then return true end end end end