Gearswap Support Thread

Language: JP EN DE FR
2010-09-08
New Items
105 users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 140 141
 Cerberus.Drayco
Offline
Server: Cerberus
Game: FFXI
user: Drayco
Posts: 294
By Cerberus.Drayco 2018-08-08 09:05:58
Link | Quote | Reply
 
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
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 571
By Shiva.Hiep 2018-08-09 18:13:19
Link | Quote | Reply
 
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
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-09 23:45:16
Link | Quote | Reply
 
Shiva.Hiep 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)
[+]
 Quetzalcoatl.Langly
Offline
Server: Quetzalcoatl
Game: FFXI
user: Langly
Posts: 488
By Quetzalcoatl.Langly 2018-08-10 00:00:48
Link | Quote | Reply
 
Cerberus.Drayco said: »
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
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 571
By Shiva.Hiep 2018-08-10 08:21:36
Link | Quote | Reply
 
Carbuncle.Kigensuro said: »
Shiva.Hiep 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
Code
target_distance = 14


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
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-10 09:13:47
Link | Quote | Reply
 
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
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-10 09:31:54
Link | Quote | Reply
 
Shiva.Hiep said: »
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
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 571
By Shiva.Hiep 2018-08-10 10:37:36
Link | Quote | Reply
 
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
Offline
Server: Asura
Game: FFXI
user: Truece
Posts: 24
By Asura.Truece 2018-08-10 10:52:10
Link | Quote | Reply
 
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
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-11 11:43:23
Link | Quote | Reply
 
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
Offline
Server: Asura
Game: FFXI
user: Truece
Posts: 24
By Asura.Truece 2018-08-11 22:18:00
Link | Quote | Reply
 
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
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-12 00:03:57
Link | Quote | Reply
 
Asura.Truece 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
[+]
 Lakshmi.Reddwarf
Offline
Server: Lakshmi
Game: FFXI
user: Reddwarf
Posts: 154
By Lakshmi.Reddwarf 2018-08-12 01:49:32
Link | Quote | Reply
 
Asura.Truece said: »
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
Offline
Server: Asura
Game: FFXI
user: Truece
Posts: 24
By Asura.Truece 2018-08-13 09:27:50
Link | Quote | Reply
 
Carbuncle.Kigensuro said: »
Asura.Truece 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!
First Page 2 3 ... 140 141
Log in to post.