Here's the code that I saw in your original post, but re-written to use a while loop
on syscon:text:!list_ignored:#:{
if !$ignore(0) { msg $chan No entries in the ignore list. }
else {
var %a = 1, %b = $ignore(0)
while %a <= %b {
.write -c c:\IcyBot2\Scripts\ignore_list.txt $ignore(%a)
inc %a
}
play $chan C:\IcyBot2\Scripts\ignore_list.txt 1750
}
}
I don't know why you write to the text file each time, when the only one that'll end up showing is the one that matches the value of $ignore(0). With this being the case, I'd like to suggest you consider this
on syscon:text:!list_ignored:#:{
if !$ignore(0) { msg $chan No entries in the ignore list. }
else {
.write -c c:\IcyBot2\Scripts\ignore_list.txt $ignore(0)
play $chan C:\IcyBot2\Scripts\ignore_list.txt 1750
}
}