User Stats ( Intended for a [BOT] )

By MashhitDK on May 29, 2011

[size=22]User-Stats[/size]
"Advanced" STATS System - Intended for a BOT ooO( BOT POWER! )
Including CHANNEL-, USER- and TOTAL-STATS

This will save stats to .ini files on how many words, lines and characters theres been used.
And when requested ( !USTATS ) the stats will be listed in the channel it's requested on (NOTE: The BOT needs to be OP'eD for the script to work at all)
Else there isn't much more to say... it works and records every time someone talks.

[b]NOTE:
The BOT needs to be OP'eD for the script to work.
It will NOT keep track of guest or nicks of any kind with guest in 'em
NO COLORS ADDED[/b] ooO(besides when doing !USTATS TOTAL)

Install

  1. ALT+R ( - in mIRC / Goto Remote )
  2. Copy and paste the code below ( into a new file unless you know what you are doing )
  3. Enjoy ?

How-2
!USTATS - Will show you how many lines, words and characters used.
NOTE You can use , TOTAL and CHAN... will all give you different stats
Ex. !USTATS - Will show you how many words, lines and characters you have used in total on ALL the channels and networks you and the bot is both on.
Ex. !USTATS MashhitDK - Will show you how many words, lines and characters MashhitDK has used in total on ALL the channels and networks MashhitDK and the bot is both on.
Ex. !USTATS TOTAL - Will show you how many words, lines and characters used in total on ALL the channels and networks.
Ex. !USTATS CHAN - Will show you how many words, lines and characters used in total on the channel the command is used on.

  • If you find any problems... let Me know and I'll get right on it ;)

