mIRC Statistics

By TMFKSOFT on Dec 01, 2011

Im pretty sure this has been done many times before on hawkee but its always good to do something a bit different.

Introducing my statistics script.
After playing with eggdrop and its example scripts "ques5" to be precise,
I had a shot at doing this myself in mIRC.

Its possible. :)

I've done my best feel free to point out what can be improved and such.

Load and restart your mIRC :D

Updated:
11/03/2012 - Changed the quiet variable to %quiet and fixed it so its 100% certain to be quiet.

  • Removed the -l on the /config as it stopped /config from being used manually.
; mIRC Statistics
; Written for Ilkotech IRC by Thomas Edwards (TMFKSOFT)
; Statistics will log every 60 seconds unless changed.
; Multi-network stats are not currently supported.

; CAUTION: This script is pretty noisy!

alias config {

  set %dir html

  ; Interval between each update in seconds.

  set %update 5

  ; Make script quiet?

  set %silent true

  ; Owner - Put your nick

  set %owner Fudgie
  ;====================================;
  ;   DO NOT Edit below this section!  ;
  ;====================================;
  if ($1 == system) {
    echo -g 6:: Loading Config ::
  }
  else {
    echo -g 6:: Reload command issued by $me ::
  }
}
on 1:CONNECT:{
  config system
  echo -g 7Connected to an IRC Network. Starting stats.
  timerstats 0 $iif(%update,%update,60) makestats
  makestats
}

on 1:START:{
  config system
  echo -g 4:: Loading Statistics Script ::

  if ($exists(%dir)) {
    echo -a 3Statistics Script Loaded!
  }
  else {
    echo -g 4Error loading statistics script. $+(',%dir,') No such directory.
  }

}

on 1:TEXT:!reload:#:{
  if ($nick == %owner) {
    config
    msg # :: Config reloaded ::
  }
  else {
    msg # :: You are not my owner ::
  }
}

on 1:DISCONNECT:{
  echo -g 4Disconnected from IRC. Stopping stats.
  unset %dir %update %minimal
}

