Thanks for the advice
Anyway, concerning my LUA, I'm coding it from scratch myself, but I don't know much about scripting/coding. I'm a complete beginner, and I didn't like the single WHM lua that the entire internet seems to share... but I figured if I just tried to do it anyway I could figure it out and completely customize it to my liking.
It's not even close to done yet, but here's my LUA so far...
Pastebin: zmk2eBem
I'm trying to get it to function so that when I hit the f9-f12 keys, it will define a different idle set as my current default. I really don't like how most LUAs just rely on cycling. I'm not sure what I'm doing wrong here though. When I cast a spell, I get this error...
"Gearswap has detected an error in the user function aftercast:
... Files (x86Windower4/addons/GearSwap/data/WHM.lua:166: attempt to index global 'idle_set' (a nil value)"
So I understand that the issue is partly with my aftercast, but I'm not sure what the correct way to write it would be. I've tried correcting it, but now my gear won't even swap when I hit my function keys, even if I reload my LUA. It would before I tried to fix the issue, but I didn't have the foresight to make a backup of the LUA.
Anyone have any advice/input? Thanks.
ill break down what that error code is
"Gearswap has detected an error"
Gearswap found the error
"in the user function aftercast"
the error was found while running your aftercast function
"Files (x86Windower4/addons/GearSwap/data/WHM.lua"
the error was found in your WHM.lua file
"166"
the error was found on line 166 of your WHM.lua
"attempt to index global 'idle_set' (a nil value)"
this is the error it found
the error "attempt to index global 'idle_set' (a nil value)" means that while indexing the global table idle_set it returned nil
lets look at line 166
equip(sets.idle[idle_sets[idle_index]])
equip(..) is a gearswap function
sets.idle is one of the tables in your get_sets() function
idle_sets is another table in your get_sets() function
idle_index is not in your get_sets() function or anywhere else in your file so this would be what caused your error
-im betting you wanted to use idle_ind not idle_index
That definitely removed the error line, but my idle set still isn't functioning like it should. What concerns me is I'm not getting any errors at all. I've made a few more changes, like adding staves to my resting and idle sets to make it easier at a glance to see if things are working correctly or not. I'm definitely switching to Chatoyant when I sit, but nothing I do will equip my idle sets like I want.
Here's my updated LUA...
Pastebin: 0g44t47b
Thanks for your help so far btw dlsmd, I appreciate it
Well, when I cast, i'm not being returned to my idle set, nor when I get up from resting. Also if i load the LUA as is, and don't cast, if I hit the function keys, they aren't switching my gear at all. So I suppose both?
Yeah, I'm getting the chat lines, and no, I'm just trying my f9 and f10 keys, since they're the ones that will show me if the script is working correctly via the headgear.
try this code
http://pasted.co/e5b92aef
It still doesn't equip my headpieces.
...I found out what was wrong with it. The idle index had "travel" and "standard" as "Travel" and "Standard". The letters were uppercase.
Such a minor detail causing so many issues. I'm honestly shocked that I didn't get an error message. Probably because the letters were correct, but it was just caps sensitive. I wonder if this is something that we should report to the devs? Is it a bug that I didn't get an error message?
Also, seriously, thank you for taking your time to help me dlsmd. I really appreciate you
hi all long time lurker here finally made an account....
please help me out looking for 2 lua's ones im using so out of date.
PLD and BLM
thanks all
I dont think case sensitive is a bug. anywhere I have ever found information about gearswap has always explicitly said when something is "case in/sensitive" For me i just have taken to keepin everything i can lowercase where ever possible in my latest versions of my luas. Thing is tho if you use anything that directly relates to a spell say you have something like
you will need to capitalize the spell name in the set. so sets.Provoke instead of sets.provoke . Other than that i keep it all lower unless its displayed somewhere.Code:if sets[spell.name] then equip(sets[spell.name]) elseif sets[spell.type] then equip(sets[spell.type]) end
its not a bug nut a feature witch allows more variation
you cant have 2 functions/tables with the same name
functction a()
function A()
b.c={}
B.C={}
and still call each separately
and lua is nothing more then a series of tables containing variables and functions starting with _G.
I'm almost completely done with my Lua, thanks to you guys. You rock
I'm running into one final snag before I can say that my Lua has officially hit 1.0, that that's on lines 124 and 143. That logic should work just fine for JAs that only have one word in their name, like devotion, but the game defines JAs as two words in their tables in the res folder. Now, I COULD make it easier on myself now but harder on myself later by just including logic for only devotion and divine caress specifically, but I'm trying to future proof this lua as much as possible to reduce the workload on myself later, when I inevitably start making this more complex.
How would I go about making this work? I can't put a space in my sets, right?
Here's my current WIP Lua: http://pastebin.com/dQ0QfBzM
Thanks again.
I pushed some changes live today. They'll largely probably not be noticeable, but this one is important:
I made a spelling error in the extdata library, which has now been fixed. "Magic Burst mdg." is now "Magic Burst dmg." This means gearswap will no longer recognize "Magic Burst mdg." augments and you will have to replace them.
I announce this because it wouldn't cause an error. Your MBs would just start doing shitty damage and you'd have no idea why.
Couple questions on send_command() vs. self_command(). I notice some luas use "send_command('gs c set treasuremode none')" and the like; is there any advantage to doing it this way, vs. "self_command('set treasuremode none")? Seems to me that self_command() is more efficient, or at least less typing.
Second, I could have sworn I saw somewhere that it was recommended to use the @ symbol at the beginning of commands, i.e. "send_command('@exec warp-ring.txt')" What's the reason to do it that way? I tried it with a couple of aliases I set up and it seems to work either with or without.