Autoop script for authed users

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!

Autoop script for authed users

Postby Lukemob » Tue May 27, 2008 3:54 pm

Author: Lukemob
What it does: Give an op to a authed user on join
Usage: !aop on/off/status

Code: Select all
set aop(chan) ""
set aop(nick) ""

setudef flag authop

bind pub n "!aop" pub:aop
bind join - * join:aop
bind raw - "354" raw:aop

proc pub:aop {nick host hand chan arg} {
   global aop
   if {[lindex $arg 0] == ""} {
      putserv "notice $nick :Please use: !aop on|off|status"
   } elseif {[lindex $arg 0] == "on"} {
      if {[channel get $chan authop] == "1"} {
         putserv "notice $nick :Autoop is already enabled for $chan"
      } else {
         channel set $chan +authop
         putserv "notice $nick :Autoop is now enabled for $chan"
      }
   } elseif {[lindex $arg 0] == "off"} {
      if {[channel get $chan authop] == "0"} {
         putserv "notice $nick :Autoop is already disabled for $chan"
      } else {
         channel set $chan -authop
         putserv "notice $nick :Autoop is now disabled for $chan"
      }
   } elseif {[lindex $arg 0] == "status"} {
      if {[channel get $chan authop] == "1"} {
         putserv "notice $nick :Autoop is: enabled"
      } else {
         putserv "notice $nick :Autoop is: disabled"
      }
   }
}
proc join:aop {nick host hand chan} {
   if {[channel get $chan authop] == "1"} {
      global aop
      set aop(chan) "$chan"
      set aop(nick) "$nick"
      putserv "who $nick n%nat,167"
   }
}
proc raw:aop {from raw arg} {
   global aop
   if {[lindex $arg 3] != "0"} {
      putserv "mode $aop(chan) +o $aop(nick)"
   }
}


tHx
Lukemob
 

Re: Autoop script for authed users

Postby jonlar » Wed May 28, 2008 11:54 am

Nice work. Ty for that script.
jonlar
 

Re: Autoop script for authed users

Postby Lukemob » Wed May 28, 2008 2:23 pm

No problemo ;)
Lukemob
 


Return to TCL Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests

cron