alias -l makestats {
  linesep
  if (%silent == false) { echo -g 12:: Writing Statistics :: }
  var %chan_count $chan(0)
  var %x 1
  ;Write index.html
  .fopen -o index %dir $+ /index.html
  .fwrite index <meta http-equiv=refresh content= $+ %update $+ ;url=index.html ><title>Statistics for $network $+ </title> $+ $crlf $+ <font face="Arial"/> $+ $crlf $+ <h1>mIRC Statistics > $network $+ </h1><hr color="black"/>
  .fwrite index <h3>Bot info:</h3><b>My Nick is:</b> $me <br><b>The network name is:</b> $network <br><b>The server I am on is:</b> <a href="irc:// $+ $server $+ : $+ $port $+ /"> $+ $server $+ : $+ $port $+ </a><br><b>I am on %chan_count channels</b><br>
  .fwrite index <hr color="black"/><center>
  if ($chan(0) == 0) {
    .fwrite index <h2>I am not joined to any channels :(</h2>
  }
  else {
    .fwrite index <h2>I am on the following channels:</h2>
    while (%x <= $chan(0)) {
      .fwrite index <b> $chan(%x) - <a href=" $+ $remove($chan(%x),$chr(35)) $+ .html" $+ >View</a></b><br>
      inc %x
    }
  }
  .fwrite index <hr color="black"/><small><b><i>Last updated: $time(hh:nntt dd/mm/yyyy) </i></b></small>
  .fwrite index <p>Statistics Script by Thomas Edwards (TMFKSOFT) for <a href="http://ilkotech.co.uk/">Ilkotech.co.uk</a> &copy; Copyright 2011</p>
  .fclose index
  var %x 1
  if ($chan(0) == 0) {
    if (%silent == false) { echo -g 4:: No channels to write. :: }
    HALT
  }
  else {
    if (%silent == false) { echo -g 3:: Writing $chan(0) channels. :: }
    while (%x <= $chan(0)) {
      if (%silent == false) { echo -g 7:: Writing channel $chan(%x) :: }
      var %chan $remove($chan(%x),$chr(35))
      .fopen -o chan %dir $+ / $+ %chan $+ .html
      .fwrite chan <meta http-equiv=refresh content= $+ %update $+ ;url= $+ %chan $+ .html ><title>Statistics for $network - $chan(%x) $+ </title> $+ $crlf $+ <font face="Arial"/> $+ $crlf $+ <h1>mIRC Statistics > $network > $chan(%x) $+ </h1><hr color="black"/>
      .fwrite chan <h2>Stats for $chan(%x) $+ </h2><b>Topic:</b> $iif($chan(%x).topic,$chan(%x).topic,<i>No topic in $chan(%x) $+ </i>) <br>
      .fwrite chan <b>Usercount:</b> $nick($chan(%x),0) <hr color="black"/><center><h2>Users in $chan(%x) $+ </h2>
      var %i 1
      var %users $nick($chan(%x),0)
      while (%i <= %users) {
        .fwrite chan <b> $+ $nick($chan(%x),%i).pnick $+ </b> - $right($address($nick($chan(%x),%i),0),-2) $iif($nick($chan(%x),%i) == $me,<small><b><-- LOOK! ITS ME!</b></small>) <br>
        inc %i
      }
      .fwrite chan <br> $iif(%users = 1,<h3>Im all alone :' $+ $chr(40) $+ </h3>) <hr color="black"/><b><small><i>Last updated: $time(hh:nntt dd/mm/yyyy) </i></small></b><br><h3><a href="index.html">Home</a></h3>
      .fwrite chan <p>Statistics Script by Thomas Edwards (TMFKSOFT) for <a href="http://ilkotech.co.uk/">Ilkotech.co.uk</a> &copy; Copyright 2011</p>      
      .fclose chan
      inc %x
    }
  }
  if (%silent == false) { echo -g 4:: Written all stats :: }
}

Comments

Sign in to comment.
TMFKSOFT   -  Mar 11, 2012

After note:
Look at your status window.

If you just load the script and dont edit anything you will find it says this:

:: Reload command issued by Fudgie ::
:: Loading Statistics Script ::
Error loading statistics script. 'html' No such directory.

To make the directory simply type "/mkdir html" then

 Respond  
TMFKSOFT   -  Mar 11, 2012

Annaiidziithaa, Line 75 is where its trying to write to the main index.html file.
Make sure you have set %dir correctly on line 11 and that the directory exists!

I hope this helps!
Thanks,

FragUK:
I've been delayed with the script currently due to other pressing projects but I HOPE to have it done sometime this month.

 Respond  
fraguk   -  Mar 10, 2012

lol,fix what it works , cant you see o0 http://teh-evilcode.bugs3.com/statistics/

 Respond  
Annaiidziithaa   -  Mar 10, 2012

what you have to do is fix the error, not to put a new link on pastebin, if it fails, still having the same error. line 75

 Respond  
Annaiidziithaa   -  Mar 10, 2012

fraguk I modified your nick, and put my nickname, change the channel on my channel too .... and yet still gives the same error.
/fwrite: invalid parameters (line 75)

someone please fix this ... I've seen worse shit .... and a fixed here ...

 Respond  
fraguk   -  Mar 10, 2012
Annaiidziithaa   -  Mar 10, 2012

fraguk /fwrite: invalid parameters (line 75, script83.mrc)

if you say that it works for you ... since then .. post your script "no errors"

 Respond  
Annaiidziithaa   -  Mar 10, 2012

fraguk can you tell me how to configure? And Stats tell me how I look at my channel, please explain it to pro

 Respond  
fraguk   -  Mar 10, 2012

Annaiidziithaa, it does work .. http://teh-evilcode.bugs3.com/statistics/

 Respond  
Annaiidziithaa   -  Mar 10, 2012

does not work, is bullshit.

 Respond  
fraguk   -  Mar 09, 2012

Any news TMFKSOFT ,,, :)

 Respond  
JoKabua   -  Feb 22, 2012

Thanks

 Respond  
fraguk   -  Feb 17, 2012

:o Nice :)

 Respond  
TMFKSOFT   -  Feb 17, 2012

Next week ;D Its a scrit not a snippet too.

 Respond  
fraguk   -  Feb 16, 2012

Wheres V2 then :)

 Respond  
TMFKSOFT   -  Feb 14, 2012

Load it and connect the bot to a network, join channels. It auto starts.

 Respond  
JoKabua   -  Feb 14, 2012

How do you guys use this what is the commands for this script?

 Respond  
TMFKSOFT   -  Feb 09, 2012

Lets try and wet your appetite.
mIRCS v2 is in creation.
v2 has mutli networks and channels like v1, channels and networks can be toggled via a admin panel
running on a HTTPD System as part of mIRCS, You can togle each channel and network. The statistics pages will also have a editable header, body and footer that are read when a stats page is generated, Secret channels can be ignored as well. There will be a stack of new features on its way!

 Respond  
Lenooox   -  Dec 07, 2011

i saw it mate :) i dont know what is the problem in my bot :(
i hope so someone someone could help me :)

 Respond  
fraguk   -  Dec 07, 2011
 Respond  
Lenooox   -  Dec 06, 2011

/fwrite: invalid parameters (line 75)

  .fwrite index <meta http-equiv=refresh content= $+ %update $+ ;url=index.html ><title>Statistics for $network $+ </title> $+ $crlf $+ <font face="Arial"/> $+ $crlf $+ <h1>mIRC Statistics > $network $+ </h1><hr color="black"/>
 Respond  
[nas]peter   -  Dec 03, 2011

alias makestats

Isn't it smarter to make this alias -l to only make it available locally? so nothing'll bug?

 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.