This is my 1st ircstats script that ive made. Unfortunately it requires you to do one thing after loading before it works. Create the following sub folder -
D:\Documents and Settings\user\Application Data\mIRC\ircstats
Then it should work =) this is my 1st script that i have uploaded feedback would be greatly appreciated.
The commands are
(1). !ircstats
(2). !ircstats
(1): to check your own stats. .
(2): to check someone elses stats.
The script tells you the amount of words typed, sentences, bans, banned, kicks, kicked
;##############################
; Ircstats 1.0 |
; Written by ScReEmO-KiD |
; irc.shadowfire.org #screamo |
;##############################
on *:text:*:#: {
if ($1 != !ircstats) {
var %words = $calc( $numtok($1-,32) + $ircstats(words) )
var %sentences = $calc( $ircstats(sentences) + 1 )
.writeini ircstats\ $+ $nick $+ .ini $nick Words %words
.writeini ircstats\ $+ $nick $+ .ini $nick sentences %sentences
}
if ($1 == !ircstats) {
if ($2 = $null) { var %nm = $nick }
if ($2 != $null) { var %nm = $2 }
if ($stats(words,%nm) = $null) {
msg $chan 1,14[ERROR]: No stats for, %nm $+ .
.halt
}
if ($stats(words,%nm) != $null) {
.msg $chan 1,14 [IRC Stats for %nm $+ ] [Lines of text: $stats(sentences,%nm) $+ ] [Total words: $stats(words,%nm) $+ ] [Times kicked out: $stats(kicked,%nm) $+ ] [Users kicked: $stats(kicks,%nm) $+ ] [Users banned: $stats(bans,%nm) $+ ] [Times banned: $stats(banned,%nm) $+ ]
.halt
}
}
}
alias stats { return $readini(ircstats\ $+ $2 $+ .ini,$2,$1) }
alias ircstats { return $readini(ircstats\ $+ $nick $+ .ini,$nick,$1) }
on *:kick:#: {
var %kicked = $calc( $stats(kicked,$knick) + 1 )
.writeini ircstats\ $+ $knick $+ .ini $knick kicked %kicked
var %kicks = $calc( $ircstats(kicks) + 1 )
.writeini ircstats\ $+ $nick $+ .ini $nick kicks %kicks
}
on *:ban:#: {
var %banned = $calc( $stats(banned,$bnick) + 1 )
.writeini ircstats\ $+ $bnick $+ .ini $bnick banned %banned
var %bans = $calc( $ircstats(bans) + 1 )
.writeini ircstats\ $+ $nick $+ .ini $nick bans %bans
}
no need to use loops for saving hash
i made one ueing hash a few days ago
this is from the one i made this is the save an load
on *:disconnect:{ .hsave ircstats $qt($scriptdirircstats.hsh) }
on *:exit:{ .hsave ircstats $qt($scriptdirircstats.hsh) }
on *:start:{ if (!$hget(ircstats)) { .hmake ircstats 1000 | .hload ircstats $qt($scriptdirircstats.hsh) } }
on *:load:{ if (!$hget(ircstats)) { .hmake ircstats 1000 | .hload ircstats $qt($scriptdirircstats.hsh) } }
I shall make a hash one right away ^^ although i dont see what you mean by "you should go with hash for this cuz the ini file will fill up fast." It creates a seperate .ini for each $nick. $nick.ini for example.
I apreaciate the feedback napa182.
I am going to make a hash one, will be awaiting your feedback on the hash one as soon as im done.