for example:
on *:exit:{
var %i = 1
while (%i <= $scon(0)) {
scon %i
;here u put two loops with $query() and $chan()
inc %i
}
}
the loops should be something like this:
var %x = 1
while (%x <= $chan(0)) {
;here is a command that will do something with the $chan(%x)
inc %x
}
for query is the same as that loop but with $query()