RusselB you're right, though I think the user doesn't want to autojoin a channel but a new game, if it's announced in the channels topic

1) The topic event to !join the first game, setting a variable that has to be reset manually (see the other code below)
Replace "BOTNICK1" with the nick of the triviabot of channel #trivia. Replace "BOTNICK2" with the nick of the triviabot of channel #trivia1.
on *:topic:*: {
if ($istok($strip($1-),!join,32)) && (%trivia.running != on) {
if (($chan == #trivia) && ($nick == BOTNICK1)) || (($chan == #trivia1) && ($nick == BOTNICK2)) {
set %trivia.running on
msg $chan !join
echo -ac info * You're auto-joining the trivia game on channel $chan
}
}
}
2) Of these two parts, I don't know which one you need.
A command YOU can use to reset the "I already joined a trivia game" status:
/resettriviaalias resettrivia {
if (%trivia.running == on) {
unset %trivia.running
echo -ac info * Trivia Status reset - Ready to auto-join the next trivia game.
}
else {
echo -ac info * Trivia Status doesn't need a reset - Ready to auto-join the next trivia game.
}
}
A trigger OTHERS can use to reset your trivia game status:
!resettriviaReplace "#YOURCHANNEL" with the name of your channel, or multiple channel names (separated by comma), or "#" for all channels.
on *:text:!resettrivia:#YOURCHANNEL: {
if (%trivia.resetflood != on) {
set -eu5 %trivia.resetflood on
if (%trivia.running == on) {
unset %trivia.running
notice $nick Trivia Status reset - Ready to auto-join the next trivia game.
}
else {
notice $nick Trivia Status doesn't need a reset - Ready to auto-join the next trivia game.
}
}
}