Thanks to
MartyniP's User Stats script for getting Me started
Xavia for needing this...
And of course all you none-haters posting in the future ;) ooO( I'm glad you like it )

;****
If you are... A fellow stoner... Danish... Cultivator... Crazy about weed...
Got any pictures of your own strain / lovely females...
Got free weed... Want to chill... Wanna hang out...
Found bugs... Need help one of My script...

;*******************************************************************************************************************************************************
;*** Created by The Danish IRC NUB aka TheDane aka TrulyOdd aka OldSchool aka iForget aka iForgot aka O.R.G.A.N. aka Mashhit aka MashhitDK *************
;* irc://IRC.P2P-Network.net:6667/SRU - Downloaded from Hawkee ( http://www.hawkee.com/snippet/8666/ ) *************************************************
;*******************************************************************************************************************************************************
on *:TEXT:*:#: {
  ;*** Don't do anything if I ain't OP'eD ( Will only work on channels where the BOT is / you are a OPERATOR )
  if ($me !isop $chan) || (guest isin $nick) { halt }
  ;****************************************
  else { set %TEXT-NiCK $replace($remove($nick,[,]),|,-)) }
  ;******* CREATE ( FOLDERs - Will make a TXT and Mash folder in your mIRC folder - NOTE: Will look something like C:\Users\Administrator\AppData\Roaming\mIRC on Windows 7 - NOTE: Will look something like C:\Documents and Settings\%USER\Application Data\mIRC on Windows XP )
  if ($isdir($mircdir\TXT) == $false) { mkDir $mircdir\TXT }
  if ($isdir($mircdir\TXT\Mash) == $false) { mkDir $mircdir\TXT\Mash }
  ;******* COUNTER SECTiON ( TOTAL - All channels and all networks the script is running on )
  ;*** Word ( TOTAL ) As in how words in total
  var %Words $calc($readini(TXT\Mash\0-STATS.ini,Words,TOTAL) + $0) | writeini -n TXT\Mash\0-STATS.ini Words TOTAL %Words
  ;*** Lines ( TOTAL ) As in how many lines written
  var %Lines $calc($readini(TXT\Mash\0-STATS.ini,Lines,TOTAL) +1) | writeini -n TXT\Mash\0-STATS.ini Lines TOTAL %Lines
  ;*** Characters
  var %Characters $calc($readini(TXT\Mash\0-STATS.ini,Characters,TOTAL) + $len($remove($1-,$chr(32)))) | writeini -n TXT\Mash\0-STATS.ini Characters TOTAL %Characters
  ;********************************************************************************************************************************************************************************************************
  ;******* COUNTER SECTiON ( CHANNEL - All channels the script is running on )
  ;*** Word ( TOTAL ) As in how words in total
  var %Words $calc($readini(TXT\Mash\0-STATS.ini,Words,$+($network,$chan)) + $0) | writeini -n TXT\Mash\0-STATS.ini Words $+($network,$chan) %Words
  ;*** Lines ( TOTAL ) As in how many lines written
  var %Lines $calc($readini(TXT\Mash\0-STATS.ini,Lines,$+($network,$chan)) +1) | writeini -n TXT\Mash\0-STATS.ini Lines $+($network,$chan) %Lines
  ;*** Characters
  var %Characters $calc($readini(TXT\Mash\0-STATS.ini,Characters,$+($network,$chan)) + $len($remove($1-,$chr(32)))) | writeini -n TXT\Mash\0-STATS.ini Characters $+($network,$chan) %Characters
  ;********************************************************************************************************************************************************************************************************
  ;******* COUNTER SECTiON ( NiCK - All channels and networks that nick is on and the script is running on )
  ;*** Word ( TOTAL ) As in how words in total
  var %Words $calc($readini(TXT\Mash\0-STATS.ini,Words,%TEXT-NiCK) + $0) | writeini -n TXT\Mash\0-STATS.ini Words %TEXT-NiCK %Words
  ;*** Lines ( TOTAL ) As in how many lines written
  var %Lines $calc($readini(TXT\Mash\0-STATS.ini,Lines,%TEXT-NiCK) +1) | writeini -n TXT\Mash\0-STATS.ini Lines %TEXT-NiCK %Lines
  ;*** Characters
  var %Characters $calc($readini(TXT\Mash\0-STATS.ini,Characters,%TEXT-NiCK) + $len($remove($1-,$chr(32)))) | writeini -n TXT\Mash\0-STATS.ini Characters %TEXT-NiCK %Characters
  ;********************************************************************************************************************************************************************************************************
  ;******* !Ustats ( The command used to check lines )
  if ($strip($1) == !iSTATS) { set %STATS-NiCK $replace($remove($strip($iif(!$2,$nick,$2)),[,]),|,-)
    ;*** ERROR
    if (Guest isin %STATS-NiCK) { msg # 4ERROR! - $+(14,%STATS-NiCK,) wont be in the DB so am not gonna waste time looking 15oO(4I do NOT keep track of guests of any kind15) }
    ;*** CHANNEL
    elseif ($strip($2) == CHAN) || ($strip($2) == CHANNEL) || ($strip($2) == ROOM) || ($strip($2) == $chan) || ($strip($2) == #) { set %STATS-NiCK $+($network,$chan) | msg # I've counted $readini(TXT\Mash\0-STATS.ini,Words,%STATS-NiCK) words in $readini(TXT\Mash\0-STATS.ini,lines,%STATS-NiCK) lines with a total of $readini(TXT\Mash\0-STATS.ini,Characters,%TEXT-NiCK) characters used here inside $+(3,#,) }
    ;*** TOTAL
    elseif ($strip($2) == TOTAL) || ($strip($2) == INTOTAL) || ($strip($2) == IN) && ($strip($2) == TOTAL) { set %STATS-NiCK TOTAL | msg # [4 IN TOTAL ] I've counted $readini(TXT\Mash\0-STATS.ini,Words,%STATS-NiCK) words in $readini(TXT\Mash\0-STATS.ini,lines,%STATS-NiCK) lines with a total of $readini(TXT\Mash\0-STATS.ini,Characters,%TEXT-NiCK) characters used. }
    ;*** NiCK
    elseif ($readini(TXT\Mash\0-STATS.ini,Words,%STATS-NiCK) != $null) { msg # $+(14,$strip($iif(!$2,$nick,$2)),) has writen $readini(TXT\Mash\0-STATS.ini,Words,%STATS-NiCK) $iif($readini(TXT\Mash\0-STATS.ini,Words,%STATS-NiCK) == 1,word,words) in $readini(TXT\Mash\0-STATS.ini,lines,%STATS-NiCK) $iif($readini(TXT\Mash\0-STATS.ini,lines,%STATS-NiCK) == 1,line,lines) with a total of $readini(TXT\Mash\0-STATS.ini,Characters,%TEXT-NiCK) characters used. }
    ;*** NOTHiNG WRiTTEN
    else { msg # $+(14,$strip($iif(!$2,$nick,$2)),) $iif(%STATS-NiCK ison $chan,hasn't written anything,has writen 0 lines) }
    unset %STATS-NiCK
  }
  ;********************************************************************************************************************************************************************************************************
  unset %TEXT-NiCK %Words %Lines %Characters
}

Comments

Sign in to comment.
dma   -  Oct 10, 2017

it dont work period

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.