Extra Songs Auto-Lua

Eorzea Time
 
 
 
言語: JP EN FR DE
日本語版のFFXIVPRO利用したい場合は、上記の"JP"を設定して、又はjp.ffxivpro.comを直接に利用してもいいです
users online
フォーラム » FFXI » Jobs » Bard » Extra Songs Auto-Lua
Extra Songs Auto-Lua
Offline
Posts: 182
By Sammeh 2017-03-24 06:50:41  
So - I was getting kind of tired of hitting a separate keypress to put on extra songs (3,4) so I started this.

First note: I can see potential complications (for example: party members w/ Pianissimo etc. I think I can solve this w/ taking code from the 'Party Buffs' add-on and building a table; but I digress.

Anyway this is what I have thus far.
Code
Setup:
info.MaxSongs = 4
info.ExtraSongInstrument = 'Daurdabla'

PreCast:

-- Auto use Extra Song Instrument for Buffs if less than max # of songs
	
	local bard_buff_ids = S{195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 221, 222}
	
	num_bard_songs = 0
	local self = windower.ffxi.get_player()
	for i,v in pairs(self.buffs) do
		if bard_buff_ids:contains(v) then
		   num_bard_songs = num_bard_songs +1
		end
	end
	
	local generalClass = get_song_class(spell)
	if num_bard_songs < info.MaxSongs and spell.name ~= 'Honor March' and generalClass == 'SongEffect' then
		windower.add_to_chat(10,"Swapping to "..info.ExtraSongInstrument.."! Number of bard buffs = "..num_bard_songs)
		equip({range=info.ExtraSongInstrument})
	end
	-- end --
	


MidCast:

	-- Auto use Extra Song Instrument for Buffs if less than max # of songs
	if num_bard_songs < info.MaxSongs and spell.name ~= 'Honor March' and generalClass == 'SongEffect' then
		equip({range=info.ExtraSongInstrument})
	end
	-- end -- 





Testing seems to work - but only spent about 15 min on it this morning. Let me know your thoughts or things I can codify into situations (as mentioend before, for pianimisso and target information etc etc).
Offline
Posts: 182
By Sammeh 2017-03-24 06:51:18  
Just hit myself with another 'whatif' scenario is a 2nd bard in party.... that'd make things quite confusing as well..... hrmmmmmmm
Offline
Posts: 15
By mrpresident 2017-03-24 08:45:44  
I think to make this work, you would have to track each of your own songs individually. For example, you could create a table for each member of your party, and when you cast a new song, it gets added to the table.

You could update new songs with your post-cast. If your song is not interrupted, then each member who receives the effect has the song added to their table. You could monitor someone losing the song effect with functions like those used in the party buff addon, so if a song effect is lost in any way, and it's on your custom table, it gets dropped. I'm sure there are a lot of details here that would have to get worked through, but I think that should work.

With 2 songs active, your table might look like this:
Code
Info.MySongs = {
  ["player name"] = {
    [1] = "song name",
    [2] = "song2 name",
    [3] = false,
    [4] = false,},
  ["player2 name"]...
  Etc.
}
 Leviathan.Comeatmebro
Offline
サーバ: Leviathan
Game: FFXI
user: Rairin
Posts: 6052
By Leviathan.Comeatmebro 2017-03-24 08:48:24  
You'd also have to watch for other BRDs overwriting your songs and keep in mind that you can't apply honor march with daurdabla. Overall, I think a macro to make next song cast in daur is already more than sufficient.
Offline
Posts: 15
By mrpresident 2017-03-24 09:01:34  
You could monitor songs being overwritten by registering the action event:
Code
windower.register_event('action', function(act)
    --[[ Code to execute ]]
end)


And then pulling actor_id. If actor_id isn't you, and the song is on the table, it gets dropped.

I haven't really played much on Brd, so I don't know all the rules for how songs get over-written, but that's a start.