Originally Posted by Mairel
That is, the nickname that gets banned isn't the one of the account they're logged into, but the nickname they're currently using. For example: if I'm logged in with the nickname TheKing, but I'm using the nickname BestGuest, those commands result in a ban on BestGuest, while the ban should actually be on TheKing.
Ok, I made additional changes to the code to fix the problem you described.

You can test this code:
Code
menu nicklist {
  -
  $style(1) ADMIN
  .Ban $chr(9) *!*@host : ban $chan $$1 2
  .Ban $chr(9) $+(R,$chr(58),<account>) : bacc $chan $$1
  .-
  .Ban [Combo] : set %bcombo $true | bacc $chan $$1
  -
}

on @*:INPUT:#:{
  if (/* !iswm $1) {
    if (!b == $1) { ban $chan $2 2 }
    if (!kb == $1) { ban -k $chan $2 2 You are not welcome here! }
    if (!br == $1) { bacc $chan $2 }
    if (!kbr == $1) { bacc $chan $2 | kick $chan $2 You are not welcome here! }
    halt
  }
}

on @*:TEXT:*add me on*:#Mairel: ban $chan $nick 2 | bacc $chan $nick


alias -l bacc { .enable #islogged | set %bchan $1 | whois $2 }
alias -l setmode { $iif(%bcombo,mode %bchan +bb $address($1,2) $+(R:,$2),mode %bchan +b $+(R:,$2)) | unset %bchan %bcombo }

#islogged off
raw *:*is logged*: setmode $2 $3 | .disable #islogged
#islogged end

Note: If you are going to split this code up for use in different scripts, remove the switch "-l" in the aliases, to make them global and publicly for visibility in all scripts: alias -l


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples