Top

Powertrip


mIRC Code
+ 3 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.8 (of 6 scores)
Date Added  Jul 13, 2009
Last Updated  Nov 10, 2009
Tags  brag  op  ops  power  powertrip  pwn  show  trip 

Description

Just a simple little thinggy to show...:

amount of networks you are on,
amount of channels you are on,
total usermodes (~&!@%+) if any,
amount of users you have control over.

Code:
<~Knoeki> I'm on 48 channels, spread across 6 networks. Powers: 4 ~, 4 &, 1 @, 2 %, 13 +. I'm more important than 432/2110 (20.47%) lamers.


can probably be done a lot better, but that's for another time.

I've updated it a little bit, it shows a percentage too now, and fixed a bug so that it'll actually show a '0' when you do not have a certain mode anywhere.

Grab the Code

alias powertrip {
  var %pt.net.count 1
  var %pt.net.total $scon(0)
  var %pt.chan.count 1
  while (%pt.net.count <= %pt.net.total) {
    scid $scon(%pt.net.count)
    var %tmp.chan.count 1
    var %tmp.chan.total $comchan($me, 0)
    while (%tmp.chan.count <= %tmp.chan.total) {
      inc %pt.mode.count. [ $+ [ $modenum2($comchan($me, %tmp.chan.count), $me) ] ]
      var %tmp.nick.total $nick($comchan($me, %tmp.chan.count), 0)
      var %tmp.nick.chan $comchan($me, %tmp.chan.count)
      var %tmp.nick.count 1
      while (%tmp.nick.count <= %tmp.nick.total) {
        if ($modenum2(%tmp.nick.chan, $me) > $modenum2(%tmp.nick.chan, %tmp.nick.count)) {
          inc %pt.pwn.count
        }
        inc %pt.total.nicks
        inc %tmp.nick.count
      }
      inc %tmp.chan.count
    }
    var %pt.chan.total $calc(%pt.chan.total + %tmp.chan.count)
    inc %pt.net.count
  }
  var %x 1
  while (%x <= 6) {
    if (%pt.mode.count. [ $+ [ %x ] ] == $null) {
      var %pt.mode.count. [ $+ [ %x ] ] 0
    }
    inc %x
  }
  scid -r
  say I'm on $+(,%pt.chan.total,) channels, spread across $+(,$calc(%pt.net.count - 1),) networks. Powers: $+(,%pt.mode.count.6,) ~, $+(,%pt.mode.count.5,) &, $+(,%pt.mode.count.4,) @, $+(,%pt.mode.count.3,) $+($(%),$chr(44)) $+(,%pt.mode.count.2,) +. I'm more important than $+(,%pt.pwn.count,/,%pt.total.nicks,) $+($chr(40),,$round($calc((%pt.pwn.count / %pt.total.nicks) * 100), 2),,$(%),$chr(41)) lamers.
  unset %pt.*
  unset %tmp.*
}
 
alias -l modenum2 {
  return $iif($left($nick($1, $2).pnick, 1) isin $prefix, $replacex($left($nick($1, $2).pnick, 1), ~, 6, !, 5, &, 5, @, 4, %, 3, +, 2), 1)
}
 

Comments

  (10)  RSS
Jamiie
Comments: 167
 
mIRC Snippet:  Powertrip
Posted on Jul 14, 2009 12:03 am
Nice, works like said in description.
gooshie
Comments: 181
 
mIRC Snippet:  Powertrip
Posted on Aug 10, 2009 11:14 pm
Knoeki,
The main reason the channel count is gonna be off
is the use of the $comchan indentifier.

Total user count is gonna be off sometimes because
it will count users more than once if they are in
more than one of your channels and at the very least
could be counted easier with the $ial identifier.

All of this can be accomplished without the need for
/set and /unset %varibles to eliminate harddrive writes.

btw: $network and $server are not the same thing.
$network may have more than one $server and some
$network may allow more than one connection.
also (unfortunately) $network and $server DO NOT
have to be unique names on the planet.
The DOMAIN name MUST be unique and so must $serverip
BUT unfortunately $network and $server are sent out
by the server in the raw 001-005 lines during connect and
can be anything they set it to. This is sorta off topic
but this means if you ever write like an auto-ident to
NickServ/ChanServ maybe better to use $serverip for security.

review my snippet at: http://www.hawkee.com/snippet/6559/
knoeki
Comments: 142
 
mIRC Snippet:  Powertrip
Posted on Aug 12, 2009 10:23 am
Gooshie:

I have not put much effort in this, obviously ;_) I might make a better version at some point, but thanks for the feedback, which I'll address now:

The reason I've used /unset at the end, is not because I've used /set anywhere (just look!), but more because for some reason, some stray variables got left behind.

I don't get your whole point about about $network and $server, when have I ever claimed that these are the same? Also, how is it even relevant to this script at all?

Yours seems nice, but doesn't keep track of modes other than +o and +v, which is a shame imho, but might be chosen because you do not find it neccisary.

thanks for the feedback, much appreciated :_)
PATX
Comments: 387
 
mIRC Snippet:  Powertrip
Posted on Aug 12, 2009 11:39 am
gooshie
Comments: 181
 
mIRC Snippet:  Powertrip
Posted on Aug 12, 2009 11:07 pm
Knoeki,
%pt.total.nicks and %pt.mode.count.1-6 did not get
declared as local variables with the var command.
A call to a variable that is not set or declared
is set as a global variable by mIRC. The first time
that an undeclared variable is incrimented mIRC will
set it to 1 (one) thus the following three lines
give the same results.
inc %tmp.nick.count
set %tmp.nick.count 1
%tmp.nick.count = 1

<Knoeki> "...how is it even relevant to this script at all?"
output => spread across $+(,$calc(%pt.net.count - 1),) networks
this counts servers => var %pt.net.total $scon(0)
many chat visitors wont know the difference between servers and
networks so i guess its ok to use either term in this type script.
The only people that need to understand the difference between
$server and $network is those who script the client and are
concerned with multiserver issues.

Even when taking into account that this snippet counts
disconnected servers and unjoined channels there is still
a few count errors.
MaSOuD
Comments: 32
 
mIRC Snippet:  Powertrip
Posted on Aug 13, 2009 7:50 am
Good work But, yes it can be better by some changes/fixes. 7/10
HeatedHeart
Comments: 52
 
mIRC Snippet:  Powertrip
Posted on Aug 13, 2009 1:47 pm
btw knoeki gave you a 7/10 nice work.
knoeki
Comments: 142
 
mIRC Snippet:  Powertrip
Posted on Aug 14, 2009 10:14 am
I've deleted all the rage comments.
knoeki
Comments: 142
 
mIRC Snippet:  Powertrip
Posted on Nov 10, 2009 3:11 am
Updated it a bit, read description.
DrtyDawg
Comments: 2
 
mIRC Snippet:  Powertrip
Posted on Nov 10, 2009 3:13 am
Nice work again mate, handy and fun :D

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom