All pastes #990982 Raw Edit

Mine

public text v1 · immutable
#990982 ·published 2008-04-20 17:12 UTC
rendered paste body
;this is the on invite, when it executes it sends idm[us] a ctcp telling it to set a var of how many chans it on
;depending on chan count it join wichever is lower and if its equal idm joins
on 1:invite:#:{
  if ($me = idm) {
    ctcp idm[us]  chancount
    set %chans.idm $comchan($me,0)
    /timer 1 10
    if (%chans.us >= %chans.idm) { /join $chan }
    if (%chans.us < %chans.idm) { ctcp idm[us] join $chan }

  }
}
;the command count ctcp
ctcp 1:chancount*:{
  set %chans.us $comchan($me,0)
}
;the join ctcp
ctcp 1:join*:{
  if ($nick = idm) {
    $join $2
  }
}
;self explanatory
on 1:join:#:{
  if ($nick = $me) {
    if (*idm* ison $chan) {
      notice $chan Another iDM bot is detected, parting channel
      part $chan
    }
  }
}