I made this to make ppl easier to make power or similiar scripts.
Everything you need is a simple identifer $c_stats on which you add various parameters or properties and insert it into your code.
Script is using $comchan to calculate total channels you are on because some users have enabled 'Keep channels open' in mIRC options and when u get kicked, channel is still open and would be counted in $chan(0)
I won't talk too much about script and possible parameters/properties here, everything's written on the top of code
If you need any help, ask here or mail me at chaplja@gmail.com
Enjoy!
; Custom identifer which can be used for power scripts or similiar - $c_stats
; Usage $c_stats(parameter).properties (ignore .properties if there isn't any)
; Example: $c_stats(voiced).noop or $c_stats(invite)
; Possible parameters:
; oped: returns total number of channels where you have op
; voiced:
; -if used w/o properties or with properties incop, it will return total number of channels where you have voice, also will count if you have both, voice and op
; -if used w/ properties noop, it will return total number of channels where you have voice, but will ignore channels where you have op
; passworded: returns total number of channels which are passworded and you are currently idling there
; invite: returns total number of channels which are invite only and you are currently idling there
; secret: returns total number of channels which have +s mode
; power:
; -if used w/ properties control, it will return total number of users you're controling
; -if used w/ properties total, it will return total number of users with who you share channel(s) atm
; For any further help ask here in comments or visit #reality-squared @ QuakeNet
; Mail: chaplja@gmail.com
alias c_stats {
if (!$1) { return }
else {
if ($1 == oped) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if ($me isop $chan(%i)) { inc %x }
inc %i
}
return %x | halt
}
if ($1 == voiced) {
if (!$prop) || ($prop == incop) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if ($me isvoice $chan(%i)) { inc %x }
inc %i
}
return %x | halt
}
if ($prop == noop) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if ($me isvoice $chan(%i)) && ($me !isop $chan(%i)) { inc %x }
inc %i
}
return %x | halt
}
else { echo -a Error: Unknown properties: $prop }
}
if ($1 == passworded) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if ($chan(%i).key) { inc %x }
inc %i
}
return %x | halt
}
if ($1 == invite) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if (i isin $chan(%i).mode) { inc %x }
inc %i
}
return %x | halt
}
if ($1 == reg) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0) {
if ($me !isop $chan(%i)) || ($me !isop $chan(%i)) { inc %x }
inc %i
}
return %x | halt
}
if ($1 == secret) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if (s isin $chan(%i).mode) { inc %x }
inc %i
}
return %x | halt
}
if ($1 == power) {
if ($prop == total) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
var %x = $calc(%x + $calc($nick($chan(%i),0) - 1))
inc %i
}
return %x
}
if ($prop == control) {
var %i = 1
var %x = 0
while (%i <= $comchan($me,0)) {
if ($me isop $chan(%i)) {
var %x = $calc(%x + $calc($nick($chan(%i),0) - 1))
}
inc %i
}
return %x
}
if (!$prop) { return }
}
}
}