Wow, that plugin will for sure be a timesaver for me. Thank you for that. I pasted it into a test mac and, after correcting for the inevitable paste mistake that I so often make (i.e. Bracket Hell), it worked right off. But just so you know...I was on my way to a solution dammit (lol). I scoured the mq2 pdf docs from 2016 and found the ini TLO. I learned how to manipulate it into seeing an ini file and how to draw out entries in that ini file:
${Ini[debuffs.ini,debuffs,1]} ---> this would find the file debuffs.ini, look in the section called [debuffs], and look at the value of entry number 1. In this case, I had in that file 1=Creeping Doom. Further entries would have been like 2=Skeleton Plague, 3=Blight of Hate, etc.
The next step I was trying to figure out was to change the 1 into a /for /next routine. Perhaps /for x 1 to 20 and then change the ini to ${Ini[debuffs.ini,debuffs,(x)]}...or maybe ${Ini[debuffs.ini,debuffs,[1]]}, not sure which.
But then I thought ut oh...the ini itself would already be within a for/next...can for/next be nested, i.e. does mq2 allow a for/next to be within a for/next? I don't think all scripting languages allow this.
The next thought I had...after really looking at the nature of buffs...is "how does the GIft know the difference between a buff and a debuff?". And then your timely post answered that. Judging by the mq2debuffs documentation over at redguides:
https://www.redguides.com/community/res ... buffs.117/I assume that in the emu source code...in its spell database...there is an entry for each spell that simply says "is this a bad buff yes/no?". And that one of the things that mq2debuffs does is add a TLO that looks for that bit of data.
It seems like, in theory, the only $ that should be needed for the auto Gift is ${Debuff.Detrimentals}. But since you included Counters and plain Debuff, then either there are debuffs that should have the detrimentals flag but don't...or...my definition of detrimental and the emu source code's definition of detrimental are not the same. 8-)
I was hoping that mq2debuffs would also have a way to actually name the spell that it sees, but most of the TLO variations look to be either Boolean (it simply returns True or False) or int (integer...returns a number). The only variation seems to be a string is at the bottom of the aforementioned documentation page: Debuff.X. But when I test that using /echo ${Debuff.X} while wearing a debuff, MQ2 says NULL.
Btw...the place where I test this stuff is in dsk2, in the area around the zone in...the Vehemet Bats. They can be agroed singly or in pairs, do not hit hard (with respect to a donored sk), will stand up to numerous ripostes, and cast Bat Sonar.