Quick Common Channel reference

By mattshu on Nov 29, 2017

Quick snippet to see who is also with you in where :)

; usage /comchandlg
dialog _comchandlg {
  title "Common Channels"
  size -1 -1 230 231
  option pixels notheme
  text "Channel:", 1, 12 13 53 17
  combo 2, 73 12 152 260, drop
  list 3, 6 39 101 157
  button "Close", 7, 6 193 213 31, ok
  list 4, 121 39 101 157
}

alias comchandlg {
  dialog -mo _comchandlg _comchandlg
}

on *:DIALOG:_comchandlg:init:0:{
  var %i = 0
  while (%i < $chan(0)) {
    inc %i
    did -a $dname 2 $chan(%i)
  }
  did -c $dname 2 1
  var %chan = $did(2,1)
  _getComChans %chan
}
on *:DIALOG:_comchandlg:sclick:*:{
  if ($did == 2) {
    did -r $dname 4
    _getComChans $did(2).seltext
  }
  if ($did == 3) {
    did -r $dname 4
    var %current = $did(3).seltext
    var %comchan = $comchan(%current,0)
    var %i = 0
    while (%i < %comchan) {
      inc %i
      did -a $dname 4 $comchan(%current,%i)
    }
  }
}
alias -l _getComChans {
  ;Add,More,Exclusions,In,CSV,Format
  var %avoid = $me $+ ,ChanServ
  did -r _comchandlg 3
  var %chan = $1
  var %i = 0
  while (%i < $nick(%chan, 0)) {
    inc %i
    var %current = $nick(%chan, %i)
    if (!$istok(%avoid,%current,44)) && ($comchan(%current,0) > 1) {
      did -a _comchandlg 3 %current
    }
  }
}

Comments

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.