User count and activity indicator for mIRC

By Tritonio on Jan 06, 2015

This will open the second editbox on all channels and use that to display the number of users in that channel plus an activity indicator.

This is my first script and just the first version of it. I'll probably fine tune it.
EDIT: This is the second version, I made it server aware and fine tuned some things. Will keep this updated as I improve it.
EDIT: third version shows words per minute instead of a meaningless number. Also press F2 for an activity overview of all open channels.
EDIT: now channels that don't get any activity for a while are deleted from the activity list.

;ActivityMonitor by Tritonio

alias reduceactivity {
  var %i = 1
  while ($hget(activity, %i).item) {
    var %t = $calc($hget(activity, $v1) * %decay)
    hadd activity $v1 %t
    inc %i
  }
  var %i = 1
  while ($hget(activity, %i).item) {
    var %j = $v1
    var %t = $calc($wpm($hget(activity, $v1)))
    if (%t < 0.009) {
      hdel activity %j
      break
    }
    inc %i
  }
  showactivity $active $activecid
}

alias F2 {
  var %i = 1
  echo 7 -g -------------------------
  echo 7 -g Activity in open channels
  while ($hget(activity, %i).item) {
    var %a = $hget(activity,$v1)
    echo 7 -g $round($wpm(%a),2) wpm in $v1
    inc %i
  }
  echo 7 -g -------------------------
}

alias wpm {
  return $calc(($1 - $1 * %decay ^ 2)/(2 * %decay)*60)
}

alias showactivity {
  scid $2
  var %a = $hget(activity,$+($2,$1))
  editbox -oq1 $1 $1 $+ : $nick($1,0)   Activity: $round($wpm(%a),2) wpm
}

alias resetactivitytable {
  hfree activity
  hmake activity 15
}

on *:START:{
  hmake activity 15
  set -e %decay 0.995
  timer -io 0 1 /reduceactivity
}

on *:JOIN:#: {
  showactivity $chan $cid
}

on *:PART:#: {
  showactivity $chan $cid
}

on *:ACTIVE:#: {
  showactivity $active $activecid
}

on *:TEXT:*:#: {
  hadd activity $+($cid,$chan) $calc( $hget(activity, $+($cid,$chan) ) + $0)
}

on 1:INPUT:#: {
  if ($left($1,1) != / ) hadd activity $+($cid,$chan) $calc( $hget(activity, $+($cid,$chan) ) + $0) 

Comments

Sign in to comment.
ovelayer   -  Jan 07, 2015

anyway to make it go to the toolbar instead on down at the bottom?

Tritonio  -  Jan 07, 2015

You mean the toolbar with the buttons for connecting/disconnecting etc? AFAIK no... I'll check the help manual.

Also I'll update the code in a minute. It now shows an estimate of words per minute as an activity score instead of a meaningless number. Behind the scenes it's the same thing. You can find me on freenode ##mirc btw.

ovelayer  -  Jan 07, 2015

yup yup

Sign in to comment

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.