helpdesk script

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

helpdesk script

Postby Cristian » Thu Jul 10, 2008 6:28 pm

This script sends a privmsg to all operators, when a user joins a channel, fx. a help channel.

Change:
    channel
    message (if you want)
    exclude (add or remove nicknames)



Code: Select all
namespace eval helpdesk {
   namespace eval variable {
      variable channel "#Channel"
      variable message "entered the channel, and might need some assistance."
      variable exclude "Q L fishbot catbot sp00fed"
   }

   bind join -|- * [namespace current]::onjoin

   proc onjoin {nickname hostname handle channel} {
      if {[string match [string tolower $::helpdesk::variable::channel] [string tolower $channel]]} {
         set list ""
         foreach user [chanlist $channel] {
            if {[llength $list] == 6} {
               putserv "PRIVMSG [join $list ","] :$nickname $::helpdesk::variable::message"
               set list ""
            }
            if {[isop $user $channel]} {
               foreach exclude $::helpdesk::variable::exclude {
                  if {[string match $user $exclude]} {
                     continue   
                  }
                  lappend list "$user"
               }
            }
         }
         if {[llength $list] != 0} {
            putserv "PRIVMSG [join $list ","] :$nickname $::helpdesk::variable::message"
            set list ""
         }
      }
   }
}
putlog "\00304[string range [info script] 0 end]\00304 \002loaded...\002"
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: helpdesk script

Postby Lukemob » Fri Jul 11, 2008 8:07 pm

Nice one mate, many TCL newbies with IRC services would appreciate it :)
Lukemob
 


Return to TCL Scripting Release

Who is online

Users browsing this forum: No registered users and 2 guests

cron