Power script

By Bielie on Dec 16, 2010

This is a snippet i made that shows all the information of your own nickname and if you have more then one connection of those too!

commands are:

/power

This will echo it.

alias power {
  var %a = 1,%nets = 0,%ops = 0,%halfops = 0,%voiced = 0,%normal = 0,%control = 0,%total = 0,%totalchans = 0
  while ($scon(0) >= %a) {
    scon %a
    if ($status == connected) {
      inc %nets
      var %chans $comchan($me,0)
      inc %totalchans %chans
      var %b = 1
      while (%chans >= %b) {
        if ($me isreg $comchan($me,%b)) inc %normal
        elseif ($me isop $comchan($me,%b)) inc %ops
        elseif ($me ishop $comchan($me,%b)) inc %halfops
        elseif ($me isvoice $comchan($me,%b)) inc %voiced
        var %c = 1
        ;nicks in each channel
        while (%c <= $nick($comchan($me,%b),%c)) {
          inc %total
          var %curchan = $comchan($me,%b)
          if ($me isreg %curchan) { inc %total $nick($comchan($me,%b),0) | break }
          elseif ($nick(%curchan,%c) ishop %curchan) {
            if ($!me isop %curchan) inc %control
          }
          elseif ($nick(%curchan,%c,vor)) && ($nick(%curchan,$me,oh)) inc %control 
           }
          inc %c
        }
        inc %b
      }
    }
    inc %a
  }
  scon -r
  var %msg = I am currently in $p.c(%totalchans) channels across $p.c(%nets) networks. I am OPed in $p.c(%ops) channels, halfoped in $p.c(%halfops) channels, $&
    voiced in $p.c(%voiced) channels, and a regular user in $p.c(%normal) channels. I control $p.c($+(%control,/,%total)) $+ , or $p.c($round($calc(%control / %total *100),2) $+ %) of users.
  msg $active $iif(c !isincs $chan($active).mode,%msg,$strip(%msg))
}
alias -l p.c return $+(,$1-,)

Comments

Sign in to comment.
Emo_Pikachu   -  Feb 06, 2012

idk how he did but i loaded it and it didnt do anything to myne

 Respond  
blackvenomm666   -  Feb 05, 2012

did you mis copy a bracket? cause that'll def crash shit haha

 Respond  
HacknSlash   -  Feb 05, 2012

Hmmm. This crashed my mIRC.

 Respond  
Rider91   -  Apr 15, 2011

its possible but i highly doubt it, it worked fine before, then i had to re-install and have the sme things as before if not less , its confuzing

 Respond  
Sharky_Dude   -  Apr 14, 2011

Okay so I just tried this on v. 6.35 and it froze me up. I personally think it's not the version, but it may be coliding with another snippet.

 Respond  
[i]concur   -  Apr 02, 2011

not sure what you are getting at jaytea, bit tired and slighly out of it...so for now i just edited my remark and removed the bracket mismatch portion until i can further evaluate what i did and said...thanks for bringing to my attention that i may have made an error!

 Respond  
jaytea   -  Apr 02, 2011

[i]concur, those braces are extraneous and accomplish nothing except give people the false impression that only those commands in between the braces are tied to the selected connection.

scon 1
; commands here apply to con 1
scon 2 {
  ; this command applies to con 2
  ; so does this
}
; but this command also applies to con 2, it doesn't revert back to con 1.

this happens because the '{' and '}' are simply ignored by mIRC, and '/scon 2', as we know, switches the connection to 2 for the rest of the running process.

adding unnecessary braces can sometimes improve readability though, here's an example:

goto %var {
  :my

  :labels

  :here
}

; rest of code

the indentation created by those braces allows a person to easily see the extent of the scripter's goto labels.

 Respond  
[i]concur   -  Apr 02, 2011

You realize you can download previous versions of mIRC from the internet...right Rider91?
If you want another version you can either look it up...or you can send me a message telling me which and I'd be happy to provide you with a link!

 Respond  
Conscious   -  Apr 01, 2011

There's some form of bracket mismatch leading into an endless while loop

 Respond  
Rider91   -  Apr 01, 2011

lol, i had to, accidently deleted the one i had b4

 Respond  
[i]concur   -  Apr 01, 2011

probably the version Rider91. 7,19 fails...i'm refusing to update! :S

 Respond  
Rider91   -  Apr 01, 2011

ok, i put this in an every time i try to use it, my mIRC becomes unresponsive. any ideas? version 7.19 i think it is

 Respond  
Jethro   -  Dec 17, 2010

Good work. Keep it up.

 Respond  
Bielie   -  Dec 17, 2010

k thx jethro ;) What do you think about the snippet itself?

 Respond  
Jethro   -  Dec 16, 2010

This:

elseif ($nick(%curchan,%c) isvoice %curchan) || ($nick(%curchan,%c) isop %curchan) || ($nick(%curchan,%c) isreg %curchan) {
            if ($me isop %curchan) || ($me ishop %curchan) inc %control

Could have been shortened a lot more to:

elseif ($nick(%curchan,%c,vor)) && ($nick(%curchan,$me,oh)) inc %control
 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.