Okay... so I got bored and decided to write a little channel statistics code. Paste it in the remotes section of your mIRC and upon typing the command !chanstats the script will give you a variety of information concerning the channel that the script has recorded. Type !reset chanstats to reset all the information. Type !lines NICKNAME to see how many lines a given person in the channel has. Easy right? Enjoy.
Note: It now works for multiple channels and servers.
#############################
# Channel Statistics Script #
# Coded by: Cage #
#############################
on *:TEXT:!chanstats:#: {
if (% [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $nick ] ] == $null) { set %lines. $+ $chan $+ . $+ $server $+ . $+ $nick 0 }
if (% [ $+ joins. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %joins. $+ $chan $+ . $+ $server 0 }
if (% [ $+ lastline. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %lastline. $+ $chan $+ . $+ $server Nobody }
if (% [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %statsdate. $+ $chan $+ . $+ $server $date }
if (% [ $+ linestot. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %linestot. $+ $chan $+ . $+ $server 0 }
if (%waitstats == $null) {
msg $chan Statistics for channel $+(,$chan,:,)
msg $chan Recorded since: % [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ]
msg $chan Total number of lines spoken: % [ $+ linestot. $+ [ $chan ] $+ . $+ [ $server ] ]
msg $chan There are currently $nick($chan,0) user(s) in this channel.
msg $chan $+(,% [ $+ lastline. $+ [ $chan ] $+ . $+ [ $server ] ],) was the last person to speak.
msg $chan You have currently spoken % [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $nick ] ] line(s) $nick
msg $chan $+(,% [ $+ joins. $+ [ $chan ] $+ . $+ [ $server ] ],) people have joined the channel.
msg $chan Random Line: $read(randomline. $+ $server $+ . $+ $chan $+ .txt)
set -u5 %waitstats 1
}
}
on *:TEXT:!reset chanstats:#: {
set %statsdate. $+ $chan $+ . $+ $server $date
set %linestot. $+ $chan $+ . $+ $server 0
set %lastline. $+ $chan $+ . $+ $server Nobody
unset %lines.*
write -c randomline. $+ $server $+ . $+ $chan $+ .txt
msg $chan Statistics for $chan has been reset.
}
on *:TEXT:!lines*:#: {
if (% [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $2 ] ] == $null) { msg $chan $2 hasn't said anything in this channel yet. }
else { msg $chan $2 has currently spoken % [ $+ lines. $+ [ $chan ] $+ . $+ [ $server ] $+ . $+ [ $2 ] ] in $chan on $network $+ . }
}
on *:TEXT:*:#: {
if ($1- == !chanstats) ($1- == !reset chanstats) { Halt }
if (% [ $+ statsdate. $+ [ $chan ] $+ . $+ [ $server ] ] == $null) { set %statsdate. $+ $chan $+ . $+ $server $date }
else if ($len($1-) >= 30) { write randomline. $+ $server $+ . $+ $chan $+ .txt $$1- $+([,By: $nick,]) }
set %lastline. $+ $chan $+ . $+ $server $nick
inc %linestot. $+ $chan $+ . $+ $server 1
inc %lines. $+ $chan $+ . $+ $server $+ . $+ $nick 1
}
on *:JOIN:#: { inc %joins. $+ $chan $+ . $+ $server 1 }
hey good work but i need channels stats script which gives all things like stats serv example:
[22:52:04] <@Devil> !gtop10
[22:52:04] <+StatServ> Top 10 of Network
[22:52:05] <+StatServ> 1 RonBot letters: 175772, words: 27414, lines: 3457, smileys: 7, actions: 0
[22:52:05] <+StatServ> 2 r0ns0r letters: 72151, words: 11986, lines: 2294, smileys: 2, actions: 9
[22:52:05] <+StatServ> 3 delete/this/shit letters: 65840, words: 12723, lines: 1662, smileys: 0, actions: 2
[22:52:05] <+StatServ> 4 ronsor letters: 52888, words: 9410, lines: 3857, smileys: 4, actions: 9
[22:52:05] <+StatServ> 5 XF letters: 38596, words: 19225, lines: 17065, smileys: 3474, actions: 2129
[22:52:05] <+StatServ> 6 Adam letters: 26873, words: 5269, lines: 1336, smileys: 58, actions: 0
[22:52:05] <+StatServ> 7 Exploit letters: 23943, words: 4106, lines: 1574, smileys: 38, actions: 1
[22:52:05] <+StatServ> 8 Devil letters: 23254, words: 4504, lines: 1411, smileys: 90, actions: 11
[22:52:05] <+StatServ> 9 Police letters: 19352, words: 3145, lines: 315, smileys: 0, actions: 25
[22:52:05] <+StatServ> 10 dev/null letters: 15121, words: 2897, lines: 966, smileys: 5, actions: 0
Nice, but i would suggest that .timer 0 999 /checklines and for checklines aliases set that it uses $lines(chan1.txt) and if they are more than 100 or 200, then
var %line1 = $read(chan1.txt,1)
var %line2 = $read(chan1.txt,2)
var %line3 = $read(chan1.txt,3)
.write -c chan1.txt
.write chan1.txt %line1
.write chan1.txt %line2
.write chan1.txt %line3
I like this script, I was thinking you could add variables at the start so there\'ll be no blank lines like \"Last person kicked:\". eg:
alias clearvars {
set %lines 0
set %opline 0
set %halfopline 0
set %voiceline 0
set %lastline No-one
}
... things like that. Also, you could add more features, none of which I can think of :p, but this is a potentially excellent script. Not saying it isn\'t now...