Jethro commented on a Page, Join message (on/off function)  -  Apr 30, 2010

@Bielie:

on *:exit:savehsh
on *:start:loadhsh
on me:*:quit:savehsh
on *:connect:loadhsh
on *:disconnect:savehsh
alias -l savehsh { hsave join $qt($scriptdirjoin.hsh) }
alias -l loadhsh {
  if (!$hget(join)) { hmake join 100 }
  if ($isfile($qt($scriptdirjoin.hsh))) { .hload join $qt($scriptdirjoin.hsh) }
}
on !*:join:#: {
  if !$hfind(flood,$nick) && !$hfind(join,$wildsite) {
    hinc -mu9 flood $nick | notice $nick Hey $nick! Welcome in # . Enjoy your stay!
    .timer 1 2 notice $nick Dont want this message when you join a channel? Type: !joinmsg off
  }
}
on $*:text:/^!joinmsg (\w+)/iS:#: {
  if $regml(1) == off {
    goto $iif(!$hfind(join,$wildsite),on,alreadyon)
    :on | hadd -m join $wildsite | notice $nick Your join message has been turned off!
    .timer 1 2 notice $nick Want to turn it back on? Type !joinmsg on | halt
  }
  if $regml(1) == on { 
    goto $iif($hfind(join,$wildsite),off,alreadyoff)
    :off | hdel join $wildsite | notice $nick Your join message has been turned on. | halt
  }
  :alreadyon | notice $nick your join message is already turned off! | halt
  :alreadyoff | notice $nick your join message is already turned on! | halt
}
 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.