Advertisement
westor

Snotices Clones Advert for LoLa_BuNNy v1.4

Mar 26th, 2020
1,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.32 KB | None | 0 0
  1. ON *:CONNECT: {
  2.   if (!$hget(CLONES)) { hmake CLONES 1000 }
  3. }
  4.  
  5. ON *:DISCONNECT: {
  6.   if ($hget(CLONES)) { hfree $v1 }
  7. }
  8.  
  9. ON ^*:SNOTICE:*Client connecting*: {
  10.   haltdef
  11.  
  12.   if (!$hget(CLONES)) { hmake CLONES 1000 }
  13.  
  14.   var %nick = $4
  15.   var %ip = $remove($6,[,])
  16.  
  17.   if (!%nick) && (!%ip) { return }
  18.  
  19.   if ($check_clones(%ip)) {
  20.     var %nicks = $v1
  21.     var %total = $numtok(%nicks,32)
  22.  
  23.     echo 4 -s Nickname %nick has %total clones already connected from the same ip %ip address! - Nicknames: %nicks
  24.   }
  25.  
  26.   hadd CLONES %nick %ip
  27. }
  28.  
  29. ON ^*:SNOTICE:*Client exiting*: {
  30.   haltdef
  31.  
  32.   var %nick = $4
  33.  
  34.   if (!%nick) { return }
  35.  
  36.   if ($hget(CLONES,%nick)) { hdel CLONES %nick }
  37. }
  38.  
  39. ON ^*:SNOTICE:*has changed their nickname*: {
  40.   haltdef
  41.  
  42.   var %old_nick = $2
  43.   var %new_nick = $9
  44.  
  45.   if (!%old_nick) && (!%new_nick) { return }
  46.  
  47.   var %ip = $hget(CLONES,%old_nick)
  48.  
  49.   if (!%ip) { return }
  50.  
  51.   hdel CLONES %old_nick
  52.   hadd CLONES %new_nick %ip
  53. }
  54.  
  55.  
  56. alias check_clones {
  57.   ; $check_clones(ip)
  58.  
  59.   if (!$1) || (!$hget(CLONES)) { return 0 }
  60.  
  61.   var %t = $hfind(CLONES,* $+ $1 $+ *,0,w).data
  62.  
  63.   if (!%t) { return 0 }
  64.  
  65.   var %i = 1
  66.   while (%i <= %t) {
  67.     var %n = $hfind(CLONES,* $+ $1 $+ *,%i,w).data
  68.  
  69.     if (%n) { var %total = $addtok(%total,%n,32) }
  70.  
  71.     inc %i
  72.   }
  73.  
  74.   return $iif(%total,$v1,0)
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement