on *:dialog:MainMenu:init:*: {
if ($read(loaded.txt) != $null) {
set %countloaded 1
while ($read(loaded.txt, %countloaded) != $null) {
set %botname $read(loaded.txt, %countloaded)
did -a MainMenu 10 %botname
if ($readini(bots.ini,%botname,connected) == connected) { did -ri MainMenu 10 %countloaded %botname (C) }
inc %countloaded
}
halt
}
}
Okay, well, as you can see from this code... I'm trying to make it loop through a text file, reading all names, and then reads out their name into a dialog list, and it also checks bots.ini to check to see if they are connected, and by default it writes only their name, but if it sees that connected=connected it will delete that, and write the botname again with (C) on end to indicate the bot is connected. I tested it, when the first bot said connected=connected and second bot in list said connected=not connected, it worked as expected, came out with
But if it up, like make it so only bot2 is connected, it doesn't appear with anything in dialog? same with if I make them both connected. If Their both not connected, it also pops up as expected by not having any (C)'s. How can I fix this? Also, if you could think of a way of my script being better organised, please help, since did -ri MainMenu seems a lil silly, since it's just removing what it just added, didn't know how else to get (C) on to end.