... whois query is triggered each time ...
Yes, the script every time uses the command
whois $2
to get the required string, for example "
BestGuest is logged in as TheKing", so this request will be made constantly.
How do you get rid of that whois ... ?
Can try to hide the display of all lines received in the "
Whois" response about the requested nick by using the command
haltdef
inside the handler
raw
.
I think it should be fixed so that if the nickname is registered, both the type 2 and account bans are triggered, while if it's not registered, only the type 2 ban is triggered, or at most, a type 2 ban and the ability to add others as needed.
Ok, for this I will add two aliases "
ban_reg_user" and "
ban_noreg_user" to set a ban if the nick is registered or when it is not registered respectively, depending on what data will be received from the "
Whois" response, and with the ability to add additional commands with the required types of bans.
〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰Replace the previous code snippet (badwords) with the "
ON TEXT" event handler with this one and check:
on @*:TEXT:*just ban me already*:#Mairel: ban $chan $nick 2
on @*:TEXT:*guess my registration*:#Mairel: bacc $chan $nick
on @*:TEXT:*i want to get combo*:#Mairel: set %bcombo $true | bacc $chan $nick
alias bacc { .enable #islogged | set %bchan $1 | whois $2 }
alias -l ban_reg_user {
if (%bcombo) { mode %bchan +bbb $address($1,2) $address($1,3) $+(R:,$2) }
else { mode %bchan +bb $address($1,2) $+(R:,$2)) }
unset %bchan %bcombo
}
alias -l ban_noreg_user {
if (%bcombo) { mode %bchan +bb $address($1,2) $address($1,3) }
else { ban %bchan $1 2 }
unset %bchan %bcombo
}
#islogged off
raw *:*:{
if ($numeric isnum 307-320) || ($numeric isnum 615-617) { haltdef }
if ($istok(301 330 335 338 378 379 671,$numeric,32)) { haltdef }
if (*is logged* iswm $2-) { set %islogged $3 | haltdef }
if ($numeric == 318) {
$iif(%islogged,ban_reg_user $2 $v1,ban_noreg_user $2)
unset %islogged | .disable #islogged
}
}
#islogged end