Hello guys!
I was bored yesterday and decided to make a little snippet for some channel information. I saved the data on a .ini file and here's a list of what it exactly does:
Example:
[17:38:05] <07+Veritasweg> !textinfo [17:38:05] <04@
Veri||BOT> Info of #channel since 26-08-2011
[17:38:05] 04@`Veri||BOT Lines: 1390.
[17:38:05] 04@`Veri||BOT Words: 5514.
[17:38:05] 04@`Veri||BOT Tokens: 30668.
[17:38:05] 04@`Veri||BOT Record amount of people on #channel: 21.
I hope you guys enjoy it and please leave some messages about what can be better or some suggestions :).
[UPDATES]
\\
The first on text command stores all the data into the .ini file. If you want to add or remove a channel from the list just type $chan add of $chan del.
\\
on *:TEXT:*:%channels: {
var %words $0
var %tokens $len($1-)
var %iniwords $readini(chaninfo.ini,#,words)
var %inilines $readini(chaninfo.ini,#,lines)
var %initokens $readini(chaninfo.ini,#,tokens)
var %allwords $calc(%iniwords + %words)
writeini -n chaninfo.ini # words %allwords
writeini -n chaninfo.ini # lines $calc(%inilines + 1)
writeini -n chaninfo.ini # tokens $calc(%initokens + %tokens)
}
on *:JOIN:%channels: {
var %people $nick(#,0)
var %record $readini(chaninfo.ini,#,people)
if (%people > %record) {
.msg # NEW RECORD BABY!!!! Amount of people now: %people $+ . Old record: %record $+ . (Since 26-08-2011)
writeini -n chaninfo.ini # people %people
}
}
on *:text:$($iif(!textinfo == $strip($1),$1)):%channels:{
.ignore -cu3 $nick 2
var %c 1, %m = $+(Info of # since $readini(chaninfo.ini,#,date),|,$&
$+ Lines: $readini(chaninfo.ini,#,lines),.,|,$&
$+ Words: $readini(chaninfo.ini,#,words),.,|,$&
$+ Tokens: $readini(chaninfo.ini,#,tokens),.,|,$&
$+ Record amount of people on # $+ : $readini(chaninfo.ini,#,people),.)
while $gettok(%m,%c,124) {
.timer 1 $calc(%c *2) .msg # $v1
inc %c
}
}
on *:TEXT:$chan*:#:{
if ($2 == add && # !isin %channels) {
set %channels %channels $+ , $+ #
.msg # Channel successfully added.
writeini -n chaninfo.ini # words 0
writeini -n chaninfo.ini # lines 0
writeini -n chaninfo.ini # tokens 0
writeini -n chaninfo.ini # people $nick(#,0)
writeini -n chaninfo.ini # date $replace($date,/,-)
}
if ($2 == del && # isin %channels) {
set %channels $remove(%channels,#)
.msg # Channel successfully deleted.
remini chaninfo.ini #
}
}
Lol thnx PyTh0n:p
@ Jethro_
I added an option to add and remove channels from the list and solved the date thing. When you add a channel to the list it saves the startdate of that specific channel into the .ini file. I did this instead of %date, because if you use it on many channels you need too many variables ;).
You may consider using a timed delay for the ouput, rather than have them all come out at one time. Some networks or ops kick/ban for line flood if there are 5 or 6 lines sent immediately. We can't be too careful these days:
on *:text:$($iif(!textinfo == $strip($1),$1)):#:{
.ignore -cu3 $nick 2
var %c 1, %m = $+(Info of #channel since $replace($date,/,-),|,$&
$+ Lines: $readini(chaninfo.ini,#,lines),.,|,$&
$+ Words: $readini(chaninfo.ini,#,words),.,|,$&
$+ Tokens: $readini(chaninfo.ini,#,tokens),.,|,$&
$+ Record amount of people on # $+ : $readini(chaninfo.ini,#,people),.)
while $gettok(%m,%c,124) {
.timer 1 $calc(%c *2) .msg # $v1
inc %c
}
}
Use the identifier $date so it reflects today's date instead of get it hard-coded manually:
$replace($date,/,-)
The ignore command is to ignore the possibility of a trigger flood. Every user can merely trigger the code every 3 seconds.