Coders-IRC


IRC for Coders

Show Selected Joins/Parts/Quits


image

This addon shows when selected nicks join/part/quit from either all or selected channels. This addon is for people who like to hide the join/part/quit events by default but still would like to track a few friends. It simply shows the join or part event in selected or all channels and the quit event in the nicks query window if you have one open with that nick and all common channels in the selected channels list if the all channel option isn’t selected

ByPBall



/*
[Addon]
Script=join part messages
Version=2.1
Author=pball
Desc=shows joins, parts, and quits of selected users
For=Mirc
Date=

[script]
*/
Menu nicklist {
Join & Parts
.$iif($readini($scriptdirjoins.ini, $1, join), $style(2)) Add User(s): joins_add $1-
.$iif(!$readini($scriptdirjoins.ini, $1, join), $style(2)) Remove $1: $iif($readini($scriptdirjoins.ini, $1, welcome_back), remini $scriptdirjoins.ini $1 join, remini $scriptdirjoins.ini $1)
}

alias -l joins_add {
  while ($1) {
    writeini $scriptdirjoins.ini $1 join On
    tokenize 32 $2-
  }
}

menu channel,menubar { 
  Join & Parts { dialog -ma joinpart joinpart }
}

on *:join:#:{
  if ($regex($chan,$+(/,$replace($readini($scriptdirjoins.ini,Chan,chan),$chr(35),$+($chr(92),$chr(35))),/i))) || ($readini($scriptdirjoins.ini,Chan,allchan == 1)) {
    if ($readini($scriptdirjoins.ini,$nick,join)) echo $color(join) $chan $timestamp * $nick has joined
  }
}
on *:part:#:{
  if ($regex($chan,$+(/,$replace($readini($scriptdirjoins.ini,Chan,chan),$chr(35),$+($chr(92),$chr(35))),/i))) || ($readini($scriptdirjoins.ini,Chan,allchan == 1)) {
    if ($readini($scriptdirjoins.ini,$nick,join)) echo $color(part) $chan $timestamp * $nick has parted
  }
}
on *:quit:{
  if ($readini($scriptdirjoins.ini,$nick,join)) {
    if ($window($nick)) echo $color(quit) $nick $timestamp * $nick has quit $scid($cid).network [ $+ $1- $+ ]
    set -l %num 1
    while (%num <= $comchan($nick,0)) {
      if ($regex($comchan($nick,%num),$+(/,$replace($readini($scriptdirjoins.ini,Chan,chan),$chr(35),$+($chr(92),$chr(35))),/i))) || ($readini($scriptdirjoins.ini,Chan,allchan == 1)) { echo $color(quit) $comchan($nick,%num) $timestamp * $nick has quit $scid($cid).network [ $+ $1- $+ ] }
      inc %num
    }
  }
}

alias resetjoin {
  did -ra joinpart 3 $readini($scriptdirjoins.ini,Chan,chan)
  set -l %topic 1
  did -r joinpart 1
  while (%topic <= $ini($scriptdirjoins.ini,0)) {
    if ($ini($scriptdirjoins.ini,%topic) != Chan) did -a joinpart 1 $ini($scriptdirjoins.ini,%topic)
    inc %topic
  }
}

on *:dialog:joinpart:*:*:{
  if ($devent == close) {
    if ($did(3) != $null) writeini $scriptdirjoins.ini Chan chan $did(3)
    elseif ($did(3) == $null) && ($ini($scriptdirjoins.ini,Chan)) remini $scriptdirjoins.ini Chan
  }
  elseif ($devent == init) {
    if ($readini($scriptdirjoins.ini,Chan,allchan) == 1) {
      did -h $dname 3,7,9
      did -c $dname 10
    }
    resetjoin
  }
  elseif ($devent == sclick) {
    if ($did == 1) did -ra $dname 2 $did(1).seltext
    elseif ($did == 4) {
      if ($did(2) != $null) {
        writeini $scriptdirjoins.ini $did(2) join on
        did -ra $dname 9 Nick added
        resetjoin 
        did -r $dname 2
      }
    }
    elseif ($did == 8) && ($did(1).seltext != $null) && ($readini($scriptdirjoins.ini,$did(2),join) != $null) {
      remini $scriptdirjoins.ini $did(2)
      did -ra $dname 9 Nick removed
      did -r $dname 2
      did -d $dname 1 $did(1).sel
    }
    elseif ($did == 10) {
      writeini $scriptdirjoins.ini Chan allchan $did(10).state
      if ($did(10).state == 0) did -v $dname 3,7,9
      else did -h $dname 3,7,9
    }
  }
} 

dialog joinpart {
  title "Show Joins, Parts, Quits"
  size -1 -1 335 155
  option pixels
  list 1, 5 5 140 142, vsbar size sort
  edit "", 2, 180 5 150 20
  edit "", 3, 180 100 150 20, autohs
  button "Add", 4, 195 30 66 24, result
  button "Exit", 5, 265 125 66 26, cancel
  text "Nick", 6, 150 5 30 18
  text "Chans", 7, 147 100 30 16
  button "Delete", 8, 265 30 65 25
  text "# required, | is separator", 9, 180 80 146 17
  check "Show in All Chans", 10, 150 60 124 17
}

Comments 0