Oper Command counter.

By SnoooP on Aug 24, 2010

Cheiron asked me for this so I thought I would upload it here aswell.

This is for anope/inspircd networks. Snomasks must be enabled

Type /opower and it gives you some statistical infomation into how many glines kills shuns etc you have performed, and some channel commands to.

**Updates, thanks to Aucun

on *:SNOTICE:*k-line*: { 
  if ($me isin $1- && added isin $1-) { inc %kline 1 }
  if ($me isin $1- && removed isin $1-) { inc %rkline 1 }
}
on *:SNOTICE:*z-line*: { 
  if ($me isin $1- && added isin $1-) { inc %zline 1 }
  if ($me isin $1- && removed isin $1-) { inc %rzline 1 }
}
on *:SNOTICE:*g-line*: { 
  if ($me isin $1- && added isin $1-) { inc %gline 1 }
  if ($me isin $1- && removed isin $1-) { inc %rgline 1 }
}
on *:SNOTICE:*shun*: { 
  if ($me isin $1- && added isin $1-) { inc %shun 1 }
  if ($me isin $1- && removed isin $1-) { inc %rshun 1 }
}
on *:SNOTICE:*kill*: {
  if (local isin $1- || remote isin $1-) {
    if ($me isin $1-) { inc %kill }
  } 
}
on *:SNOTICE:*used sa*: {
  if ($me isin $1-) { inc %sa }
}
on *:SNOTICE:*used global*: {
  if ($me isin $1-) { inc %global }
}

on *:kick:#:if ($nick == $me) inc %kick
on *:ban:#:if ($nick == $me) inc %bans
on *:op:#:if ($nick == $me) inc %op
on *:help:#:if ($nick == $me) inc %halfop
on *:voice:#:if ($nick == $me) inc %voice
on *:owner:#:if ($nick == $me) inc %founder

alias opower { 
  var %net $scon(0), %oper 0
  while (%net) {
    scon %net
    if (o isincs $usermode) { inc %oper }
    dec %net
  }
  scon -r
  say 4I am on14 $scon(0) 4networks 4I'm an oper on14 %oper 4networks. I haved killed14 $iif(%kill,%kill,0) 4users and used the /sa commands14 $iif(%sa,%sa,0) 4times. I have also sent14 $iif(%global,%global,0) 4global messages.  4I have also kicked14  $iif(%kick,%kick,0) 4users.
  say 4I haved added:14 $iif(%kline,%kline,0) 4klines.14  $iif(%shun,%shun,0) 4shuns.14  $iif(%gline,%gline,0) 4glines.14 $iif(%zline,%zline,0) 4zlines
  say 4I have removed:14 $iif(%rkline,%rkline,0) 4klines.14 $iif(%rshun,%rshun,0) 4shuns.14  $iif(%rgline,%rgline,0) 4glines.14  $iif(%rzline,%rzline,0) 4zlines. 
  say 4I have given:14 $iif(%voice,%voice,0) 4voices. 14 $iif(%halfop,%halfop,0) 4halfops.14 $iif(%op,%op,0) 4ops and14 $iif(%founder,%founder,0) 4founders.
}   

Comments

Sign in to comment.
Gummo   -  Aug 26, 2010

Am I the only one who sees that if ($me && added isin $1-) will always trigger when added isin $1-?
This is a programming language, not English.
EDIT: Cheiron also found the problem but through experience.
On an unrelated note, since you don't check for anything but the type of command being present in the text it will also match if your nick and "added" appear in user's address or in the reason.

 Respond  
Aucun50   -  Aug 25, 2010
say I am on $scon(0) networks. I'm an oper on $iif(%oper,%oper,0) networks. I have added $iif(%kline,%kline,0) klines and removed $iif(%rkline,%rkline,0) $+ , I have added %shun shuns and removed $iif(%rshun,%rshun,0) $+ , I have added $iif(%gline,%gline,0) glines and removed $iif(%rgline,%rgline,0) $+ , I have added $iif(%zline,%zline,0) zlines and removed $iif(%rzline,%rzline,0) $+ . I have akilled $iif(%akill,%akill,0) users and removed $iif(%rakill,%rakill,0) akills. I haved  killed $iif(%kill,%kill,0) users and used the /sa commands %sa times. I have also sent $iif(%global,%global,0) global messages.  
  say I also have kicked $iif(%kick,%kick,0) users, and gave $iif(%voice,%voice,0) voices $iif(%halfop,%halfop,0) halfops $iif(%op,%op,0) ops and $iif(%founder,%founder,0) founders.
}
 Respond  
SimplicityX   -  Aug 25, 2010

(3:59:25 pm): <&Simplicity> I am on 2 networks. I'm an oper on 1 networks. I have added klines and removed , I have added shuns and removed , I have added glines and removed , I have added zlines and removed . I have akilled users and removed akills. I haved killed users and used the /sa commands times. I have also sent global messages.
(3:59:25 pm): <&Simplicity> I also have kicked users, and gave voices halfops ops and founders.

You should add something to make sure the variables are set and if they aren't make it say "0". :p

 Respond  
SnoooP   -  Aug 25, 2010

As I said this was just something I done quickly for Cheiron, i'm away for the weekend so when I get back I will make something that works properly, but till then see ya guys o/

 Respond  
Cheiron   -  Aug 25, 2010

endured a 300+ botnet session the other day on one of my nets.. that was fun.. just for interest i did a /opower and guess what . it returned all the klines issued by bopm as if i had added them

 Respond  
Jethro   -  Aug 24, 2010

Why do you use so many snotice events when one will do?

I believe you should use $knick, $banmask or $bnick, $hnick, $vnick and $nick(#,$me,q)
for the relevant events. $nick refer to the one who gives your a kick, ban, op status...etc..

 Respond  
SnoooP   -  Aug 24, 2010

Obvious additions could be /chg commands and more anope commands but i'll do that all another time, also a reset function wiill be added one day

 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.