Gearswap Question (Looping Through Each Set)

Eorzea Time
 
 
 
言語: JP EN FR DE
日本語版のFFXIVPRO利用したい場合は、上記の"JP"を設定して、又はjp.ffxivpro.comを直接に利用してもいいです
users online
フォーラム » Windower » General » Gearswap Question (Looping through each set)
Gearswap Question (Looping through each set)
Offline
Posts: 182
By Sammeh 2017-02-28 13:29:44  
Byrth I presume you're the best to answer this - but will take anyone in community.

Someone actually PM'd me asking about wanting to know some delta's about HP and was statically defining HP in his LUA. I wanted to see if I could somehow automate and/or 'update' this a little easier. so I felt I could loop through all gearsets inside of 'sets'; equip it - record the vitals and then use that data as variables later.

The quick code I came up with (not working):
Code
		for set,tableset in pairs(sets) do
			if type(tableset) == 'table' then 
				print(set)
				--equip(tableset)
				send_command("gs equip sets."..set)
				print(player.hp)
				hpsets[set] = player.hp
				--(need to sleep here)
			end
		end


(Figured easy enough to start w/ hp, but ultimately record all the vitals in either player table or windower.ffxi.get_player() )

The problem is there's no way to sleep (that I can find, because coroutine.sleep is turned off) to iterate over each set. (there's other problems, such as nested tables but I digress).

Anyway - any ideas here are appreciated.
[+]
 Leviathan.Comeatmebro
Offline
サーバ: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2017-02-28 13:56:38  
was toying with the idea of automatic priority by calculating hp on each piece of gear and working from there

resources should have the items text and some basic text parsing can pull the hp values from that
 Leviathan.Comeatmebro
Offline
サーバ: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2017-02-28 13:59:29  
for that matter, one good text parser could do a hell of a lot for DPS calculators.. having a full database of armor stats would be great
 Lakshmi.Byrth
VIP
Offline
サーバ: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6137
By Lakshmi.Byrth 2017-02-28 13:59:35  
I implemented HP-based priority in my paladin gearswap using the priority= field of the advanced table, but I hardcoded the values because I didn't feel like parsing the item resources.

item_descriptions.lua takes up a lot of space in memory and >:/

Also, because you define gear in GearSwap by name rather than ID, you'd have to iterate over all the names to find the appropriate name, then use that name to find the description, then parse the description, etc. It would be something that you have to prepare on load rather than on access.

Here is my code: https://gist.github.com/Byrth/7f59eef0ef655708274ad1b958129e2a
[+]
 Bahamut.Colonelace
Offline
サーバ: Bahamut
Game: FFXI
Posts: 253
By Bahamut.Colonelace 2017-02-28 15:22:30  
thats an interesting pld lua. wish i understood gs enough to make my own personal pld lua.
necroskull Necro Bump Detected! [54 days between previous and next post]
 Asura.Baddog
Offline
サーバ: Asura
Game: FFXI
user: Maddog
Posts: 52
By Asura.Baddog 2017-04-23 05:36:51  
I was told earlier it was possible to change which armor equips first when you swap, for tanking your HP can still dip low if a low hp armor is equipped before a higher hp piece can compensate in the set to keep your max high.

I'm a GS noob compared to many but looking at byrth's lua it looks like he simply defined the hp on all the armors and added

set_priorities(gearswap.equip_list,gearswap.equip_list_history,'hp'

to each function, is that all there is to it?