Thanks DarkJFMan
here the script ....
since i dnt knw where this op thing u were askin for..i am sentin the whole script
thanks
# 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 VOID123
# Edit this file completely
# then place 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/ident09.tcl
# Then in dcc type: .rehash and .ident
# This is NOT case sensitive. The Below works on Dalnet.
# EXAMPLE: set iNickServ "NickServ"
set iNickServ "NickServ"
# Set the bots nickname here.
# EXAMPLE: set i_nick "BotName"
set i_nick "botname"
# Set channels the bot has OPs on. (Use "" for all channels)
# WARNING
# IF YOUR BOT IS NOT AN OP ON ONE OF YOUR CHANNELS, THEN DO NOT USE ""
# IF YOU DO, YOUR BOT WILL KEEP ASKING CHANSERV FOR OP's EVERY 5 MINUTES
# ON THAT CHANNEL THAT THE BOT DOES NOT HAVE OPs ON.
# Multiple channels seperated by spaces.
# set i_chans "#eggdropusers #eggdroplovers"
set i_chans "#channame #channame"
# Set the bots ident password here.
# EXAMPLE: set i_pass "Password123"
set i_pass "*****"
############ -o Procedure "i_regain_OPs" ############
# If you want the bot to regain OPs if it loses OPs, set this to 1
# set 1 to enable, 0 for off
set i_regain(OPs) 1
############ -o Procedure Override ############
# Valid settings are ALL Global flags. n, m, o, f, etc
# If set to o, and a global o user de-OPs the bot, the above "i_regain_OPs" procedure will halt
# EXAMPLE: set i_regain(flag) o
set i_regain(flag) o
############ Memo Procedure ############
# If enabled, the bot will read the first 5 memos
# If i_delete_memos is also enabled, the bot will DELETE ALL Memos AFTER reading the first 5 memos
# set 1 to enable, 0 for off
set i_read_memos 1
# If enabled, the bot will DELETE ALL Memos
# set 1 to enable, 0 for off
set i_delete_memos 1
############ Stop Editing Here ############
######################################################################
# Main Script #
######################################################################
# init-server
bind evnt -|- init-server findN_Nserv
proc findN_Nserv {type} {
global iNickServ
putserv "ISON $iNickServ"
}
# ############ raw Nickserv is on-line ############
bind raw -|- 303 Nserv:isonline
proc Nserv:isonline {from keyword text} {
global botnick iNickServ i_nick i_pass i_gost_timer i_timer
if {[string match -nocase "*$iNickServ*" "$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 findN_Nserv $iNickServ]
}
}
bind notc -|- "*owned by someone else*" identify:Nserv
proc identify:Nserv {nick uhost handle text dest} {
global botnick iNickServ i_nick i_pass i_timer
if {[string match -nocase "*$iNickServ*" "$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 iNickServ
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 findN_Nserv $iNickServ]
}
}
# ############ Successful Ident ############
bind notc -|- "*Password accepted*" identN:success
proc identN:success {nick uhost handle text dest} {
global botnick iNickServ i_chans i_gost_timer
if {[string match -nocase "*$iNickServ*" "$nick"]} {
foreach t [timers] {
if {[lindex $t 1] == "findN_Nserv"} {
killtimer [lindex $t end]
}
}
foreach t [utimers] {
if {[lindex $t 1] == "findN_Nserv"} {
killutimer [lindex $t end]
}
}
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 t [timers] {
if {[lindex $t 1] == "backupN_getops"} {
killtimer [lindex $t end]
}
if {[lindex $t 1] == "Nserv_ckops"} {
killtimer [lindex $t end]
}
}
foreach t [utimers] {
if {[lindex $t 1] == "backupN_getops"} {
killutimer [lindex $t end]
}
}
putlog "Successful Ident and OP"
}
}
# ############ De-OP Protection ############
set i_regain(flood) 0
set i_regain(findN) 0
bind mode -|- "* -o" keepN:ops
proc keepN:ops {nick uhost handle channel mode victim} {
global i_regain botnick i_chans iNickServ
if {$i_regain(OPs) == "0"} {return 0}
if {$victim != ""} {
if {[string match -nocase "$victim" "$botnick"]} {
if {$nick != ""} {
if {[matchattr $handle $i_regain(flag)]} {return 0}
}
if {$i_regain(flood) == "1"} {
return 0
} else {
set i_regain(flood) 1
utimer 5 [list set i_regain(flood) 0]
}
if {$i_chans != ""} {
set i_chan_search 1
set chans $i_chans
foreach chan $chans {
if {[string match -nocase "$chan" "$channel"]} {
set i_chan_search 0
break
}
}
if {$i_chan_search == "1"} {return 0}
}
putquick "PRIVMSG
CHANSERV@services.dal.net :OP $channel $botnick"
# utimer 2 [putquick "PRIVMSG
CHANSERV@services.dal.net :OP $channel $botnick"]
if {$i_regain(findN) == "1"} {
return 0
} else {
set i_regain(findN) 1
timer 2 [list set i_regain(findN) 0]
utimer 2 [list findN_Nserv $iNickServ]
}
}
}
}
# ############ DCC Commands Ident ############
bind dcc o ident dccN:ident
proc dccN:ident {handle idx text} {
global botnick i_timer iNickServ
putlog "Started Ident Procedure at the request of $handle"
utimer $i_timer [list findN_Nserv $iNickServ]
}
# ############ MSG Commands Ident ############
bind msg o .ident msgN:ident
bind msg o !ident msgN:ident
proc msgN:ident {nick uhost handle text} {
global botnick i_timer iNickServ
putquick "PRIVMSG $nick :Starting Ident Procedure."
putlog "Started Ident Procedure at the request of $handle"
utimer $i_timer [list findN_Nserv $iNickServ]
}
# ############ Memo Procedure ############
bind notc -|- "*new memo*" i
N
proc i
N {nick uhost handle text dest} {
global botnick i_nick i_read_memos i_delete_memos
if {[string match -nocase "*MemoServ*" "$nick"]} {
if {[isbotnick $i_nick]} {
if {$i_read_memos == "1"} {putquick "PRIVMSG
MEMOSERV@services.dal.net :READ 1,2,3,4,5"}
if {$i_delete_memos == "1"} {utimer 12 [putquick "PRIVMSG
MEMOSERV@services.dal.net :DEL ALL"]}
}
}
return 0
}
############ 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
if {$i_chans == ""} {
putlog "Loaded \[\002R\|Botics\002\] Identification Scr v0.9 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 v0.9 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"
# die "\[\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"
# die "\[\002R\|Botics\002\] NickServ Identification Script \002\[ERROR\] YOU MUST ENTER A PASSWORD\002"
}
######################################################################