Hello - I'm using this Channel Statistics Code below, What I'm looking to add to it is a !top10 command that would list the top 10 channels with the most totl number of lines saved in wherever the script saves it.
for example
!chanstats - currently does the following;
!chanstats
. : Channel Statistics : . - . : channel #lobby : .
Recorded Since: 19/09/2016
Total number of lines spoken: 9482
There are currently 21 user(s) in this channel.
RandomUser was the last person to speak.
You have currently spoken 1542 line(s) DaNzO
13 people have joined the channel.
Random Line: Carry on and you get a ban [By: Rolz]
I want an add to add
!top10chan
. : Top 10 Channels Stats - Lines : .
1 - #channel(9482)
2 - #channel(8637)
3 - #channel(3848)
4 - #channel(3524)
5 - #channel(3234)
6 - #channel(2956)
3 - #channel(2635)
4 - #channel(1374)
5 - #channel(954)
6 - #channel(743)
below is the code i currently have for the channel stats.
Hope someome can help me <33
```
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 4. : Channel Statistics 4: . - 4. : channel $+(,$chan,:,) 4: .
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:!del chanstats:#: {
if ( $nick == FOP ) && ( $nick isop $chan ) {
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.
msg #ServServ $+ $nick $+ has deleted Channel Statistics for $+ $chan $+
}
}
on *:TEXT:*:#: {
if ($1- == !chanstats) ($1- == !del 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
}
```