Ok Now you got that, here's a little more optimizing for you

You can use filter here with the -o switch
on *:dialog:MainMenu:init:*: {
filter -fo loaded.txt MainMenu 10 *
Then loop through the listbox with $did()
var %i = 1
while ($did(MainMenu,10,%i)) {
var %a = $v1
if ($readini(bots.ini,%a,connected) == connected) { did -o MainMenu 10 %i %a (C) }
inc %i
}
}
Consider using a hash table for this, especially the 'is connected' part.
