mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2022
Posts: 136
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 136
I'm trying to understand how to properly set (and write) a kick/BAN focusing on mask using IF / ELSEIF
This is a mask sample ---> pippo is paperino!pluto@123.456.789.100

pippo = nick
paperino = real_name
pluto = ident
123.456.789.100 = host

For example this on join:

Code
ON *:JOIN:#CHANNEL: {
  if ($address == 123.456.789.100) {
 ban # *!*@123.456.789.100
    kick # $nick SAY SOMETHING ON HOST MATCH
 }
}

In this case kick/ban takes HOST (123.456.789.100). Right?
What if I wish to add an option also for REAL NAME or IDENT?

Code
ON *:JOIN:#CHANNEL: {
  if ($address == *!*@123.456.789.100) {
 ban # *!*@123.456.789.100
    kick # $nick SAY SOMETHING IF HOST MATCH
 }
elseif ($????? == *!*pluto@*{
  ban # ?????
    kick # $nick SAY SOMETHING IF IDENT MATCH
}

elseif ($????? == paperino!*@*) {
  ban # ?????
    kick # $nick SAY SOMETHING IF REAL_NAME MATCH
}
elseif ($nick == pippo) {
  ban # $nick
    kick # $nick SAY SOMETHING IF NICK MATCH
}

Any help will be appreciated

Joined: May 2022
Posts: 136
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 136
First part is to manually add a nick or a ident or a host in a myblacklist.txt file that will be checked on user join:

Code
menu nicklist {
  •BLACKLIST•
  .ADD(NICK):/write myblacklist.txt $1-------->It'll add paperino!*@*
  .ADD(HOST):/write myblacklist.txt $address($1,2)-----------> It'll add *!*@123.456.789.100
  .ADD(IDENT):/write myblacklist.txt $+(*!*,$right($ial($1,1).user,6),@*)---> It'll add *!*pluto@*
}

This is the addon:

Code
on *:JOIN:#CHANNEL:{
 if ($read(myblacklist.txt) iswm $address($nick,5)) { 
    kick $chan $nick YOU'RE IN BLACKLIST !!!
  }
}

======================

Only nick is kicked, it doesn't kick HOST or IDENT.
Why?
Thanks

Last edited by Fernet; 13/08/25 04:22 PM.
Joined: Nov 2021
Posts: 160
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 160
try this :

Code

ON *:join:#channel:{ 
  var %badmatch 1 
  while (%badmatch <= $lines(myblacklist.txt)) {
    if ($read(myblacklist.txt, %badmatch) iswm $address($nick,5) ) { 
      putmode -t0 $chan +b $v1 
      kick $chan $nick YOU'RE IN BLACKLIST !!!
    } 
    inc %badmatch
  } 
}




Joined: May 2022
Posts: 136
F
Fernet Offline OP
Vogon poet
OP Offline
Vogon poet
F
Joined: May 2022
Posts: 136
Thanks Simo. I'll test t as soon as I can. My main pc is on manteinance now :-P


Link Copied to Clipboard