How do i make sure that my scripts are applicable to more than 1 channel... and how do I make my Identify itself upon signing on to dalnet.. I need to register the bot to add it to my AOP list
ty
Code: Select all
############################################################################
# Nickserv identification Script #
# Author: Dedan Build 03.1021.07 #
# Copyright © 2003 R|Botics ALL rights reserved #
############################################################################
# NickServ6.tcl
#
# This Script will check to see if NickServ is online every 5 minutes and
# if so, identify and get OPs. Additional Comands are:
#
# - Commands -
# DCC - .ident (start ident procedure and get OPs)
# MSG - .ident (start ident procedure and get OPs)
#
# DCC and MSG commands are available to global o flaged Users.
# It is good to add NickServ as a user to stop ignores.(The below ALSO adds Chanserv)
# In DCC, TYPE:
# .+user NickServ *!service@dal.net
# .chattr NickServ +f-p
# .chpass NickServ VOID12345
# load this script in the scripts directory (eggdrop/scripts)
# Then go into the eggdrop directory and edit your .conf file
# (at the bottom) by adding this line: source scripts/ident.tcl
# Then in dcc type: .rehash and .ident
# This is NOT case sensitive. The Below works on Dalnet.
# set NickServ "NickServ"
set NickServ "NickServ"
# Set the bots nickname here.
# set i_nick "BotName"
set i_nick ""
# Set channels the bot has OPs on. (Use "" for all channels)
# IF YOUR BOT IS NOT AN OP ON ONE OF YOUR CHANNELS, THEN DO NOT USE ""
# Multiple channels seperated by spaces.
# set i_chans "#eggdrophelp #eggdroplovers"
set i_chans ""
# Set the bots ident password here.
# set i_pass "Password"
set i_pass ""
############ Stop Editing Here ############
######################################################################
# Main Script #
######################################################################
# init-server
bind evnt -|- init-server find:Nserv
proc find:Nserv {type} {
global NickServ
putserv "ISON $NickServ"
}
# raw Nickserv is on-line
bind raw -|- 303 Nserv:isonline
proc Nserv:isonline {from keyword text} {
global botnick NickServ i_nick i_pass i_gost_timer i_timer
if {[string match -nocase "*$NickServ*" "$text"]} {
if {[isbotnick $i_nick]} {
putserv "PRIVMSG NickServ@services.dal.net :IDENTIFY $i_pass"
return 0
} else {
putserv "PRIVMSG NickServ@services.dal.net :GHOST $i_nick $i_pass"
utimer $i_gost_timer [list putserv "NICK $i_nick"]
return 0
}
} else {
putlog "\[\002R\|Botics\002\] NickServ Identification Script\: NickServ is NOT online at the present time, I will check again in $i_timer minutes."
timer $i_timer [list find:Nserv $NickServ]
}
}
bind notc -|- "*owned by someone else*" identify:Nserv
proc identify:Nserv {nick uhost handle text dest} {
global botnick NickServ i_nick i_pass i_timer
if {[string match -nocase "*$NickServ*" "$nick"]} {
if {[isbotnick $i_nick]} {
putlog "Identifying Now."
putserv "PRIVMSG NickServ@services.dal.net :IDENTIFY $i_pass"
}
timer $i_timer {Nserv:ckops}
}
}
proc Nserv:ckops {} {
global botnick i_chans i_timer NickServ
# putlog "Started Backup ckOPs Procedure"
if {$i_chans == ""} {
set chans [channels]
} else {
set chans $i_chans
}
set ictr 0
foreach chan $chans {
if {[botonchan $chan]} {
if {![botisop $chan]} {
incr ictr 1
}
} else {
incr ictr 1
}
}
if {$ictr >= "1"} {
timer $i_timer [list find:Nserv $NickServ]
}
}
# Successful Ident
bind notc -|- "*Password accepted*" identN:success
proc identN:success {nick uhost handle text dest} {
global botnick NickServ i_chans i_gost_timer
if {[string match -nocase "*$NickServ*" "$nick"]} {
foreach timer [timers] {
if {[string match *find:Nserv* $timer]} {
killtimer [lindex $timer 2]
}
}
if {$i_chans == ""} {
set chans [channels]
} else {
set chans $i_chans
}
foreach chan $chans {
if {[botonchan $chan]} {
if {![botisop $chan]} {
putserv "PRIVMSG CHANSERV@services.dal.net :OP $chan $botnick"
}
}
}
utimer $i_gost_timer {backupN:getops}
}
}
proc backupN:getops {} {
global botnick i_chans i_timer
putlog "Checking to see if I am an OP on all Channels"
if {$i_chans == ""} {
set chans [channels]
} else {
set chans $i_chans
}
set ictr 0
foreach chan $chans {
if {[botonchan $chan]} {
if {![botisop $chan]} {
putserv "PRIVMSG CHANSERV@services.dal.net :OP $chan $botnick"
incr ictr 1
}
} else {
putserv "PRIVMSG ChanServ@services.dal.net :INVITE $chan"
incr ictr 1
}
}
if {$ictr >= "1"} {
timer $i_timer {backupN:getops}
} else {
foreach timer [timers] {
if {[string match *backupN:getops* $timer]} {
killtimer [lindex $timer 2]
}
}
putlog "Successful Ident and OP"
}
}
# DCC Commands Ident
bind dcc o ident dccN:ident
proc dccN:ident {handle idx text} {
global botnick i_timer NickServ
putlog "Started Ident Procedure at the request of $handle"
utimer $i_timer [list find:Nserv $NickServ]
}
# MSG Commands Ident
bind msg o .ident msgN:ident
proc msgN:ident {nick uhost handle text} {
global botnick i_timer NickServ
puthelp "PRIVMSG $nick :Starting Ident Procedure."
putlog "Started Ident Procedure at the request of $handle"
utimer $i_timer [list find:Nserv $NickServ]
}
############ Internal Vars ############ Do NOT Change ############
# Set the amount of time in minutes to check if nickserv is online.
set i_timer 5
# Set the amount of time in seconds before bot changes
# to "i_nick" "after" the ghost command was used.
set i_gost_timer 60
foreach timer [timers] {
if {[string match *find:Nserv* $timer]} {
killtimer [lindex $timer 2]
}
}
if {$i_chans == ""} {
putlog "Loaded \[\002R\|Botics\002\] NickServ Identification Script v07 by Dedan (active on all channels)"
} else {
set log_i_chans $i_chans
set log_i_chans [join $log_i_chans ", "]
set log_i_chans [linsert $log_i_chans end-1 and]
putlog "Loaded \[\002R\|Botics\002\] NickServ Identification Script v07 by Dedan (active on: $log_i_chans)"
unset log_i_chans
}
if {$i_nick == ""} {putlog "\[\002R\|Botics\002\] NickServ Identification Script \002\[ERROR\] YOU MUST ENTER A NICK\002"}
if {$i_pass == ""} {putlog "\[\002R\|Botics\002\] NickServ Identification Script \002\[ERROR\] YOU MUST ENTER A PASSWORD\002"}
######################################################################
############################### EOF ##################################