|
@@ -1507,7 +1507,7 @@ static void cmd_chsecpass(struct userrec *u, int idx, char *par)
|
|
|
static void cmd_botcmd(struct userrec *u, int idx, char *par)
|
|
static void cmd_botcmd(struct userrec *u, int idx, char *par)
|
|
|
{
|
|
{
|
|
|
tand_t *tbot = NULL;
|
|
tand_t *tbot = NULL;
|
|
|
- int cnt = 0, rleaf = (-1), tbots = 0;
|
|
|
|
|
|
|
+ int cnt = 0, rleaf = (-1), tbots = 0, found = 0;
|
|
|
char *botm = NULL, *cmd = NULL;
|
|
char *botm = NULL, *cmd = NULL;
|
|
|
|
|
|
|
|
botm = newsplit(&par);
|
|
botm = newsplit(&par);
|
|
@@ -1537,21 +1537,20 @@ static void cmd_botcmd(struct userrec *u, int idx, char *par)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (tbot = tandbot; tbot; tbot = tbot->next) {
|
|
for (tbot = tandbot; tbot; tbot = tbot->next) {
|
|
|
- if (wild_match(botm, tbot->bot))
|
|
|
|
|
- cnt++;
|
|
|
|
|
-
|
|
|
|
|
if (!strcmp(botm, "?") && bot_hublevel(get_user_by_handle(userlist, tbot->bot)) != 999)
|
|
if (!strcmp(botm, "?") && bot_hublevel(get_user_by_handle(userlist, tbot->bot)) != 999)
|
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
if ((rleaf != (-1) && (cnt - 1) == rleaf) || ((rleaf == (-1) && wild_match(botm, tbot->bot)))) {
|
|
if ((rleaf != (-1) && (cnt - 1) == rleaf) || ((rleaf == (-1) && wild_match(botm, tbot->bot)))) {
|
|
|
send_remote_simul(idx, tbot->bot, cmd, par ? par : "");
|
|
send_remote_simul(idx, tbot->bot, cmd, par ? par : "");
|
|
|
|
|
+ found++;
|
|
|
}
|
|
}
|
|
|
|
|
+ cnt++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!cnt) {
|
|
|
|
|
|
|
+ if (!found)
|
|
|
dprintf(idx, STR("No bot matching '%s' linked\n"), botm);
|
|
dprintf(idx, STR("No bot matching '%s' linked\n"), botm);
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void cmd_hublevel(struct userrec *u, int idx, char *par)
|
|
static void cmd_hublevel(struct userrec *u, int idx, char *par)
|