Makes sense, fixed it, thanks.
Bumping Rafleshia's post since I paged it:
Makes sense, fixed it, thanks.
Bumping Rafleshia's post since I paged it:
Quick question. How do I lock my Capacity point cape so it doesn't swap?
Use //gs disable back
Quick and easy capacity cape lock: //gs disable back
Equip cape manually after and won't swap.
Awesome thanks!
Not quite sure where you're getting stuck here, so clarify if this doesn't do it.
In gearswap/data/libs/Mote-Global.lua, you'll have a series of lines around ln44 that bind the keys to do the swaps:
f# is just that button, with ! includes alt, with ^ includes control, with @ includes windows-key.
Any of these are the same as typing "//gs cycle Offensemode" or the like into chat or console.Code:function global_on_load() send_command('bind f9 gs c cycle OffenseMode') send_command('bind ^f9 gs c cycle HybridMode') send_command('bind !f9 gs c cycle RangedMode') send_command('bind @f9 gs c cycle WeaponskillMode') send_command('bind f10 gs c set DefenseMode Physical') send_command('bind ^f10 gs c cycle PhysicalDefenseMode') send_command('bind !f10 gs c toggle Kiting') send_command('bind f11 gs c set DefenseMode Magical') send_command('bind !f11 gs c cycle CastingMode') send_command('bind ^f11 gs c cycleback CastingMode') send_command('bind f12 gs c update user') send_command('bind ^f12 gs c cycle IdleMode') send_command('bind !f12 gs c reset DefenseMode') send_command('bind ^- gs c toggle selectnpctargets') send_command('bind ^= gs c cycle pctargetmode') end
Now, if you want to add options, for example, a proc set for blm where you don't do damage - you'd want a line that describes your choices, and sets that have those choices appended to them:
Depending on what set you want to use, pick a different mode than 'casting' to add your options to - idlemode for anything where you're standing around, offensemode for when engaged, etcCode:function user_setup() state.CastingMode:options('MB', 'Normal', 'Proc') end .... function init_gear_sets() sets.midcast['Elemental Magic'] = .... --Comment here - no suffix can be used for "Normal" sets sets.midcast['Elemental Magic'].MB = .... sets.midcast['Elemental Magic'].Proc = .... end
Problem is, that SMN lua doesn't use Mote-libs entirely, Mote-globals is included for some reason but the Mote-include is not and the lua uses the regular Gearswap functions like precast(), midcast(), aftercast(), etc.
Fair point, didn't actually read the whole thing. I'd suggest reworking from a mote-base if you want to use those modes, in that case
It's all sorted now but thanks for taking a look. Ended up scrapping that lua and found another that was better for what I wanted. x
I'm having some issues with some updates I've made to my Ranger lua. I'll explain-
I'm trying to create separate preshot sets depending on my weapon, as I just made a Gastraphetes (which, for those unfamiliar with the weapon, possesses +10 snapshot). Meaning, I need to have different sets for when I use Fomalhaut,etc. My midshot sets have always worked with the syntax "sets.Midshot.<weaponname>.<acclevel>". I attempted this same syntax for preshot, "sets.Preshot.<weaponname>.<flurrylevel>" with no success. The lua itself shows no errors when I load, but with showswaps enabled now NO PRESHOT sets are equipping. I've included the full lua for anyone able to help!
https://pastebin.com/XUQaKhKf
If i hazarded a guess its cause your preshot only asks for equip(sets.Preshot.Any) (no mention of the weapon equipped) where as your midshot asks for equipSet[player.equipment.range] for example at one point.
I dont really know about equipSet how it functions though as it isnt how i do my luas.
just tapped a friendly resource in my shell who does some programming, and is more versed in GS/lua writing than I. He changed my preshot command (under the function precast). Here's the new code that replaced the previous, and now it recognizes which weapon is equipped. Just wanted to pass along for other ranged jobs out there, this is one way (by no means the only way) to get it done.
-----------------OLD PRECAST/PRESHOT COMMAND--------------
function precast(spell,action)
if spell.english == 'Ranged' then
add_to_chat(57,"Flurry Level "..PreshotArray[PreshotIndex])
if buffactive['Flurry'] then
add_to_chat(122,"Flurry found")
if PreshotArray[PreshotIndex] == 'RDM' then
equip(sets.Preshot.RDM)
else
equip(sets.Preshot.Any)
end
else
equip(sets.Preshot)
add_to_chat(122,"No flurry")
end
------------------NEW PRECAST/PRESHOT COMMAND----------------
function precast(spell,action)
if spell.english == 'Ranged' then
equipSet = sets.Preshot
add_to_chat(57,"Flurry Level "..PreshotArray[PreshotIndex])
if buffactive['Flurry'] then
add_to_chat(122,"Flurry found")
if PreshotArray[PreshotIndex] == 'RDM' then
if equipSet[player.equipment.range].RDM then
equipSet = equipSet[player.equipment.range].RDM
end
else
if equipSet[player.equipment.range].Any then
equipSet = equipSet[player.equipment.range].Any
end
end
else
if equipSet[player.equipment.range] then
equipSet = equipSet[player.equipment.range]
end
add_to_chat(122,"No flurry")
end
equip(equipSet)
looks like he basically added the equipment part i mentioned in. looking at that code i guess i see how equipset works now. but seems like it isnt really saving any steps i guess to me.
Hate to bother you fine folks but looking for some help if I can please. I want to write some handling of TH that I know I understand and can grasp and having some trouble. I am trying to use inspiration from Mote's to some extent.
One thing I am trying to do is an action event that will trigger upon successful melee hit not just a miss. I dont seem to be understand the param right.
This is what I have that isnt working.
However if I remove the "and action.param == 1" portion it then does work.Code:windower.register_event('action', function(action) if action.actor_id == player.id then if action.category == 1 and action.param == 1 then windower.add_to_chat(8,string.char(0x81,0x9A).. ' TH Test for ACTION!!!!!!') end end end)
Not sure what I am doing wrong.
I am sure I will have other questions but for now just want to understand what I am missing.
Thank you
If you're doing this in a gearswap file, use windower.raw_register_event.
You can't use action.param like that, I think. I don't think it takes a defined (or, at least, useful) value for melee attack rounds.
This is probably what you want, approximately:
It uses the Sets library. Also, it's only looking at the first swing of the attack round.Code:windower.raw_register_event('incoming chunk', function(id,org) if id == 0x1A then local action = windower.packets.parse_action(org) if action.actor_id == player.id then if action.category == 1 and S{1,67,373}:contains(action.targets[1].actions[1].message) then -- Includes normal hits, critical hits, and absorbed hits windower.add_to_chat(8,string.char(0x81,0x9A).. ' TH Test for ACTION!!!!!!') end end end end)
I use incoming chunk because battlemod messes with the messages parameter of action packets before they hit the action event.
Thanks for helping, is raw needed? I noticed before when I had raw in it wouldnt call sets or other functions.
Just tried to test this as written but it doesnt seem to work for me.
You can't use equip() and some variables aren't updated in raw_, but it's going to cause lag if you don't use it with incoming chunk.
Use the raw_ example above, then send_command('gs c TH') or something and use your equip commands in self_command
I tried to use the code above as is but didnt work. I would like to use it with an existing portion if possible then since need to use incoming chunk.
The first 'if' seems to work when I auto-target then next mob.Code:windower.raw_register_event('incoming chunk', function(id,data,org) if id == 0x29 then local message_id = data:unpack('H',0x19)%32768 if message_id == 234 then --equip(sets.misc.TreasureHunter) windower.add_to_chat(8,string.char(0x81,0x9A).. ' TH Test for auto target change when they die......') end end if id == 0x1A then local action = windower.packets.parse_action(org) if action.actor_id == player.id then if action.category == 1 and S{1,67,373}:contains(action.targets[1].actions[1].message) then -- Includes normal hits, critical hits, and absorbed hits windower.add_to_chat(8,string.char(0x81,0x9A).. ' TH Test for ACTION!!!!!!') end end end end)
Sorry to bother you with this, wish i knew more.