May need to log in at a different resolution to see in entirely, Lua Error (runtime) - ...x86/Windower4//addons/GearSwap/equip_processing.lua:207: bad argument #1 to "pairs" (table expected, -cuts off here
May need to log in at a different resolution to see in entirely, Lua Error (runtime) - ...x86/Windower4//addons/GearSwap/equip_processing.lua:207: bad argument #1 to "pairs" (table expected, -cuts off here
Lua Error (runtime) - ...x86/Windower4//addons/GearSwap/equip_processing.lua:207: bad argument #1 to "pairs" (table expected, got nil)
Wow, thanks for the swift reply Byrth. And thanks for all the work you and Mote put into this! You guys are awesome.
I'm doing something wrong in these two blocks, first time I'm using player.sub_job
Code:if player.sub_job == 'NIN' or player.sub_job == 'DNC' then Idlemode = 'dw' else Idlemode = 'normal' endFirst block is at the beginning of my get_sets and should be run only once when the Lua gets loaded.Code:function sub_job_change(new,old) if new == 'NIN' or new == 'DNC' then Idlemode = 'dw' else Idlemode = 'normal' end add_to_chat(123,'Swapped idle mode to: '..Idlemode) end
Second block is a specific function that should get executed each time I swap my subjob, I think?
What, exactly, do you think you're doing wrong?Originally Posted by Sechs
Correct.First block is at the beginning of my get_sets and should be run only once when the Lua gets loaded.
Correct.Second block is a specific function that should get executed each time I swap my subjob, I think?
Since both are executing the same code, you should make another function to handle it, and call it from the other two locations.
Code:function get_sets() set_idle_mode(player.sub_job) end function sub_job_change(new, old) set_idle_mode(new) end function set_idle_mode(sub_job) if sub_job == 'NIN' or sub_job == 'DNC' then Idlemode = 'dw' else Idlemode = 'normal' end end
That's smart and avoids useles repetitions, thanks! Will implement it.
My problem is... it doesn't work lol
I mean the version I posted.
I tried to use sub_job_full, then sub_job_id (thinking maybe I typed the short form wrong) but same result. I don't get a Lua error, but nothing happens either.
But maybe it has something to do with the current Gearswap issues and not with my code.
I'll try again when I get back home with the pushed Gearswap updates.
Nothing happens, as in the add_to_chat() command you had in there doesn't do anything? Or that Idlemode never changes?Originally Posted by Sechs
I seem to be having an issue with GS recognizing my Ghorn90 (yes, I know, those animated horn kills are holding me back...). Everything else works properly in swapping, such as switching to my harp for Horde Lullaby or for third songs, pulling in all my proper midcast gear, etc. However, when it comes to swapping in my Gjallarhorn, it doesn't seem to recognize it at all.
Here's my GS, if the screw-up is on my part (I wouldn't be surprised if it was something as simple as spelling "Gjallarhorn" wrong, though I'm pretty sure I didn't!): http://pastebin.com/Rd1mqhmr
Don't mind if it's a bit messy, I'm still learning to code before I learn to clean it up. >_>; But if that ends up not being the problem, what else would do it?
Would some one be so kind as to supply me with code that would lock balrahn's ring to lock in place during salvage? Using mote's bard. lua. Thank you in advance.
I would bet it has already been pushed, but I have been busy all day and can't check. If you run launcher and the I'd=2 slot in slots.lua is named "Range", then it is fixed.
The other bugs should also be fixed, and we squashed one more bug with JP compatibility.
Both things. Idle mode got changed to the dw one for some reason, and wasn't swapping even with a full reload of GS.
And no chat message whatsoever.
Anyway, now I'm back home and I'll do some deeper tests, maybe it was just an issue connected to those few GS things that broke up today.
Still ranged for me atm.
If the add_to_chat() isn't running, you have something else broken. The way you have it written, it should be displayed on every single subjob change. My first guess is that you created a second version of the function further down the file, which overwrote the one you're editing.Both things.
Well, let's see if you can spot it.
It's strange, the custom function we created is clearly ok, because it gets run the first time when the file gets loaded, so that's not the culprit.
It has to be the function sub_job_change that somehow doesn't work, but the syntax looks ok to me, I don't get where the error could be.
http://pastebin.com/0KXrwA9w
Easy to test... the problem is the sub_job_change() function, is not working, remember the old Post I did when found it, the code I used to test isnt working now.
Hmmm, so this kinda hints us to a temporary problem in GS rather than the code?
OK, I got un-lazy and dug into actually testing this. Found the issue: sub_job_change simply isn't being called, because for some reason player.sub_job is being changed before GearSwap gets the 'job change' event. Thus, when 'job change' checks whether the subjob is different, it finds that it's already the same as what the new job is, which naturally implies that no job change happened.
Have also found where the subjob update happens. It's in the packet monitoring code GearSwap has, which comes in before the job change event from Windower. Will have to bug Byrth on how he wants to fix that.
That's great, thanks for finding this out Mote and JSH
I'm also still getting random errors on Gearswap.lua and helper_functions.lua, but there's already an open ticket on the issue tracker.
edit:
Actually it got closed because it changed and the initial issue got solved but then more came up and those are still active.
I got the idea that Byrth already knew where the problem was though, so it will probably get solved with the next live push.
Any ideas on this error. I am using RNG Lua from here >>> https://github.com/AlanWarren/gearswap
He uses Moten files.
I get this error : Lua error .... gearswap.lua: lines 294 and 273
attempt to index field ? (a nil value)
thanks