EToS
{ ADMIN }
posts: 13
last: 24-Sep-2008
TITLE: Simple Eggdrop TCL Script for opering a bot on an IRCD and autoop on join channels
DESCRIPTION: Using init-server sv oper to autoop a bot on connect
Submitted: 28-Nov-2007 05:07:56 ( 1yrs 5w 6d 3h ago ) Language: TCL (*.tcl *.tk)
Views: 286 Lines of Code: 54 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Intermediate
Bookmark
/* Author: EToS
   Date: 28-11-2007
   Filename: operscript.tcl
   Description:  Simple script for opering a bot on an IRCD + autoop on join channels
   History:  

   NB: use this script carefully! as it can be insecure if you 
       dont know what your doing (ie bad bot security)
*/


############# Config #############

set operpass "password"
set ident "username"
set debug "#debug-channel"

############# Binds #############

bind join - * svjoin
bind mode - "* -o" svdeop
bind evnt - init-server sv_oper

############# Functions #############

proc sv_oper { $text } { 
 global operpass ident botnick
   putserv "OPER $ident $operpass"
   putserv "MODE $botnick +a"
   putserv "MODE $botnick +c"
   putserv "MODE $botnick +q"
   putserv "MODE $botnick -h"
   putserv "MODE $botnick +B"
   putserv "SAMODE #a-channel +nst"
   putlog "opering up"
}

proc svjoin {nick uhost hand chan} {
    global botnick debug

    if {$nick == $botnick} {      
        putquick "samode $chan +h $botnick $botnick"
        putquick "PRIVMSG $debug : Entered channel \002$chan\017"
    }
}

proc svdeop {nick uhost hand chan args} {
    global botnick
    if {$nick == $botnick} {
        putquick "samode $chan +h $botnick $botnick"
    }
}

putlog "Script loaded: oper script \00302\002(C) 2004 EToS"