Originally Posted by Fernet
If i wish to lock IDENT or HOST , is enough to change $1 with $address ?
No, just one replacement will not be enough. Everything is not as simple as it seems.

I reworked the previous code and then optimized it. I had to tinker with this for a while due to additional experimentation with several different code constructions and with testing.

Try use this update:
Code
menu nicklist {
  •NOTICELOCKER•
  .LOCK $chr(9) $1
  ..NICK $chr(8199) $mnick($1) : lock $1 $mnick($1)
  ..USER $chr(8199) $muser($1) : lock $1 $muser($1)
  ..HOST $chr(8199) $mhost($1) : lock $1 $mhost($1)
  .UNLOCK $chr(9) $1
  ..NICK $chr(8199) $mnick($1) : unlock $1 $mnick($1)
  ..USER $chr(8199) $muser($1) : unlock $1 $muser($1)
  ..HOST $chr(8199) $mhost($1) : unlock $1 $mhost($1)
  .-
  .LIST: ignore -ln
}

on *:PARSELINE:in:* NOTICE *:{
  var %addr $matchtok($gettok($parseline,1,58),@,1,32), %nick $gettok(%addr,1,33)
  if ($readfile($mnick(%nick))) || ($readfile($muser(%nick))) || ($readfile($mhost(%nick))) {
    var %v1 $v1 | if (!$ignore(%v1)) .ignore -n %v1
    if (!$hget(inot,%nick)) { .notice %nick NOTICE NOT ALLOWED !!! | .hadd -m inot %nick 1 }
  }
  else { .ignore -rn $mnick(%nick) | .ignore -rn $muser(%nick) | .ignore -rn $mhost(%nick) | .hdel -w inot %nick }
}

alias -l pathfile { return addons/noticeblocked.txt }
alias -l readfile { if ($read($pathfile,ntw,$1)) { return $v1 } }

alias -l mnick { return $+($ial($1).nick,!*@*) }
alias -l muser { return $+(*!,$ial($1).user,@*) }
alias -l mhost { return $+(*!*@,$ial($1).host) }

alias -l lock { if (!$readfile($2)) { write -i $pathfile $2 | .ignore -n $2 | echo 4 LOCK: $1 - $2 } }
alias -l unlock { if ($readfile($2)) { write $+(-dl,$readn) $pathfile | .ignore -rn $2 | if (!$ignore($address($1,5))) .hdel -w inot $1 | echo 3 UNLOCK: $1 - $2 } }


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