mIRC Homepage
Posted By: YoSiTo Automatic voice with exceptions - 04/03/24 10:01 PM
Hello everyone, I wanted to know if there is a remote that can give voice to users who enter with the exception of those users who are already in specific rooms, do not give them voice, but if they are not in said rooms, give them voice in our room, thank you.
Posted By: Epic Re: Automatic voice with exceptions - 05/03/24 08:25 PM
I created this little script for you that should do what you're request.

Try using this script code in your bot:
Code
alias -l my_channel { return #channel }
on @*:JOIN:$($my_channel): .enable #checkbadchannels | whois $nick

#checkbadchannels off
raw 319:*: if ($check_chans($2-)) { mode $my_channel +v $2 } | .disable #checkbadchannels
alias -l bad_chans { return #badboys,#reptiles,#trolling }
alias -l check_chans {
  tokenize 32 $1- | var %userchans $remove($2-,!,~,&,@,$chr(37),+)
  var %i 1 | while (%i <= $numtok($bad_chans,44)) { 
    if ($istok(%userchans,$gettok($bad_chans,%i,44),32)) { return $false } | inc %i
  }
  return $true
}
#checkbadchannels end


Description:

  • The bot will check "WHOIS" each user joining a channel to see what other channels they are on.
  • The bot must have channel operator status with the @ sign to be able to set a voice.
  • In the alias "my_channel" indicate the name of your #channel on which the bot will work.
  • In the alias "bad_chans" specify the names of bad channels, separated by commas, on which the user should not be present.
Posted By: YoSiTo Re: Automatic voice with exceptions - 06/03/24 08:38 PM
Thank you very much Epic is very helpful to me, I really appreciate the time you took to help
© mIRC Discussion Forums