Closed wren-dan closed 1 year ago
I started playing around in VS and got the following code working that fits my needs, posting here in case this is helpful for others:
//lets play a song!
Data.Spell songToPlay= _songs.Dequeue();
_songs.Enqueue(songToPlay);
string BuffSecondsLeftQuery = "${Me.Buff[" + songToPlay.SpellName + "].Duration.TotalSeconds}";
string SongSecondsLeftQuery = "${Me.Song[" + songToPlay.SpellName + "].Duration.TotalSeconds}";
if (MQ.Query<Int32>(BuffSecondsLeftQuery) > 9 || MQ.Query<Int32>(SongSecondsLeftQuery) > 9)
{
return;
}
added code with a comment of this. will be in the next release.
Goal: Skip Casting Song Buffs that are currently active with more than 9 seconds left of Duration.
Maybe something like the following is close ?
//lets play a song! Data.Spell songToPlay= _songs.Dequeue(); _songs.Enqueue(songToPlay);
bool BuffUp = MQ.Query("${Me.Buff[{songToPlay}].ID}") || MQ.Query("${Me.Song[{songToPlay}].ID}");
Int32 BuffSecondsLeft = MQ.Query("${Me.Buff[{songToPlay}].Duration.TotalSeconds}");
Int32 SongSecondsLeft = MQ.Query("${Me.Song[{songToPlay}].Duration.TotalSeconds}");
if(BuffUp && (BuffSecondsLeft > 9 || SongSecondsLeft > 9 )) { return; }
if(Casting.CheckReady(songToPlay)) { MQ.Write($"\atTwist \ag{songToPlay.SpellName}"); Casting.Sing(0, songToPlay); }