|
Gearswap Support Thread
Cerberus.Drayco
Server: Cerberus
Game: FFXI
Posts: 347
By Cerberus.Drayco 2018-08-08 09:05:58
Sorry if this is a noob question, I'm pretty noob when it comes to GS. I've been searching without much success for a solution to this.
How do people use warp rings without manually equiping them? My idle set constantly takes over when I'm trying to warp out. I can't seem to find any lines of code to use warp ring with a text command or something.
Shiva.Hiep
Server: Shiva
Game: FFXI
Posts: 669
By Shiva.Hiep 2018-08-09 18:13:19
For the function (spell.element == world.day_element or spell.element == world.weather_element), is there another way to just state double weather for all elements?
[+]
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-09 23:45:16
(spell.element == world.day_element or spell.element == world.weather_element) first that is not a function it is part of an if
to answer you question like this Code if (spell.element == world.day_element or spell.element == world.weather_element) and S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)
[+]
Quetzalcoatl.Langly
Server: Quetzalcoatl
Game: FFXI
Posts: 684
By Quetzalcoatl.Langly 2018-08-10 00:00:48
Sorry if this is a noob question, I'm pretty noob when it comes to GS. I've been searching without much success for a solution to this.
How do people use warp rings without manually equiping them? My idle set constantly takes over when I'm trying to warp out. I can't seem to find any lines of code to use warp ring with a text command or something.
You're still going to have to manually equip it. But the following code will lock it in place until you use it.
With something like this: Code -- Note this code requires the code in 'langly_include.lua' to be present.
-- Detects if your lockable gear is equipped and locks said slot. Then determines if it's an enchanted item and if that item has a charge ready or not to re-enable said slot.
function job_handle_equipping_gear(playerStatus, eventArgs)
local lockables = T{'Mecisto. Mantle', 'Shobuhouou Kabuto', 'Aptitude Mantle', 'Nexus Cape', 'Aptitude Mantle +1', 'Warp Ring', 'Vocation Ring', 'Reraise Earring', 'Capacity Ring', 'Trizek Ring', 'Echad Ring', 'Facility Ring', 'Dim. Ring (Holla)', 'Dim. Ring (Dem)', 'Dim. Ring (Mea)'}
local watch_slots = T{'ear1','ear2','ring1','ring2','back','head'}
for _,v in pairs(watch_slots) do
if lockables:contains(player.equipment[v]) then
disable(v)
if has_charges(player.equipment[v]) and (not is_enchant_ready(player.equipment[v])) then
enable(v)
end
else
enable(v)
end
end
end
But for that to work, you would also need the extra functions (I just put these into the Mote-Include as it seemed appropriate. Code res = require('resources')
extdata = require('extdata')
-- Item must be equipped for it to return any meaningful value.
function is_enchant_ready(--[[name of item]]item)
local item_id, item = res.items:find(function(v) if v.name == item then return true end end)
local inventory = windower.ffxi.get_items()
local usable_bags = T{'inventory','wardrobe','wardrobe2','wardrobe3','wardrobe4'}
local itemdata = {}
for i,v in pairs(inventory) do
if usable_bags:contains(i) then
for key,val in pairs(v) do
if type(val) == 'table' and val.id == item_id then
itemdata = extdata.decode(val)
end
end
end
end
if itemdata and itemdata.charges_remaining then
if itemdata.activation_time - itemdata.next_use_time > item.cast_delay then
return true
end
end
return false
end
function has_charges(--[[name of item]]item)
local item_id, item = res.items:find(function(v) if v.name == item then return true end end)
local inventory = windower.ffxi.get_items()
local bags = T{'inventory','safe','safe2','storage','satchel','locker','sack','case','wardrobe','wardrobe2','wardrobe3','wardrobe4'}
local itemdata = {}
for i,v in pairs(inventory) do
if bags:contains(i) then
for key,val in pairs(v) do
if type(val) == 'table' and val.id == item_id then
itemdata = extdata.decode(val)
end
end
end
end
if itemdata and itemdata.charges_remaining then
if itemdata.charges_remaining > 0 then
return true
end
end
return false
end
This code tests if your gear has a usable item (something with enchantments) and if it does (list is in the job handle equipping gear part) it will prevent it from being swapped out until the enchantment isn't ready. (Like you've just used it).
[+]
Shiva.Hiep
Server: Shiva
Game: FFXI
Posts: 669
By Shiva.Hiep 2018-08-10 08:21:36
Carbuncle.Kigensuro said: »(spell.element == world.day_element or spell.element == world.weather_element) first that is not a function it is part of an if
to answer you question like this Code if (spell.element == world.day_element or spell.element == world.weather_element) and S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)
I'm trying to apply this to Orpheus's Sash but not sure how since I'm not too familiar with gearswap functions. The best I could come up with was this Code if (spell.element == world.day_element and spell.element == world.weather_element) and
(spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
equip({waist="Hachirin-no-Obi"})
elseif spell.skill == 'Elemental Magic' and spell.target.distance < target_distance then
equip({waist="Orpheus's Sash"})
With this above
I tried for an hourish trying to apply your post to the lua, but I could not figure it out. Disclaimer, the coding would make any adept coder gouge their eyes out at its ugliness, but I wanted to show that I made an attempt ): Code if (spell.element == world.day_element and spell.element == world.weather_element
or world.weather_element == S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}
or buffactive == S{"Firestorm II","Hailstorm II","Windstorm II","Sandstorm II","Thunderstorm II","Rainstorm II","Aurorastorm II","Voidstorm II"}) and
(spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
equip({waist="Hachirin-no-Obi"})
elseif spell.skill == 'Elemental Magic' and spell.target.distance < target_distance then
equip({waist="Orpheus's Sash"})
end I'm trying to make it where Hachirin-no-Obi will equip during day+weather or double weather/storm2, while Orpheus's Sash equipping over Hachirin-no-Obi if only day matches nukes. This might not be most useful to SCHs, but it'd help a bunch for BLU,GEO, and BLM.
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-10 09:13:47
this is how i get the timing down foe auto equiping my xp/cp rings Code --replaces gearswaps item info update function
function gearswap.refresh_item_list(itemlist)
retarr = gearswap.make_user_table()
for i,v in pairs(itemlist) do
if type(v) == 'table' and v.id and v.id ~= 0 then
if gearswap.res.items[v.id] and gearswap.res.items[v.id][language] and not retarr[gearswap.res.items[v.id][language]] then
retarr[gearswap.res.items[v.id][language]] = {id=v.id,count=v.count,shortname=gearswap.res.items[v.id][language]:lower(),extdata = gearswap.extdata.decode(v)}
if gearswap.res.items[v.id][language..'_log'] and gearswap.res.items[v.id][language..'_log']:lower() ~= gearswap.res.items[v.id][language]:lower() then
retarr[gearswap.res.items[v.id][language]].longname = gearswap.res.items[v.id][language..'_log']:lower()
retarr[gearswap.res.items[v.id][language..'_log']] = retarr[gearswap.res.items[v.id][language]]
end
elseif gearswap.res.items[v.id] and gearswap.res.items[v.id][language] then
retarr[gearswap.res.items[v.id][language]].count = retarr[gearswap.res.items[v.id][language]].count + v.count
end
end
end
return retarr
end
--gets bag from item
function item_to_bag(name)
for _,bag in ipairs({"inventory","wardrobe","wardrobe2","wardrobe3","wardrobe4"}) do
local item = player[bag][name]
if item then
return bag
end
end
end
--gets the next time you can use given item (in seconds to wait)
--this was built for exp rings
function get_time_to_next_use(item)
local ex = player[item_to_bag(ring)][ring].extdata
if ex and ex.charges_remaining >= 1 then
local item_time = os.time(os.date("!*t", ex.next_use_time))-os.time()
end
return item_time
end
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-10 09:31:54
Code if (spell.element == world.day_element and spell.element == world.weather_element
or world.weather_element == S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}
or buffactive == S{"Firestorm II","Hailstorm II","Windstorm II","Sandstorm II","Thunderstorm II","Rainstorm II","Aurorastorm II","Voidstorm II"}) and
(spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
equip({waist="Hachirin-no-Obi"})
elseif spell.skill == 'Elemental Magic' and spell.target.distance < target_distance then
equip({waist="Orpheus's Sash"})
end I'm trying to make it where Hachirin-no-Obi will equip during day+weather or double weather/storm2, while Orpheus's Sash equipping over Hachirin-no-Obi if only day matches nukes. This might not be most useful to SCHs, but it'd help a bunch for BLU,GEO, and BLM. 1. world.weather_element is a string so you can not see if it is equal to a table like Code S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}
you need to see if the table containes that string like this Code S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)
2. buffactive is a table not a string or a number so equal to is usless you need to check it like this Code buffactive["Firestorm II"] (there might be another way you can do this but im not sure)
the best way i could come up with is this (using your code as a base) Code local storm_element = function() for i,v in pairs({Fire=589,Ice=590,Wind=591,Earth=592,Lightning=593,Water=594,Light=595,Dark=596,}) do
if buffactive[v] then return i end end end
if (spell.element == world.day_element and spell.element == world.weather_element
or S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)
or storm_element == spell.element) and (spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
equip({waist="Hachirin-no-Obi"})
elseif spell.skill == 'Elemental Magic' and spell.target.distance < target_distance then
equip({waist="Orpheus's Sash"})
end
[+]
Shiva.Hiep
Server: Shiva
Game: FFXI
Posts: 669
By Shiva.Hiep 2018-08-10 10:37:36
It does swap in Hachirin-no-Obi when storm2 is up, but now it swaps to Hachirin-no-Obi for all nukes even if it's not matching storm2.
Asura.Truece
Server: Asura
Game: FFXI
Posts: 44
By Asura.Truece 2018-08-10 10:52:10
Does anyone have an example of equipping/using dimensional rings? I'm trying to equip, disable the slot, wait for the equip-cooldown, and then use the ring. The equip and disable seem to work OK, but the command to use the ring does not.
I have some equip sets defined as such: Code sets.Holla = { ring1 = "Dimensional ring (Holla)" }
sets.Mea = { ring1 = "Dimensional ring (Mea)" }
sets.Dem = { ring1 = "Dimensional ring (Dem)" }
Then, some self_commands (within function self_command()): Code -- Use Teleport Ring (Dem, Mea, Holla) --
if command: lower() == "dem" then --command is: //gs c dem
add_to_chat(8, '-----Dem ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Dem;input //gs disable ring1;wait 9;input /item "Dimensional ring (Dem)" <me>;')
end
if command: lower() == "mea" then --command is: //gs c mea
add_to_chat(8, '-----Mea ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Mea;input //gs disable ring1;wait 9;input /item "Dimensional ring (Mea)" <me>;')
end
if command: lower() == "holla" then --command is: //gs c holla
add_to_chat(8, '-----Holla ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Holla;input //gs disable ring1;wait 9;input /item "Dimensional ring (Holla)" <me>;')
end
And finally, a bit to handle clearing the flags when the zone changes: Code -- Automatically changes Idle gears if you zone in or out of town --
windower.register_event('zone change', function()
--Start Ring Handling
if ZoneChange == 'ON' then
--Just used a teleport/warp ring... clear L.Ring
send_command('input //gs enable ring1')
equip({ring1="Etana Ring"})
ZoneChange = 'OFF'
end
...
With a ring equipped, I can manually type in the '/item "Dimensional ring (xxx)" <me>' command, and it seems to work, but the self_command doesn't always work. I say always, because it has worked a couple of times. But then I'll try again with a different ring command, and it fails.
I completely expect it to be something obvious that I'm overlooking. Anyone have any suggestions?
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-11 11:43:23
why would you do this
send_command('input //gs equip sets.Dem;input //gs disable ring1;wait 9;input /item "Dimensional ring (Dem)" <me>;')
when this is faster and easier to understand Code equip(ring1 = "Dim. Ring (Holla)")
disable("ring1")
send_command('input /item "Dim. Ring (Holla)" <me>')
also the ring names are
"Dim. Ring (Holla)"
"Dim. Ring (Dem)"
"Dim. Ring (Mea)"
not
-tho this should work for equipping but nothing else because ffxi uses the short names in its commands
-if you look in the res/item.lua you will see en= or ja= these are what you should use for names based on your language (en= English, ja= Japanese)
Dimensional ring (Holla)
Dimensional ring (Dem)
Dimensional ring (Mea)
Asura.Truece
Server: Asura
Game: FFXI
Posts: 44
By Asura.Truece 2018-08-11 22:18:00
Because of the delay between when the ring is equipped and when it can be used. I had tried many variations and that I had is just the most recent iteration.
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-12 00:03:57
Because of the delay between when the ring is equipped and when it can be used. I had tried many variations and that I had is just the most recent iteration. this is the most efficient way i can think of to do the same thing (you might need to adjust the wait time) Code local comArgs = command
if #comArgs:split(' ') >= 2 then
comArgs = T(comArgs:split(' '))
end
if comArgs[1]:lower() == 'dim' then
local ring = comArgs[2]:lower():ucfirst()
--commands are:
--//gs c dim dem -for Dimensional ring (Dem)
--//gs c dim mea -for Dimensional ring (Mea)
--//gs c dim holla -for Dimensional ring (Holla)
if ring and S{"Dem","Mea","Holla"}:contains(ring) then
add_to_chat(8, '-----Using Dimensional ring ('..ring..')-----')
ZoneChange = 'ON'
equip(ring1 = "Dim. Ring ("..ring..")")
disable("ring1")
send_command('wait 9;input /item "Dim. Ring ('..ring..')" <me>')
end
end
[+]
Lakshmi.Reddwarf
Server: Lakshmi
Game: FFXI
Posts: 160
By Lakshmi.Reddwarf 2018-08-12 01:49:32
Does anyone have an example of equipping/using dimensional rings? I'm trying to equip, disable the slot, wait for the equip-cooldown, and then use the ring. The equip and disable seem to work OK, but the command to use the ring does not.
I have some equip sets defined as such: Code sets.Holla = { ring1 = "Dimensional ring (Holla)" }
sets.Mea = { ring1 = "Dimensional ring (Mea)" }
sets.Dem = { ring1 = "Dimensional ring (Dem)" }
Then, some self_commands (within function self_command()): Code -- Use Teleport Ring (Dem, Mea, Holla) --
if command: lower() == "dem" then --command is: //gs c dem
add_to_chat(8, '-----Dem ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Dem;input //gs disable ring1;wait 9;input /item "Dimensional ring (Dem)" <me>;')
end
if command: lower() == "mea" then --command is: //gs c mea
add_to_chat(8, '-----Mea ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Mea;input //gs disable ring1;wait 9;input /item "Dimensional ring (Mea)" <me>;')
end
if command: lower() == "holla" then --command is: //gs c holla
add_to_chat(8, '-----Holla ring -----')
ZoneChange = 'ON'
send_command('input //gs equip sets.Holla;input //gs disable ring1;wait 9;input /item "Dimensional ring (Holla)" <me>;')
end
And finally, a bit to handle clearing the flags when the zone changes: Code -- Automatically changes Idle gears if you zone in or out of town --
windower.register_event('zone change', function()
--Start Ring Handling
if ZoneChange == 'ON' then
--Just used a teleport/warp ring... clear L.Ring
send_command('input //gs enable ring1')
equip({ring1="Etana Ring"})
ZoneChange = 'OFF'
end
...
With a ring equipped, I can manually type in the '/item "Dimensional ring (xxx)" <me>' command, and it seems to work, but the self_command doesn't always work. I say always, because it has worked a couple of times. But then I'll try again with a different ring command, and it fails.
I completely expect it to be something obvious that I'm overlooking. Anyone have any suggestions?
i dont use Gearswap for my Warp Rings or Teleport rings, i've just added a command to my alias.
alias demring gs disable ring2; input /equip r.ring "Dim. Ring (Dem)"; wait 12; input /item "Dim. Ring (Dem)" <me>; wait 1; gs enable ring2
alias hollaring gs disable ring2; input /equip r.ring "Dim. Ring (Holla)"; wait 12; input /item "Dim. Ring (Holla)" <me>; wait 1; gs enable ring2
i only have the 2 rings right now, thats usually enough to get me around. you could add the 3rd one if u wanted.
i also //send @all //demring and it works perfect.
[+]
Asura.Truece
Server: Asura
Game: FFXI
Posts: 44
By Asura.Truece 2018-08-13 09:27:50
Carbuncle.Kigensuro said: »Because of the delay between when the ring is equipped and when it can be used. I had tried many variations and that I had is just the most recent iteration. this is the most efficient way i can think of to do the same thing (you might need to adjust the wait time) Code local comArgs = command
if #comArgs:split(' ') >= 2 then
comArgs = T(comArgs:split(' '))
end
if comArgs[1]:lower() == 'dim' then
local ring = comArgs[2]:lower():ucfirst()
--commands are:
--//gs c dim dem -for Dimensional ring (Dem)
--//gs c dim mea -for Dimensional ring (Mea)
--//gs c dim holla -for Dimensional ring (Holla)
if ring and S{"Dem","Mea","Holla"}:contains(ring) then
add_to_chat(8, '-----Using Dimensional ring ('..ring..')-----')
ZoneChange = 'ON'
equip(ring1 = "Dim. Ring ("..ring..")")
disable("ring1")
send_command('wait 9;input /item "Dim. Ring ('..ring..')" <me>')
end
end I ended up using something similar to this and was able to get some fluff out of my LUA. Thanks very much for your help!
Valefor.Madranta
Server: Valefor
Game: FFXI
Posts: 89
By Valefor.Madranta 2018-08-15 00:02:41
I'm having a strange problem with my WAR lua where my grip is not equipping. If I ever get the in game error "You must have a two-handed weapon equipped [...] to equip a grip." my grip will no longer equip properly in GS. It doesn't seem to be attempting to, since I only get the error once until I've fixed it with the following. It starts working again after I've manually equipped the grip and then zoned. If I just zone, leaving the grip off, it will continue to not work. Conversely, when it is working I can remove my grip, zone, and GS will properly equip it when triggered.
I use Organizer and would run into this problem nearly every time it used /heal after it's done collecting gear. My grip is in my Idle/Resting set but my weapon is not, hence the error. I've bandaid fixed this by having GS equip the 1 WAR weapon I keep in a Wardrobe upon loading.
I'd guess this is a deeper problem than my lua, but Gearswap is about the extent of my coding knowledge so I certainly could be wrong. The full lua can be found below. Thanks in advance for any time spent looking into this.
Madranta_WAR.lua (Google Drive link)
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-15 01:10:48
I'm having a strange problem with my WAR lua where my grip is not equipping. If I ever get the in game error "You must have a two-handed weapon equipped [...] to equip a grip." my grip will no longer equip properly in GS. It doesn't seem to be attempting to, since I only get the error once until I've fixed it with the following. It starts working again after I've manually equipped the grip and then zoned. If I just zone, leaving the grip off, it will continue to not work. Conversely, when it is working I can remove my grip, zone, and GS will properly equip it when triggered.
I use Organizer and would run into this problem nearly every time it used /heal after it's done collecting gear. My grip is in my Idle/Resting set but my weapon is not, hence the error. I've bandaid fixed this by having GS equip the 1 WAR weapon I keep in a Wardrobe upon loading.
I'd guess this is a deeper problem than my lua, but Gearswap is about the extent of my coding knowledge so I certainly could be wrong. The full lua can be found below. Thanks in advance for any time spent looking into this.
Madranta_WAR.lua (Google Drive link)as far as i can tell it is most likely because you have sub equipment in your sets.Idle and sets.TP.Normal that just so happen to be Grips
this is what i think is causing your issue
you do not need them there because when you change weapons you already have your grips included wirth the ones you need for them
Valefor.Madranta
Server: Valefor
Game: FFXI
Posts: 89
By Valefor.Madranta 2018-08-15 02:46:28
Carbuncle.Kigensuro said: »I'm having a strange problem with my WAR lua where my grip is not equipping. If I ever get the in game error "You must have a two-handed weapon equipped [...] to equip a grip." my grip will no longer equip properly in GS. It doesn't seem to be attempting to, since I only get the error once until I've fixed it with the following. It starts working again after I've manually equipped the grip and then zoned. If I just zone, leaving the grip off, it will continue to not work. Conversely, when it is working I can remove my grip, zone, and GS will properly equip it when triggered.
I use Organizer and would run into this problem nearly every time it used /heal after it's done collecting gear. My grip is in my Idle/Resting set but my weapon is not, hence the error. I've bandaid fixed this by having GS equip the 1 WAR weapon I keep in a Wardrobe upon loading.
I'd guess this is a deeper problem than my lua, but Gearswap is about the extent of my coding knowledge so I certainly could be wrong. The full lua can be found below. Thanks in advance for any time spent looking into this.
Madranta_WAR.lua (Google Drive link)as far as i can tell it is most likely because you have sub equipment in your sets.Idle and sets.TP.Normal that just so happen to be Grips
this is what i think is causing your issue
you do not need them there because when you change weapons you already have your grips included wirth the ones you need for them Deleting them is a good enough workaround, thanks. I mostly had them in there for the rare NM that strips equipment, but not necessarily your weapon.
That said, forcing the can't equip grip error with an in game equip macro still prevents GS from equipping the grip. It's a minor enough problem that it's probably not worth looking into further.
By NamelessNP 2018-08-16 12:45:00
I have this issue where Gearswap does nothing when I first login, I have to reload it from the console after I'm in game before it starts working. What would cause this?
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-16 20:46:35
how can we tell if we do not have your code
By dnoons 2018-08-18 11:57:12
I've been trying to get Plunderer's Vest +3 to auto-equip/unequip when applicable or not (Ambush bonus when behind mob).
I copied a bunch of code out of a DNC lua (https://github.com/Rikimarueye/Rikis_gearswaps/blob/master/DNC.lua)
I've got it to auto-equip, but now I cannot figure out how to get it to unequip it when not applicable.
Currently, i just have the code swap the gear when facing the mob, because it is easier to check that way.
Most of the code is at the bottom, but check_facing() is also found within other functions, which is noted also.
If anyone has insight or an answer, I greatly appreciate it.
Edit: If you have another way to code this, I'm open to that as well.
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom commands:
gs c cycle treasuremode (set on ctrl-= by default): Cycles through the available treasure hunter modes.
Treasure hunter modes:
None - Will never equip TH gear
Tag - Will equip TH gear sufficient for initial contact with a mob (either melee, ranged hit, or Aeolian Edge AOE)
SATA - Will equip TH gear sufficient for initial contact with a mob, and when using SATA
Fulltime - Will keep TH gear equipped fulltime
--]]
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
state.Buff['Trick Attack'] = buffactive['trick attack'] or false
state.Buff['Feint'] = buffactive['feint'] or false
include('Mote-TreasureHunter')
check_facing()
get_combat_form()
-- For th_action_check():
-- JA IDs for actions that always have TH: Provoke, Animated Flourish
info.default_ja_ids = S{35, 204}
-- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
info.default_u_ja_ids = S{201, 202, 203, 205, 207}
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'Acc') --F9 toggle
state.HybridMode:options('Normal', 'Evasion', 'PDT')
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
state.PhysicalDefenseMode:options('Evasion', 'PDT')
-- Additional local binds (^ = ctrl, ! = alt)
send_command('bind ^` input /ja "Flee" <me>')
send_command('bind ^= gs c cycle treasuremode') --ctrl =
send_command('bind !- gs c cycle targetmode')
select_default_macro_book()
set_lockstyle()
check_facing()
get_combat_form()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !-')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Special sets (required by rules)
--------------------------------------
sets.TreasureHunter = {
hands={ name="Plun. Armlets +1", augments={'Enhances "Perfect Dodge" effect',}},
feet="Skulk. Poulaines",
}
sets.Kiting = {}
sets.buff['Sneak Attack'] = {
head="Pill. Bonnet +3",
body="Pillager's Vest +3",
hands={ name="Plun. Armlets +1", augments={'Enhances "Perfect Dodge" effect',}},
legs="Pill. Culottes +3",
feet="Skulk. Poulaines",
neck="Caro Necklace",
waist="Grunfeld Rope",
left_ear="Cessance Earring",
right_ear="Sherida Earring",
left_ring="Ilabrat Ring",
right_ring="Regal Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
sets.buff['Trick Attack'] = {
head="Pill. Bonnet +3",
body="Pillager's Vest +3",
hands={ name="Plun. Armlets +1", augments={'Enhances "Perfect Dodge" effect',}},
legs="Pill. Culottes +3",
feet="Skulk. Poulaines",
neck="Caro Necklace",
waist="Grunfeld Rope",
left_ear="Cessance Earring",
right_ear="Sherida Earring",
left_ring="Ilabrat Ring",
right_ring="Regal Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
-- Actions we want to use to tag TH.
sets.precast.Step = sets.TreasureHunter
sets.precast.JA.Bully = sets.TreasureHunter
sets.precast.Flourish1 = sets.TreasureHunter
sets.precast.JA.Provoke = sets.TreasureHunter
--------------------------------------
-- Precast sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Collaborator'] = {head="Skulker's Bonnet"}
sets.precast.JA['Accomplice'] = {head="Skulker's Bonnet"}
sets.precast.JA['Flee'] = {feet="Pillager's Poulaines +3"}
sets.precast.JA['Hide'] = {body="Pillager's Vest +3"}
sets.precast.JA['Conspirator'] = {body="Raider's Vest +2"}
sets.precast.JA['Steal'] = {legs="Assassin's culottes", feet="Pillager's Poulaines +3"}
sets.precast.JA['Despoil'] = {feet="Skulker's Poulaines"}
sets.precast.JA['Perfect Dodge'] = {hands="Plunderer's Armlets +1"}
sets.precast.JA['Feint'] = {} -- {}
sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']
sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {
head={ name="Herculean Helm", augments={'Accuracy+19 Attack+19','"Triple Atk."+3','STR+7','Accuracy+2','Attack+12',}},
body="Raider's Vest +2",
hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
legs="Pill. Culottes +3",
feet="Pill. Poulaines +3",
neck="Twilight Torque",
waist="Windbuffet Belt +1",
left_ear="Loquac. Earring",
right_ear="Etiolation Earring",
left_ring="Veneficium Ring",
right_ring="Lebeche Ring",
back="Solemnity Cape",
}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
-- Ranged snapshot gear
sets.precast.RA = {}
---------------------------
-- Weaponskill sets
---------------------------
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="Pill. Bonnet +3",
body={ name="Herculean Vest", augments={'Attack+5','Weapon skill damage +4%','DEX+7',}},
hands="Meg. Gloves +2",
legs="Pill. Culottes +3",
feet={ name="Lustratio Leggings", augments={'HP+50','STR+10','DEX+10',}},
neck="Caro Necklace",
waist="Grunfeld Rope",
left_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +25',}},
right_ear="Sherida Earring",
left_ring="Ilabrat Ring",
right_ring="Regal Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%',}},
}
sets.precast.WS['Exenterator'] = {
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}}, -- relic 3
body="Plunderer's Vest +3",
hands="Mummu wrists +2",
legs="Meg. Chausses +2",
feet={ name="Plun. Poulaines +3", augments={'Enhances "Assassin\'s Charge" effect',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Brutal Earring",
right_ear="Sherida Earring",
left_ring="Ilabrat Ring",
right_ring="Regal Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%',}}, --agi/da cape
}
sets.precast.WS['Evisceration'] = {
head="Adhemar Bonnet +1",
body="Plunderer's Vest +3",
hands="Mummu Wrists +2",
legs="Pill. Culottes +3",
feet={ name="Lustratio Leggings", augments={'HP+50','STR+10','DEX+10',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +25',}},
right_ear="Sherida Earring",
left_ring="Mummu Ring",
right_ring="Begrudging Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%',}},
}
sets.precast.WS['Aeolian Edge'] = {
head={ name="Herculean Helm", augments={'Accuracy+19 Attack+19','"Triple Atk."+3','STR+7','Accuracy+2','Attack+12',}},
body="Pillager's Vest +3",
hands={ name="Plun. Armlets +1", augments={'Enhances "Perfect Dodge" effect',}},
legs={ name="Herculean Trousers", augments={'"Mag.Atk.Bns."+24','Accuracy+16 Attack+16','Mag. Acc.+16 "Mag.Atk.Bns."+16',}},
feet="Skulk. Poulaines",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Cessance Earring",
right_ear="Friomisi Earring",
left_ring="Acumen Ring",
right_ring="Regal Ring",
back="Toro Cape",
}
sets.precast.WS.SA = set_combine(sets.precast.WS, {body="Meghanada Cuirie +2"})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
--sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {ammo="Honed Tathlum", back="Letalis Mantle"})
--sets.precast.WS['Exenterator'].Mod = set_combine(sets.precast.WS['Exenterator'], {head="Felistris Mask",waist=gear.ElementalBelt})
--sets.precast.WS['Exenterator'].TA = set_combine(sets.precast.WS['Exenterator'].Mod, {ammo="Qirmiz Tathlum"})
--sets.precast.WS['Exenterator'].SATA = set_combine(sets.precast.WS['Exenterator'].Mod, {ammo="Qirmiz Tathlum"})
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {
left_ear="Loquacious Earring",
body="Pillager's Vest +3",
hands="Pillager's Armlets +3",
back="Canny Cape",
}
-- Specific spells
sets.midcast.Utsusemi = {
left_ear="Loquacious Earring",
body="Pillager's Vest +3",
hands="Pillager's Armlets +3",
}
-- Ranged gear
sets.midcast.RA = {
head="Meghanada Visor +2",
body="Meg. Cuirie +2",
hands="Meg. Gloves +2",
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Windbuffet Belt +1",
left_ear="Cessance Earring",
right_ear="Digni. Earring",
left_ring="Cacoethic Ring +1",
right_ring="Regal Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}}}
--------------------------------------
-- Idle/resting/defense sets
--------------------------------------
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {
head="Meghanada Visor +2",
body="Meg. Cuirie +2",
hands="Meg. Gloves +2",
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Twilight Torque",
waist="Flume Belt +1",
left_ear="Cessance Earring",
right_ear="Etiolation Earring",
left_ring="Warden's Ring",
right_ring="Defending Ring",
back="Solemnity Cape",
}
sets.idle.Town = {}
sets.idle.Weak = sets.idle
-- Defense sets
sets.defense.Evasion = sets.idle
sets.defense.PDT = sets.idle
sets.defense.MDT = sets.idle
--****************
--** Melee sets **
--****************
-- Normal melee group
sets.engaged = {
head="Adhemar Bonnet +1",
body="Pillager's Vest +3",
hands={ name="Adhemar Wrist. +1", augments={'STR+12','DEX+12','Attack+20',}},
legs="Samnuha Tights",
feet="Plunderer's Poulaines +3",
neck="Iskur Gorget",
waist="Reiki Yotai",
left_ear="Dedition Earring",
right_ear="Sherida Earring",
left_ring="Hetairoi Ring",
right_ring="Epona's Ring",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
sets.engaged.Acc = {
head="Pill. Bonnet +3",
body="Pillager's Vest +3",
hands="Pillager's Armlets +3",
legs="Pill. Culottes +3",
feet="Pill. Poulaines +3",
neck="Erudit. Necklace",
waist="Reiki yotai",
left_ear="Cessance Earring",
right_ear="Digni. Earring",
left_ring="Mouflon Ring",
right_ring="Cacoethic Ring +1",
back={ name="Toutatis's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
-- Mod set for trivial mobs
sets.engaged.Mod = {}
-- Mod set for trivial mobs
sets.engaged.Mod2 = {}
sets.engaged.Evasion = {}
sets.engaged.Acc.Evasion = {}
sets.engaged.PDT = {}
sets.engaged.Acc.PDT = {}
sets.facing = {body={ name="Plunderer's Vest +3", augments={'Enhances "Ambush" effect',}}}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the general precast() is done.
function job_post_precast(spell, action, spellMap, eventArgs)
if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
equip(sets.TreasureHunter)
elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' or spell.type == 'WeaponSkill' then
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)
end
end
end
-- Run after the general midcast() set is constructed.
function job_post_midcast(spell, action, spellMap, eventArgs)
if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
equip(sets.TreasureHunter)
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
-- Weaponskills wipe SATA/Feint. Turn those state vars off before default gearing is attempted.
if spell.type == 'WeaponSkill' and not spell.interrupted then
state.Buff['Sneak Attack'] = false
state.Buff['Trick Attack'] = false
state.Buff['Feint'] = false
end
end
-- Called after the default aftercast handling is complete.
function job_post_aftercast(spell, action, spellMap, eventArgs)
-- If Feint is active, put that gear set on on top of regular gear.
-- This includes overlaying SATA gear.
check_buff('Feint', eventArgs)
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
function get_custom_wsmode(spell, spellMap, defaut_wsmode)
local wsmode
if state.Buff['Sneak Attack'] then
wsmode = 'SA'
end
if state.Buff['Trick Attack'] then
wsmode = (wsmode or '') .. 'TA'
end
return wsmode
end
-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
function job_handle_equipping_gear(playerStatus, eventArgs)
-- Check that ranged slot is locked, if necessary
check_range_lock()
-- Check for SATA when equipping gear. If either is active, equip
-- that gear specifically, and block equipping default gear.
check_buff('Sneak Attack', eventArgs)
check_buff('Trick Attack', eventArgs)
end
function customize_idle_set(idleSet)
if player.hpp < 80 then
idleSet = set_combine(idleSet, sets.ExtraRegen)
end
return idleSet
end
function customize_melee_set(meleeSet)
if state.TreasureMode.value == 'Fulltime' then
meleeSet = set_combine(meleeSet, sets.TreasureHunter)
end
if check_facing() == true then
meleeSet = set_combine(meleeSet, sets.facing)
else
meleeSet = sets.engaged --this doesn't work?
end
return meleeSet
end
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
th_update(cmdParams, eventArgs)
check_facing()
get_combat_form()
end
-- Function to display the current relevant user state when doing an update.
-- Return true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
local msg = 'Melee'
if state.CombatForm.has_value then
msg = msg .. ' (' .. state.CombatForm.value .. ')'
end
msg = msg .. ': '
msg = msg .. state.OffenseMode.value
if state.HybridMode.value ~= 'Normal' then
msg = msg .. '/' .. state.HybridMode.value
end
msg = msg .. ', WS: ' .. state.WeaponskillMode.value
if state.DefenseMode.value ~= 'None' then
msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
end
if state.Kiting.value == true then
msg = msg .. ', Kiting'
end
if state.PCTargetMode.value ~= 'default' then
msg = msg .. ', Target PC: '..state.PCTargetMode.value
end
if state.SelectNPCTargets.value == true then
msg = msg .. ', Target NPCs'
end
msg = msg .. ', TH: ' .. state.TreasureMode.value
add_to_chat(122, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- State buff checks that will equip buff gear and mark the event as handled.
function check_buff(buff_name, eventArgs)
if state.Buff[buff_name] then
equip(sets.buff[buff_name] or {})
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)
end
eventArgs.handled = true
end
end
-- Check for various actions that we've specified in user code as being used with TH gear.
-- This will only ever be called if TreasureMode is not 'None'.
-- Category and Param are as specified in the action event packet.
function th_action_check(category, param)
if category == 2 or -- any ranged attack
--category == 4 or -- any magic action
(category == 3 and param == 30) or -- Aeolian Edge
(category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
(category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
then return true
end
end
-- Function to lock the ranged slot if we have a ranged weapon equipped.
function check_range_lock()
if player.equipment.range ~= 'empty' then
disable('range', 'ammo')
else
enable('range', 'ammo')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(1, 4)
elseif player.sub_job == 'WAR' then
set_macro_page(1, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(1, 4)
else
set_macro_page(1, 4)
end
end
function job_buff_change(buff, gain)
-- Equip DT when terror/stoned/sleep/stun
if buff:lower()=='terror' or buff:lower()=='petrification' or buff:lower()=='sleep' or buff:lower()=='stun' then
if gain then
equip(sets.defense.PDT)
elseif not gain then
handle_equipping_gear(player.status)
end
end
-- IDK what this does
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
-- Equip Frenzy Sallet when asleep
if buff:lower()=='sleep' then
if gain and player.hp > 120 and player.status == "Engaged" then
send_command('@input /echo ---------------------- putting on Frenzy sallet! -----')
equip({head="Frenzy Sallet"})
elseif not gain then
handle_equipping_gear(player.status)
end
end
end
function set_lockstyle()
send_command('wait 8; input /lockstyleset 1')
end
---------------------------------------------------------------------------------------------------
-- Plunderer's Vest +3 *** (currently not unequipping when not true)
-- check_facing() also used in user_setup, job_setup, job_update, job_status_change, customize_melee_set,
---------------------------------------------------------------------------------------------------
require('vectors')
--does nothing?
function get_combat_form()
state.CombatForm:reset()
end
function job_status_change(new_status, old_status)
if new_status == 'Engaged' then
check_facing()
get_combat_form()
end
end
function check_facing()
if player.target.type == 'MONSTER' then
local target = windower.ffxi.get_mob_by_target('t')
local player = windower.ffxi.get_mob_by_target('me')
local dir_target = V{player.x, player.y} - V{target.x, target.y}
local dir_player = V{target.x, target.y} - V{player.x, player.y}
local player_heading = V{}.from_radian(player.facing)
local target_heading = V{}.from_radian(target.facing)
local player_angle = V{}.angle(dir_player, player_heading):degree():abs()
local target_angle = V{}.angle(dir_target, target_heading):degree():abs()
if player_angle < 90 and target_angle < 90 then -- currently 'facing' not 'behind', needs changed
send_command('@input /echo ----------------------- AMBUSHING -----')
return true
else
return false
end
end
end
function getAngle(index)
local P = windower.ffxi.get_mob_by_target('me') --get player
local M = index and windower.ffxi.get_mob_by_id(index) or windower.ffxi.get_mob_by_target('t') --get target
local delta = {Y = (P.y - M.y),X = (P.x - M.x)} --subtracts target pos from player pos
local angleInDegrees = (math.atan2( delta.Y, delta.X) * 180 / math.pi)*-1
local mult = 10^0
return math.floor(angleInDegrees * mult + 0.5) / mult
end
By Nyarlko 2018-08-18 14:21:05
How would I go about adding a conditional equip based on a debuff timer?
Basically, I want to equip Wicce Chausses +1 on the first cast of a -ja, then equip normal macc/mab gear for successive -ja casts until the debuff wears off after 100sec, then repeat the process again.
Would prefer to have it as a 100% GS function rather than tie in to Timers (since I frequently reload that to clear my screen,) in a non-Mote lua file.
Server: Asura
Game: FFXI
Posts: 9
By Asura.Phelence 2018-08-18 16:50:43
I feel like i've been in here alot lately lol.
My gearswap saids Gearswap/Gearswap.lua:118: Missing resources! What is the hell does that mean? ; ; I'm assuming it has something to do with the Error: Failed to read Status, Item_Armor,Item General, Item Weapon?
Having the same problem, and it doesn't appear to be a permission issue. Does anyone know what could cause this?
EDIT: I should note that this is after a fresh install of both FFXI and windower (dev version), on a Win10 system.
Asura.Byrne
By Asura.Byrne 2018-08-19 03:59:23
I've had a rather odd issue today.
On two separate occasions, my idlesets on my RUN lua would stop working. Normally they work just fine, and each returns to the proper idleSet depending on which i'm cycled into. However for some reason, it will eventually hang, and idlesets will stop working altogether. It's especially odd because the melee sets, and even conditional arguments within the customize_melee_sets works just fine, but the idle sets will be broken.
I tried a few things to get it working again initially to no avail, then two random things fixed it and I can't for the life of me figure out why.
The first instance was during Omen.
Initially I tried:
1) Reloading the lua (did not work)
2) Reloading Gearswap (Did not work)
3) Reloading Windower (Did not work)
4) Restarting PC (Did not work)
5) using //gs equip sets.idle to manually equip it. (fixed the problem, which is especially weird given it was still persisting after restarting my PC)
Then, later in the day, the issue resurfaced. This time while doing some Carousing Celine with some Linkshell mates.
I tried restarting the lua, restarting Gearswap, and reloading windower, as well as using //gs equip sets.idle to try fixing it to no avail (which frankly had me scratching my head) so then I loaded my brother's lua that was a bit older, just to make sure I hadn't bungled any arguments in the lua. It had the same problem.
This time, I figured maybe the problem was with gearswap itself, so I swapped to RDM in mhuara, and the issue disappeared! Swapped back to RUN, and the lua worked just fine.
I'm going insane! WTH is causing this?
Asura.Byrne
By Asura.Byrne 2018-08-19 04:58:25
I feel like i've been in here alot lately lol.
My gearswap saids Gearswap/Gearswap.lua:118: Missing resources! What is the hell does that mean? ; ; I'm assuming it has something to do with the Error: Failed to read Status, Item_Armor,Item General, Item Weapon?
Having the same problem, and it doesn't appear to be a permission issue. Does anyone know what could cause this?
EDIT: I should note that this is after a fresh install of both FFXI and windower (dev version), on a Win10 system.
These errors mean you are missing some libraries required for the applet to work properly.
I would say, make sure you aren't missing these:
Mote-Globals.lua
Mote-Include.lua
Mote-Mappings.lua
Motenten-Globals.lua
Mote-SelfCommands.lua
Mote-Utility.lua
Modes.lua
In my case I have these files in the Data folder, and the libs folder, as well as a rev1 folder inside that libs folder. Not sure that they all need to be there, but I don't think it hurts either.
If everything looks like it's in order, try using the non-dev version of Windower.
More specifically, to Topace. That section of the Gearswap.lua contains this argument:
Code if res.items and res.bags and res.slots and res.statuses and res.jobs and res.elements and res.skills and res.buffs and res.spells and res.job_abilities and res.weapon_skills and res.monster_abilities and res.action_messages and res.skills and res.monstrosity and res.weather and res.moon_phases and res.races then
else
error('Missing resources!')
end
You are missing resources under:
Program Files/Windower4/res
That's a folder, and you're apparently missing at least one or two lua files from there. It should look like this:
Asura.Byrne
By Asura.Byrne 2018-08-19 05:57:22
It does swap in Hachirin-no-Obi when storm2 is up, but now it swaps to Hachirin-no-Obi for all nukes even if it's not matching storm2.
The logic of the argument checks out, I'd try adjusting the grouping.
Carbuncle.Kigensuro said: »
local storm_element = function() for i,v in pairs({Fire=589,Ice=590,Wind=591,Earth=592,Lightning=593,Water=594,Light=595,Dark=596,}) do
if buffactive[v] then return i end end end
if (spell.element == world.day_element and spell.element == world.weather_element
or S{"Heat waves","Squalls","Sand storms","Gales","Blizzards","Thunderstorms","Stellar glare","Darkness"}:contains(world.weather)
or storm_element == spell.element) and (spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
equip({waist="Hachirin-no-Obi"})
elseif spell.skill == 'Elemental Magic' and spell.target.distance < target_distance then
equip({waist="Orpheus's Sash"})
end
The issue might be right after the second ==
You want it to recognize the first condition, being spell.element == world.day_element AND (maybe group the secondary conditions in their own parenthetical)
You may even need to back up and start the argument with the
if ((spell.skill == 'Elemental Magic' and spellMap ~='Helix' ) or string.find (spell.english, 'Cure' )) then
if
Blah blah blah
Which part you start it with shouldn't make a difference to how it ends up working, but it may make it easier to look at, and generally legibility makes finding errors easier.
Bismarck.Faelar
Server: Bismarck
Game: FFXI
Posts: 4108
By Bismarck.Faelar 2018-08-21 22:15:35
Would it mess my lua up if I had too many functions set up?
Something like this would still work, no?
Code
function precast(spell)
if spell.prefix == '/magic' then
-- Magic precast
equip(sets.FastCast)
end
end
function midcast(spell)
if spell.english:contains("Cure") or spell.english:contains("Cura") then
equip(sets.Cure)
end
end
function midcast(spell)
if spell.english:contains("Regen") then
equip(sets.Regen)
end
end
function midcast(spell)
if spell.english:contains("Cursna") then
equip(sets.Cursna)
end
end
function midcast(spell)
if spell.english:contains("Erase") then
equip(sets.Erase)
end
end
function aftercast(spell)
if player.status=='Idle' then
equip(sets.Idle)
end
end
Carbuncle.Kigensuro
Server: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2018-08-21 23:25:56
Would it mess my lua up if I had too many functions set up? no as long as they have different names
functions just allow you to
1. compartmentalize your code
--libs are compartmentalized code so is gearswaps equip(set)
2. allows you to do things that you you cant check in an if
--like for loops
3. allows you to use the same code multiple times in different locations without having to rewrite the same code again and again
--gearswaps equip(set) is a function of this kind
4. it can be used to make it easier to read your code
gearswap just tries to minimize the amount of code you need to write to do the things you want to do
--edited--
Server: Cerberus
Game: FFXI
Posts: 1786
By Cerberus.Shadowmeld 2018-08-22 16:56:07
Would it mess my lua up if I had too many functions set up?
Something like this would still work, no?
Code
function precast(spell)
if spell.prefix == '/magic' then
-- Magic precast
equip(sets.FastCast)
end
end
function midcast(spell)
if spell.english:contains("Cure") or spell.english:contains("Cura") then
equip(sets.Cure)
end
end
function midcast(spell)
if spell.english:contains("Regen") then
equip(sets.Regen)
end
end
function midcast(spell)
if spell.english:contains("Cursna") then
equip(sets.Cursna)
end
end
function midcast(spell)
if spell.english:contains("Erase") then
equip(sets.Erase)
end
end
function aftercast(spell)
if player.status=='Idle' then
equip(sets.Idle)
end
end
That won’t work for a few reasons.
1 lua doesn’t support function overloading. (Multiple methods with the same name)
2 function overloading, if lua did support it, requires that each signature have distinct parameters.
Bismarck.Faelar
Server: Bismarck
Game: FFXI
Posts: 4108
By Bismarck.Faelar 2018-08-26 12:17:24
Cerberus.Shadowmeld said: »
That won’t work for a few reasons.
1 lua doesn’t support function overloading. (Multiple methods with the same name)
2 function overloading, if lua did support it, requires that each signature have distinct parameters.
This is what I was originally asking about.
But it *was* working, but now it's not. How to fix it?
Cerberus.Drayco
Server: Cerberus
Game: FFXI
Posts: 347
By Cerberus.Drayco 2018-08-27 17:26:47
I'm just diving into using Sch GS and I'm having some issues with the self SC. I can only get my level 1 SC to go off in fire mode. No other element will use the second Immanence in either SC1 or SC2. Any idea what's wrong?
Here is the code from my SCH.lua for SC 1.
Code elseif command == 'skillchain1' then
if player.target.type ~= "MONSTER" then
add_to_chat(123,'Abort: You are not targeting a monster.')
elseif buffactive.silence or buffactive.mute or buffactive.paralysis then
add_to_chat(123,'You are silenced, muted, or paralyzed, cancelling skillchain.')
elseif (get_current_strategem_count() + immactive) < 2 then
add_to_chat(123,'Abort: You have less than two stratagems available.')
elseif not (state.Buff['Dark Arts'] or state.Buff['Addendum: Black']) then
add_to_chat(123,'Can\'t use elemental skillchain commands without Dark Arts - Activating.')
windower.chat.input('/ja "Dark Arts" <me>')
elseif state.ElementalMode.value ~= nil then
if not buffactive['Immanence'] then windower.chat.input('/ja "Immanence" <me>') end
if state.ElementalMode.value == 'Fire' then
windower.chat.input('/p '..auto_translate('Liquefaction')..' -<t>- MB: '..auto_translate('Fire')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Stone" <t>')
windower.chat.input:schedule(5,'/ja "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Liquefaction')..' -<t>- MB: '..auto_translate('Fire')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Fire" <t>')
elseif state.ElementalMode.value == 'Wind' then
windower.chat.input('/p '..auto_translate('Detonation')..' -<t>- MB: '..auto_translate('wind')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Stone" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Detonation')..' -<t>- MB: '..auto_translate('wind')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Aero" <t>')
elseif state.ElementalMode.value == 'Lightning' then
windower.chat.input('/p '..auto_translate('Impaction')..' -<t>- MB: '..auto_translate('Thunder')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Water" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Impaction')..' -<t>- MB: '..auto_translate('Thunder')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Thunder" <t>')
elseif state.ElementalMode.value == 'Light' then
windower.chat.input('/p '..auto_translate('Transfixion')..' -<t>- MB: '..auto_translate('Light')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Noctohelix" <t>')
windower.chat.input:schedule(6,'/ma "Immanence" <me>')
windower.chat.input:schedule(7,'/p '..auto_translate('Transfixion')..' -<t>- MB: '..auto_translate('Light')..' <scall21> CLOSE!')
windower.chat.input:schedule(7,'/ma "Luminohelix" <t>')
elseif state.ElementalMode.value == 'Earth' then
windower.chat.input('/p '..auto_translate('Scission')..' -<t>- MB: '..auto_translate('earth')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Fire" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Scission')..' -<t>- MB: '..auto_translate('earth')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Stone" <t>')
elseif state.ElementalMode.value == 'Ice' then
windower.chat.input('/p '..auto_translate('Induration')..' -<t>- MB: '..auto_translate('ice')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Water" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Induration')..' -<t>- MB: '..auto_translate('ice')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Blizzard" <t>')
elseif state.ElementalMode.value == 'Water' then
windower.chat.input('/p '..auto_translate('Reverberation')..' -<t>- MB: '..auto_translate('Water')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Stone" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Reverberation')..' -<t>- MB: '..auto_translate('Water')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Water" <t>')
elseif state.ElementalMode.value == 'Dark' then
windower.chat.input('/p '..auto_translate('Compression')..' -<t>- MB: '..auto_translate('Darkness')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Blizzard" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Compression')..' -<t>- MB: '..auto_translate('Darkness')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Noctohelix" <t>')
else
add_to_chat(123,'Abort: '..state.ElementalMode.value..' is not an Elemental Mode with a skillchain1 command!')
end
end
and SC2 Code elseif command == 'skillchain2' then
if player.target.type ~= "MONSTER" then
add_to_chat(123,'Abort: You are not targeting a monster.')
elseif buffactive.silence or buffactive.mute or buffactive.paralysis then
add_to_chat(123,'You are silenced, muted, or paralyzed, cancelling skillchain.')
elseif (get_current_strategem_count() + immactive) < 2 then
add_to_chat(123,'Abort: You have less than two stratagems available.')
elseif not (state.Buff['Dark Arts'] or state.Buff['Addendum: Black']) then
add_to_chat(123,'Can\'t use elemental skillchain commands without Dark Arts - Activating.')
windower.chat.input('/ja "Dark Arts" <me>')
elseif state.ElementalMode.value ~= nil then
if not buffactive['Immanence'] then windower.chat.input('/ja "Immanence" <me>') end
if state.ElementalMode.value == 'Fire' or state.ElementalMode.value == 'Light' then
windower.chat.input('/p '..auto_translate('Fusion')..' -<t>- MB: '..auto_translate('Fire')..' '..auto_translate('Light')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Fire" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Fusion')..' -<t>- MB: '..auto_translate('Fire')..' '..auto_translate('Light')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Thunder" <t>')
elseif state.ElementalMode.value == 'Wind' or state.ElementalMode.value == 'Lightning' then
windower.chat.input('/p '..auto_translate('Fragmentation')..' -<t>- MB: '..auto_translate('wind')..' '..auto_translate('Thunder')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Blizzard" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Fragmentation')..' -<t>- MB: '..auto_translate('wind')..' '..auto_translate('Thunder')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Water" <t>')
elseif state.ElementalMode.value == 'Earth' or state.ElementalMode.value == 'Dark' then
windower.chat.input('/p '..auto_translate('Gravitation')..' -<t>- MB: '..auto_translate('earth')..' '..auto_translate('Darkness')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Aero" <t>')
windower.chat.input:schedule(5,'/ma "Immanence" <me>')
windower.chat.input:schedule(6,'/p '..auto_translate('Gravitation')..' -<t>- MB: '..auto_translate('earth')..' '..auto_translate('Darkness')..' <scall21> CLOSE!')
windower.chat.input:schedule(6,'/ma "Noctohelix" <t>')
elseif state.ElementalMode.value == 'Ice' or state.ElementalMode.value == 'Water' then
windower.chat.input('/p '..auto_translate('Distortion')..' -<t>- MB: '..auto_translate('ice')..' '..auto_translate('Water')..' <scall21> OPEN!')
windower.chat.input:schedule(1,'/ma "Luminohelix" <t>')
windower.chat.input:schedule(7,'/ma "Immanence" <me>')
windower.chat.input:schedule(8,'/p '..auto_translate('Distortion')..' -<t>- MB: '..auto_translate('ice')..' '..auto_translate('Water')..' <scall21> CLOSE!')
windower.chat.input:schedule(8,'/ma "Stone" <t>')
else
add_to_chat(123,'Abort: '..state.ElementalMode.value..' is not an Elemental Mode with a skillchain1 command!')
end
end
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|