Clonescanner

By juhapuha on May 11, 2008

Well. This snippet will scan active channel for clones. It is not pretty, or fast but i think it works? Tbh i had little problems with this so the code does not look very pretty.
Try it.

Works: /clonescan
OR rightclick -> clonescanner by shitbreak

menu channel {
  ...Clonescanner by shitbreak:/clonescan 
}
alias clonescan {
  set %ck $chan
  window -a @Clonescan
  if ($chan($chan).ial != $true) { echo @Clonescan IAL (Internal address list) for channel $chan is not updated. Do /who $chan to update it. | halt }
  var %i = $nick($chan,0)
  while (%i) {
    if ($ialchan($address($nick($chan,%i),2),$chan,0) > 1) {
      var %x = $ialchan($address($nick($chan,%i),2),$chan,0)
      while (%x) {
        writeini clonescan.ini $address($nick($chan,%i),2) $ialchan($address($nick($chan,%i),2),$chan,%x).nick $ialchan($address($nick($chan,%i),2),$chan,%x)
        dec %x
      }
    }
    dec %i
  }
  if ($ini(clonescan.ini,0) == 0) { echo @Clonescan Channel $chan Scanned: No clones found. }
  if ($ini(clonescan.ini,0) > 0) {
    echo @Clonescan  $+ Clonegroups on channel $chan $+ : $ini(clonescan.ini,0) $+ 
    echo @Clonescan -
    var %o = 1
    while (%o <= $ini(clonescan.ini,0)) {
      echo @Clonescan Clone group ( $+ %o $+ ) $+ : 4( $+ $ini(clonescan.ini,%o) $+ 4)
      echo @Clonescan -
      var %z = $ini(clonescan.ini,%o,0))
      while (%z) {
        inc %clones
        echo @Clonescan $ini(clonescan.ini,%o,%z) 4( $+ $readini(clonescan.ini,$ini(clonescan.ini,%o),$ini(clonescan.ini,%o,%z)) $+ 4)         
        dec %z
      }
      inc %o
    }
    echo @Clonescan Results:
    echo @Clonescan -
    echo @Clonescan Total clones found: %clones
    echo @Clonescan Total clonegroups found: $ini(clonescan.ini,0)
    echo @Clonescan Total users on channel: $nick(%ck,0)
    echo @Clonescan Percent of clones: $calc($calc(%clones / $nick(%ck,0)) * 100) $+ %
    unset %clones
    write -c clonescan.ini
  }
}

Comments

Sign in to comment.
juhapuha   -  May 11, 2008

comments please....

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.