napa182 commented on a Page, Channel Join Message (Multi Channel, Multi Network)  -  Mar 28, 2010

maybe use hash for this instead of filling up ur var list

here is a fast rewrite using hash trying to keep it at what you have. added a delete command an you may want to add a flood control an some checks, but w/e

on @*:text:!joinmsg *:#: {
  if ($nick isop #) {
    if ($2 = on || $2 = off) {
      .hadd -m joinmsg $+(conf,.,$network,.,#) $iif($2 = on,on,off)
      msg # Joinmsg $+(,$hget(joinmsg,$+(conf,.,$network,.,#)),.)
    }
    if ($2 = set || $2 = del) {
      $iif($2 = set,.hadd -m joinmsg $+(text,.,$network,.,#) $3-,$iif($2 = del,hdel joinmsg $+(text,.,$network,.,#)))
      msg # Joinmsg $iif($hget(joinmsg,$+(text,.,$network,.,#)),set.,deleted.)
    }
  }
  else { msg # $nick - Only channel operators may use this command. }
}
on !*:JOIN:#: { 
  if ($hget(joinmsg,$+(conf,.,$network,.,#)) && $hget(joinmsg,$+(text,.,$network,.,#))) {
    msg # $hget(joinmsg,$+(text,.,$network,.,#)) 
  }
}
on *:start:{ $joinmsgstartup } 
on *:connect:{ $joinmsgstartup }
on *:exit:{  $joinmsgclose } 
on *:disconnect:{ $joinmsgclose }
alias -l joinmsgclose { .hsave joinmsg $qt($scriptdirjoinmsg.hsh)  } 
alias -l joinmsgstartup {  
  if (!$hget(joinmsg)) { .hmake joinmsg 100 } 
  elseif ($exists($qt($scriptdirjoinmsg.hsh))) { .hload joinmsg $qt($scriptdirjoinmsg.hsh) } 
}
 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.