I'm trying to skillup archery/marksmanship using AutoRA, but is there a way I can have GS re-equip arrow/bolts whenever I use up the 99 I have equipped?
I'm trying to skillup archery/marksmanship using AutoRA, but is there a way I can have GS re-equip arrow/bolts whenever I use up the 99 I have equipped?
this will tell you if you do not have the specified ammo equipped
if player.equipment.ammo ~= <ammoname> then
then clear ammo with
equip(ammo=empty)
then re equip your new ammo
Or you can just have it equip the ammo in the precast for the shot.
then put empty in ur aftercast?
here is my ammo include code its not 100% but its largely correct
Code:res = require 'resources' ammo = {} sets.ammo_empty = {ammo=empty,} ammo.item_use = "none" function ammo.to_bag(ammo) local find_bag_type = {} local find_ammo_type = {} local bag_type = 'none' local ammo_name = "" if ammo == "Bullet" or ammo:contains("ブレット") then find_bag_type = res.items[5363] elseif ammo == "Antique Bullet" or ammo == "Atq. Bullet +1" or ammo:contains("旧式弾") then local number = tonumber(string.match(ammo, '%d')) or 0 local id = 5284 + number find_bag_type = res.items[id] elseif ammo:contains("Dogbolt") or ammo:contains("ドッグボルト") then local number = tonumber(string.match(ammo, '%d')) or 0 local id = 5278 + number find_bag_type = res.items[id] elseif ammo:contains("Crude Arrow") or ammo:contains("野矢") then local number = tonumber(string.match(ammo, '%d')) or 0 local id = 5270 + number find_bag_type = res.items[id] elseif ammo == "Old Arrow" or ammo:contains("古びた矢") then find_bag_type = res.items[4196] else find_ammo_type = (res.items:with('en', ammo) or res.items:with('ja', ammo)) ammo_name = (string.match(find_ammo_type.enl, '(.+) bolt') or string.match(find_ammo_type.enl, '(.+) arrow') or string.match(find_ammo_type.enl, '(.+) bullet')) if find_ammo_type then if find_ammo_type.en:contains('Bolt') then bag_type = 'bolt quiver' elseif find_ammo_type.en:contains('Arrow') then bag_type = 'quiver' elseif find_ammo_type.en:contains('Bullet') then bag_type = 'bullet pouch' end end find_bag_type = (res.items:with('enl', ammo_name..' '..bag_type) or res.items:with('enl', ammo_name..' bolt quiver') or res.items:with('enl', ammo_name..' quiver') or res.items:with('enl', ammo_name..' pouch') or res.items:with('enl', "Oberon bullet pouch")) end if not find_bag_type then return false else return find_bag_type end end function ammo.precast(status,current_event,spell) if spell.english == "Ranged" and player.equipment.ammo ~= sets.range[range_types[range_types_count]].ammo then local ammo_bag = ammo.to_bag(sets.range[range_types[range_types_count]].ammo)[gearswap.language] if ammo_bag and player.inventory[ammo_bag] then equip(sets.ammo_empty) ammo.item_use = ammo_bag send_command('input /item "'..ammo_bag..'" <me>') else add_to_chat(cc.mc,"No Ammo Bag Found For "..sets.range[range_types[range_types_count]].ammo) end status.end_event = true status.end_spell = true end end function ammo.aftercast(status,current_event,spell) if spell.english == ammo.item_use then ammo.item_use = 'none' end end
I never bothered with spellcast/gearswap, I would just manually take care of precast/midcast, etc via macros and txt files. It was a lot of work, but it worked.
Looking at switching over, I have a question on how gearswsp fundamentally works. My understanding is the appeal to gs is that it knows what to do when a spell is cast, but how? Is there still macro work that needs to be done to trigger precast, or does gs hook in to the game to 'takeover' when a spell that is listed in the lua fires off?
For example, I cast a spell from the menu. Normally xi would just fire off, but my assumption is that gs sees a known spell was used, tells xi to wait a microsecond, swap to precast, and then allows stone to be cast? How does gs swap to precast gear before a spell goes off when used via the menu?
You type/menu/macro the spell.
The spell is translated into a text command for the game's command handler. Yes, even if you do it from a menu.
Gearswap reads the command, blocks it, and triggers your gearswap file accordingly.
Gearswap adds any precast stuff to the outgoing packet buffer.
Gearswap creates a packet that represents the command and adds it to the outgoing packet buffer.
Gearswap adds any midcast stuff to the outgoing packet buffer.
The next time the game sends a status update, the packet buffer is all appended in one actual outgoing transmission.
Since cast/ranged duration is calculated at the time the action is processed, but the effects don't take place on the same tick, this results in you receiving full effect of any rapid shot/snapshot/quick magic/fast cast in your precast gear. Since the entire transmission is read before the server does anything else, your midcast gear is guaranteed to be on in time for the effects of your action to be calculated.
Gearswap does NOT trigger on the outgoing packet as AltNob said, though it is a viable model. That is how ashitacast works, in which case the model is more like:
Your command gets translated into an outgoing action packet. At the time the game sends it, ashita reads your configuration file and inserts your precast swaps prior to the action packet and your midcast swaps after it. In both cases, the result is almost identical when functioning properly. The only major difference is that since ashitacast doesn't modify any action packets, it's not prone to lose packets when the game drops them and has to resend. It's also not prone to problems after maintenance if any were to change, nor does it fail on new abilities/spells.
Exactly what I was looking for thanks.
As an aside.. I noticed that gs tries to load up a lot of profiles, etc.
Is there a way to start out barebones? The only thing I am wanting it do to atm is take care of pre/mid gear, and nothing else.
No keybinds, no macro swaps, nada.
Which jobs? Since jobs can differ gear-wise, people tend to make a separate profile for each job (rehn_pld.lua, rehn_whm.lua, etc) and they load up accordingly when you change jobs.
If you want to use the same gs profile for every single job, then make .lua file named yourcharname.lua (without the _job as I put above) and it might load regardless of your job. Not sure though since I never tried it that way.
BLM. Just looking to trim all the fat for now. I dont want to call and of the motes if I dont have to. I just want a if elemental, switch to pre cast, then to midcast.
I tried the included BLM file, but when I use any sort of healing magic, my log just gets spammed with "Trixi is out of range. Unable to cast Cure." Equip seems to change, but the spell never fires off. -- Think I fixed it.. something with aftercast..
if ypou just want a basic gearswap for precast midcast on elemental magic here
you need to put in the gear you want for each in function get_setsCode:function get_sets() --the gear you want equiped in precast sets.Elemental_precast = { head="Tema. Headband", body="Temachtiani Shirt", hands="Temachtiani Gloves", legs="Temachtiani Pants", feet="Temachtiani Boots", neck={ name="Wivre Gorget", augments={'"Subtle Blow"+4','MP+3',}}, waist="Mrc.Cpt. Belt", left_ear="Ardent Earring", right_ear="Liminus Earring", left_ring="Rajas Ring", right_ring="Prouesse Ring", back="Jester's Cape", } --the gear you want equiped in midcast sets.Elemental_midcast = { head="Tema. Headband", body="Temachtiani Shirt", hands="Temachtiani Gloves", legs="Temachtiani Pants", feet="Temachtiani Boots", neck={ name="Wivre Gorget", augments={'"Subtle Blow"+4','MP+3',}}, waist="Mrc.Cpt. Belt", left_ear="Ardent Earring", right_ear="Liminus Earring", left_ring="Rajas Ring", right_ring="Prouesse Ring", back="Jester's Cape", } --the gear you want equiped after casting/when engaged/etc. sets.Engaged = { head="Tema. Headband", body="Temachtiani Shirt", hands="Temachtiani Gloves", legs="Temachtiani Pants", feet="Temachtiani Boots", neck={ name="Wivre Gorget", augments={'"Subtle Blow"+4','MP+3',}}, waist="Mrc.Cpt. Belt", left_ear="Ardent Earring", right_ear="Liminus Earring", left_ring="Rajas Ring", right_ring="Prouesse Ring", back="Jester's Cape", } end function status_change(new,old) if new == "Engaged" then equip(sets.Engaged) end end function precast(spell) if spell.skill == "Elemental Magic" then equip(sets.Elemental_precast) end end function midcast(spell) if spell.skill == "Elemental Magic" then equip(sets.Elemental_midcast) end end function aftercast(spell) equip(sets.Engaged) end
--the easiest way to do this is with gearswaps export command (//gs export)
--it will create a file in your gearswap/data/export folder with your currently equipped gear then just copy the gear in to the section you want it in
this is vary basic and will not distinguish between the different spells
--this new verify before you post(with advanced editing) crap is garbage
Thanks dlsmd, that does help, though already I am seeing my idea of basic ends up being pretty pointless, huh?
I suppose there will be spells in similar magic groups that require different sets (IE not all divine spells will need chatoyant, but cure will).
Here is the lua I've put together. Ignore the gear, it's just random stuff.
PS. I make for an awful programmer since I dont like to nest.
Currently, when casting cure, it follows the divine path, and doesnt call the separate sets.midcast.cure function. How do I get that called in to the precast? The other example is the stoneskin one. Both functions are in the original provided example. Is that with string.find and spell.name?Code:function get_sets() sets.precast = {} sets.precast.FastCast = {} sets.precast.FastCast.Default = {main="Lathi",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.precast.FastCast['Elemental Magic'] = set_combine(sets.precast.FastCast.Default,{body="Dalmatica +1",head="Goetia Petasos +2",back="Ogapepo Cape +1"}) sets.precast.FastCast['Dark Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"}) sets.precast.FastCast['Enfeebling Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"}) sets.precast.FastCast['Enhancing Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"}) sets.precast.FastCast['Healing Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"}) sets.precast.FastCast['Divine Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"}) sets.midcast = {} sets.midcast['Elemental Magic'] = {main="Lathi",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast['Dark Magic'] = {main="Lathi",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast['Enfeebling Magic'] = {main="Lathi",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast['Enhancing Magic'] = {main="Lathi",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast['Healing Magic'] = {main="Chatoyant Staff",sub="",ranged="",ammo="", head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Hagondes Cuffs",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast['Divine Magic'] = {main="Lathi",sub="",ranged="",ammo="", head="Nashira Turban",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring", body="Anhur Robe",hands="Helios Gloves",lring="Prolix Ring",rring="Veneficium Ring", back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"} sets.midcast.Cure = {main="Chatoyant Staff"} sets.midcast.Stoneskin = {main="Kirin's Pole"} sets.aftercast = {} end function precast(spell) if spell.skill == 'Elemental Magic' then equip(sets.precast.FastCast['Elemental Magic']) elseif spell.skill == 'Dark Magic' then equip(sets.precast.FastCast['Dark Magic']) elseif spell.skill == 'Enfeebling Magic' then equip(sets.precast.FastCast['Enfeebling Magic']) elseif spell.skill == 'Enhancing Magic' then equip(sets.precast.FastCast['Enhancing Magic']) elseif spell.skill == 'Healing Magic' then equip(sets.precast.FastCast['Healing Magic']) elseif spell.skill == 'Divine Magic' then equip(sets.precast.FastCast['Divine Magic']) end end function midcast(spell) if spell.skill == 'Elemental Magic' then equip(sets.midcast['Elemental Magic']) elseif spell.skill == 'Dark Magic' then equip(sets.midcast['Dark Magic']) elseif spell.skill == 'Enfeebling Magic' then equip(sets.midcast['Enfeebling Magic']) elseif spell.skill == 'Enhancing Magic' then equip(sets.midcast['Enhancing Magic']) elseif spell.skill == 'Healing Magic' then equip(sets.midcast['Healing Magic']) elseif spell.skill == 'Divine Magic' then equip(sets.midcast['Divine Magic']) end end
this will be more efficient because of the way you are doing it
i still recommend an aftercast to put you back in to your default battle gearCode:function precast(spell) if sets.precast.FastCast[spell.skill] then equip(sets.precast.FastCast[spell.skill]) end end function midcast(spell) if sets.midcast[spell.skill] then equip(sets.midcast[spell.skill]) end end
as for why it follows the devine path when you use cure
--try deleting your windower update folder then reopening windower to re download all the files
Thanks, Ill try that tomorrow.
I probably will do aftercast, I usually take care of it manually, so I'll get the hand og this stuff before doing that. I want to make it a bit more elaborate depending on situational stuff.
I guess to clarity my question a bit, about cure and stoneskin; how can I specify one-off midcasts for certain spells? For example, stoneskin would go off the enhancing midcast, but instead I would want to addionally add a stoneskin torque, or something, just for that spell.
Something like?
I figured there would be a variable way to look at sets and see if something has been defined there, rather than adding variables.Code:function midcast(spell) if string.find(spell.english,'Stoneskin') then equip(sets.midcast.stoneskin) elseif sets.midcast[spell.skill] then equip(sets.midcast[spell.skill]) end end
As an alternative idea, I like to use the set existence check method:
I dont use the naming structure of sets.midcast and sets.precast .Code:if sets.MA[spell.name] then equip(sets.MA[spell.name]) elseif sets.MA[spell.skill] then equip(sets.MA[spell.skill]) end
I use sets.JA... sets.WS... sets.MA... sets.FC... for job abilities, weapon skills, magic, and fast cast (sets.TP... = melee gear. sets.Idle... = Idle gear)
less letter typing.
And then I would have sets.MA.Enhancing (I dont remember offhand how spell.skill comes out, EnhancingSkill, Enhancing Skill, or Enhancing_Skill) and sets.MA.Stoneskin (which will combine sets over the enhancing skill set with stoneskin specific gear)
This way I dont have to comb thru the code to update my stoneskin specific gear. I just go thru my sets right to my sets.MA section and update there.
NOTE: I also dont use Mote's files, i make my own.
i created my own include setup as well and this is part of whats built into it
Already defind sets
--event based--
sets.pretarget = {}
sets.precast = {}
sets.midcast = {}
sets.aftercast = {}
sets.pet_midcast = {}
sets.pet_aftercast = {}
--type based--
sets.armor = {}
sets.range = {}
sets.weapon = {}
Auto Equip sets
this include will auto equip sets labled like this
sets.<event>.<type>
<event> = the current event(see Already defined sets)
<type> = spell.action_type,spell.type,spell.skill,spell.nam e (in this order)
so if you used the spell cure it would try to equip this equivalent(in precast)
equip(sets.armor[type], sets.range[type], sets.weapon[type], sets.precast.Magic, sets.precast.WhiteMagic, sets.precast["Healing Magic"], sets.precast["Cure"])