/opstat

By horstefan on Oct 31, 2009

just put in remotes and do /opstat (its dutch)

alias opstat {
  set %stat.user 0
  set %stat.reg 0
  set %stat.voice 0
  set %stat.hop 0
  set %stat.op 0
  set %stat.prot 0
  set %stat.owner 0
  set %stat.user2 0
  set %stat.status reg

  set %stat.count2 1
  while (%stat.count2 <= $chan(0)) {

    set %stat.count3 1

    if (%stat.status == hop) { set %stat.user2 $calc(%stat.user2 + %stat.temp.reg + %stat.temp.voice) }
    if (%stat.status == op) { set %stat.user2 $calc(%stat.user2 + %stat.temp.reg + %stat.temp.voice + %stat.temp.hop + %stat.temp.op) }
    if (%stat.status == prot) { set %stat.user2 $calc(%stat.user2 + $nick(%stat.chan,0) - %stat.temp.owner) }
    if (%stat.status == owner) { set %stat.user2 $calc(%stat.user2 + $nick(%stat.chan,0)) }

    set %stat.chan $chan(%stat.count2)

    set %stat.temp.reg 0
    set %stat.temp.voice 0
    set %stat.temp.hop 0
    set %stat.temp.op 0
    set %stat.temp.prot 0
    set %stat.temp.owner 0

    set %stat.user $calc(%stat.user + $nick(%stat.chan,0))    
    while (%stat.count3 <= $nick(%stat.chan,0)) {
      set %stat.pnick $nick(%stat.chan,%stat.count3).pnick
      set %stat.nick $nick(%stat.chan,%stat.count3)

      if (%stat.nick == %stat.pnick) { inc %stat.temp.reg }
      if ($left(%stat.pnick,1) == +) { inc %stat.temp.voice }
      if ($left(%stat.pnick,1) == %) { inc %stat.temp.hop }
      if ($left(%stat.pnick,1) == @) { inc %stat.temp.op }
      if ($left(%stat.pnick,1) isin &!) { inc %stat.temp.prot }
      if ($left(%stat.pnick,1) isin *~) { inc %stat.temp.owner }

      if (%stat.nick == $me) && (%stat.nick == %stat.pnick) { inc %stat.reg | set %stat.status reg }
      if (%stat.nick == $me) && ($left(%stat.pnick,1) == +) { inc %stat.voice | set %stat.status voice }
      if (%stat.nick == $me) && ($left(%stat.pnick,1) == %) { inc %stat.hop | set %stat.status hop }
      if (%stat.nick == $me) && ($left(%stat.pnick,1) == @) { inc %stat.op | set %stat.status op }
      if (%stat.nick == $me) && ($left(%stat.pnick,1) isin &!) { inc %stat.prot | set %stat.status prot }
      if (%stat.nick == $me) && ($left(%stat.pnick,1) isin *~) { inc %stat.owner | set %stat.status owner }

      inc %stat.count3
    }
    inc %stat.count2
  }
  var %stat.server $scon(0)
  if (%stat.status == hop) { set %stat.user2 $calc(%stat.user2 + %stat.temp.reg + %stat.temp.voice) }
  if (%stat.status == op) { set %stat.user2 $calc(%stat.user2 + %stat.temp.reg + %stat.temp.voice + %stat.temp.hop + %stat.temp.op) }
  if (%stat.status == prot) { set %stat.user2 $calc(%stat.user2 + $nick(%stat.chan,0) - %stat.temp.owner) }
  if (%stat.status == owner) { set %stat.user2 $calc(%stat.user2 + $nick(%stat.chan,0)) }

  var %totalchans $calc((%stat.owner)+(%stat.prot)+(%stat.op)+(%stat.hop)+(%stat.voice)+(%stat.reg))

  say 7stats voor: 14 $+ $me 14,01
  say 7Eigenaar 14( $+ %stat.owner $+ ) 7Beschermd 14( $+ %stat.prot $+ ) 7Op 14( $+ %stat.op $+ ) 7HalfOp 14( $+ %stat.hop $+ ) 7Voice 14( $+ %stat.voice $+ ) 7Normaal 14( $+  %stat.reg $+ )
  say 7Totale channels: 14( $+ %totalchans $+ ) 7totale gebruikers: 14( $+ %stat.user $+ ) 07Servers: 14( $+ %stat.server $+ ) 7Macht over: 14( $+ %stat.user2 $+ ) 7gebruikers  14( $+ $calc(%stat.user2 / %stat.user * 100) $+ % $+ )
}
Sign in to comment.
Atr   -  Nov 02, 2009

Would be nice if you set local variables instead of global variables.. in fact, I don't think you need to declare all those variables at the beginning as 0 at all..

 Respond  
Grant-   -  Oct 31, 2009

Could be smaller but good job, no idea what launguage it is tho. If you'd actually read the description, you'd know it's dutch

 Respond  
Ghost-writer   -  Oct 31, 2009

Could be smaller but good job, no idea what launguage it is tho.

 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.