Channel Join Message (Multi Channel, Multi Network)

By Henco on Mar 28, 2010

This script is designed to be used for a bot, and can support unlimited channels on unlimited networks.

To activate Joinmsg, !joinmsg on
To set greeting, !joinmsg set
To deactivate Joinmsg, !joinmsg off

Have fun,
Henry ;)

;###### MULTI CHANNEL MULTI NETWORK JOIN MESSAGE SCRIPT - COPYRIGHT 2010 HENRY COLE ######
;###### MORE INFO & HELP IN #HENCO ON IRC.INFINITYIRC.COM ######

on *:text:!joinmsg *:#: {
  if ($nick isop $chan) {
    if ($2 == on) {
      set %joinmsgconf. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] on
      msg $chan Joinmsg on.
    }
    if ($2 == off) {
      set %joinmsgconf. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] off
      msg $chan Joinmsg off.
    }
    if ($2 == set) {
      set %joinmsgtext. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] $3-
      msg $chan Joinmsg set.
    }
  }
  else {
    msg $chan $nick - Only channel operators may use this command.
  }
}

on !*:JOIN:#: {
  if ( %joinmsgconf. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ] == on ) {
    msg $chan %joinmsgtext. [ $+ [ $network ] $+ ] . [ $+ [ $chan ] ]
  }
}

Comments

Sign in to comment.
shaneny   -  Jul 10, 2010

Hi Henco, excellent snippet, but would it not be better and cleaner if you just wrote all the entrymsg's in that file using writeini or just write

 Respond  
Keon191   -  Apr 10, 2010

hey i was wondering if you can set it to different modes...what i mean is theres a bot on jtv where you can set the joins to certain people or off ... like this
!notice all
!notice mod [op's]
!notice off

 Respond  
Jethro   -  Mar 28, 2010

Ok, I see, and I agree. INI shall be good to apply to this script as well.

 Respond  
napa182   -  Mar 28, 2010

well depending on how many channels you use this on it will be more.
you never know some people may use this on more then 6 chans then you have more vars in ur list. i just don't like filling my var list up with stuff like this.

 Respond  
Jethro   -  Mar 28, 2010

napa182, why the hash table? There are only two variables set if I'm not mistaken.

 Respond  
napa182   -  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.