There is a logical error in this loop, which can result in certain items (in this case, script files) being skipped. For example: if you are checking the 5th file and find it infected, you /unload the script. But doing so, the 6th script (as reported by $script(%a)) now becomes the 5th script, the 7th becomes the 6th etc. However, %a is still incremented, so when you move on to the 6th script, it is actually the 7th. The result is that the (initial) 6th file is skipped.

You have to either
1) insert an "else" in front of "inc %a" or
2) insert a "continue" right below the echo command or
3) make the loop decrementing, starting from $script(%a), where %a is initially set to $script(0) and /dec-ing %a

On a sidenote, I'd use the -n switch in /unload, to avoid triggering a possible on UNLOAD event in that script. Also, I'd use the ! prefix for commands, to avoid problems in case that script has aliased mirc's built-in commands.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com