This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bot identify

Old posts that have not been replied to for several years.
Locked
User avatar
mematrix
Voice
Posts: 29
Joined: Sat Aug 07, 2004 5:44 pm

bot identify

Post by mematrix »

hey, i'm trying to recode the DalNet bot ident script so it can work on other irc servers. for some reason it's not working, does anyone see any errors in the script, case the bot isn't giving me any :-?

Code: Select all

# This script will identify your bot once received the notice that nick is
# owned by someone else from NickServ.
#
# We can also use this script if the bot's need to be an op, unban & invite.
# To do this, set your channel like the given example below:
#
# .chanset #lamestchan need-op chanserv #lamestchan op
# .chanset #lamestchan need-invite chanserv #lamestchan invite
# .chanset #lamestchan need-unban chanserv #lamestchan unban
# Note: Don't set your channel like that if you don't have access on the channel
#
# (C) 2002 - SparkCom, Spark Computer Technology
# Any suggestion or comment email me at sparkcom@sparkcom.eu.org


# [0/1] To let us know that bot is unidentified, then send ident request.
set is_identified 0

# [0/1] To show that identifying is in progress to stop multiple request. 
# it will help to prevent flooding to NickServ
set identifying 0

# If in case that NickServ didn't reply for a certain period of time we will
# resend ident requests and continue until the bot identified
# (must be in minutes).
set nickserv_time 10

# The bot's registered nick to NickServ also the bot's nick.
set eggnick "XBot"

# The bot's nick password to NickServ
set nickpass "*****"

# [0/1] To let us know if ChanServ is responding or not, to wait for the
# action before sending another request. 
set chanserv_success 0

# Duration in minutes before turning chanserv_success to 1 thus enabling us
# to send another request.
set chanserv_time 10

############################################################################
# PLEASE DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING !!! #
############################## Script Begin ################################

# Now, we recieved the notice. We will turn off the is_identified to
# wait the "Password accepted" reply before sending a service requests
# to ChanServ.
proc nickserv { nick uhost hand chan text } {
global nickpass botnick eggnick is_identified identifying chanserv_success nickserv_time
   if { $identifying == 0 } {
     set is_identified 0
     set chanserv_success 0
     if { $botnick == $eggnick } {
        set identifying 1
        timer $nickserv_time nickserv_reset
        putserv "PRIVMSG NickServ@services@3dbuzz.com :identify $nickpass"
        }
   }
} 

# Now the bot received the notice that password is accepted. 
# Right here, we will turn off identifying variable as a preparation for
# the next ident request and since we are now identified we will turn the
# memory variable is_identified and chanserv_success to on.
proc pass_accepted { nick uhost hand chan text } {
global is_identified identifying chanserv_success
    set nickservTimerID [timerexists nickserv_reset]
    set identifying 0
    set is_identified 1
    set chanserv_success 1
    if { $nickservTimerID != "" } {	
       killtimer $nickservTimerID
    }
}

# Reset the variables to an initial value after timer expires.
proc nickserv_reset {} {
global is_identified identifying chanserv_success
    set identifying 0
    set is_identified 0
    set chanserv_success 0
    nickserv "" "" "" "" ""
}

# Send op, unban & invite request to ChanServ.
proc chanserv {where what} {
global botnick is_identified chanserv_success chanserv_time 
    if { ($is_identified == 1) && ($chanserv_success == 1) } {
       set chanserv_success 0
       timer $chanserv_time chanserv_reset
       putserv "PRIVMSG ChanServ@services@3dbuzz.com :$what $where $botnick"
    } 
} 

# This procedure will verify if ChanServ is responding to the service requests.
# It will help if ChanServ is lagged, thus preventing multiple requests.
proc mode_proc {nick uhost hand chan mc {victim ""}} {
global botnick chanserv_success
   if {(($nick == "ChanServ") && ($victim == $botnick) && (($mc == "+o") || ($mc == "-b" )))}  {
        set chanservTimerID [timerexists chanserv_reset]
        set chanserv_success 1
        if { $chanservTimerID != "" } {	
           killtimer $chanservTimerID
        }
   }
}

# This procedure will call after the chanserv_timer expires
proc chanserv_reset {} {
   global chanserv_success
   set chanserv_success 1
}

# The following are those tcl binds for this script. 
bind notc - "*This nick is owned by someone else*" nickserv
bind notc - "*Password accepted*" pass_accepted
bind mode - * mode_proc

putlog " * Loaded [file tail [info script]] successfully."

# Script Written by Rey C. Geroleo - Jan. 07, 2002
# Script modified by mematrix (mematrix@gmail.com) for SQL, and XBot on the 3dbuzz IRC server (irc.3dbuzz.com)
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

you will need to alter a few lines in the bit below don't edit anything below here.

you will need to know exactly what nickserv sends to when you are using a registered nick.

Code: Select all

# The following are those tcl binds for this script. 
bind notc - "*This nick is owned by someone else*" nickserv 
bind notc - "*Password accepted*" pass_accepted 
bind mode - * mode_proc 
that may not be exactly the format of what nickserv says... and i may not ask you this in a notice... it may be a msg.....


ChanServ@services@3dbuzz.com could just say Chanserv and same for nickserv.

i'm not that good at tcl but that should work... i'm sure there are more inteeligent people here who will help but in the meantime try all that
User avatar
mematrix
Voice
Posts: 29
Joined: Sat Aug 07, 2004 5:44 pm

Post by mematrix »

what do you mean exactly? are you talking about what Nickserv says when you use a reggistered nick? if so, i got this from the bot's DCC when i did a .restart
[17:53:29] [XBot] [19:10] -NickServ (services@3dbuzz.com)- This nickname is registered and protected. If it is your
[17:53:29] [XBot] [19:10] -NickServ (services@3dbuzz.com)- nick, type /msg NickServ IDENTIFY password. Otherwise,
[17:53:29] [XBot] [19:10] -NickServ (services@3dbuzz.com)- please choose a different nick.
[17:53:31] [XBot] [19:10] XBot joined #pdf.
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

Code: Select all

bind evnt - * init-server evnt:init_serv

proc evnt:init_serv {type} {
 global botnick
  putserv "MODE $botnick +i-sw"; putserv "PRIVMSG Nickserv : ur_id_msg"
}
too simple of a solution, or what? :mrgreen:
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

why the hell didn't i think of that last year when i spent weeks trying to make mine work


god dammit i hate you intelligent people... i hadn't had known what i know now i would have been alot happier
:p
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I use an auto identify script that works under Bahamut and UltimateIRCd using 'watch' (not available on all IRCd's); it basically works the same as mIRC's 'On *:NOTIFY' which I find more convenient especially when services go down and return. The bot is identified all the time. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
mematrix
Voice
Posts: 29
Joined: Sat Aug 07, 2004 5:44 pm

Post by mematrix »

YooHoo wrote:

Code: Select all

bind evnt - * init-server evnt:init_serv

proc evnt:init_serv {type} {
 global botnick
  putserv "MODE $botnick +i-sw"; putserv "PRIVMSG Nickserv : ur_id_msg"
}
too simple of a solution, or what? :mrgreen:
hehe ok, i probably did it wrong or something but this is what i did:

Code: Select all

# This script will identify your bot once received the notice that nick is
# owned by someone else from NickServ.
#
# We can also use this script if the bot's need to be an op, unban & invite.
# To do this, set your channel like the given example below:
#
# .chanset #lamestchan need-op chanserv #lamestchan op
# .chanset #lamestchan need-invite chanserv #lamestchan invite
# .chanset #lamestchan need-unban chanserv #lamestchan unban
# Note: Don't set your channel like that if you don't have access on the channel
#
# (C) 2002 - SparkCom, Spark Computer Technology
# Any suggestion or comment email me at sparkcom@sparkcom.eu.org


# [0/1] To let us know that bot is unidentified, then send ident request.
set is_identified 0

# [0/1] To show that identifying is in progress to stop multiple request. 
# it will help to prevent flooding to NickServ
set identifying 0

# If in case that NickServ didn't reply for a certain period of time we will
# resend ident requests and continue until the bot identified
# (must be in minutes).
set nickserv_time 10

# The bot's registered nick to NickServ also the bot's nick.
set eggnick "XBot"

# The bot's nick password to NickServ
set nickpass "drpibb"

# [0/1] To let us know if ChanServ is responding or not, to wait for the
# action before sending another request. 
set chanserv_success 0

# Duration in minutes before turning chanserv_success to 1 thus enabling us
# to send another request.
set chanserv_time 10

############################################################################
# PLEASE DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING !!! #
############################## Script Begin ################################

# Now, we recieved the notice. We will turn off the is_identified to
# wait the "Password accepted" reply before sending a service requests
# to ChanServ.
proc nickserv { nick uhost hand chan text } {
global nickpass botnick eggnick is_identified identifying chanserv_success nickserv_time
   if { $identifying == 0 } {
     set is_identified 0
     set chanserv_success 0
     if { $botnick == $eggnick } {
        set identifying 1
        timer $nickserv_time nickserv_reset
        putserv "PRIVMSG NickServ@services@3dbuzz.com :identify $nickpass"
        }
   }
} 

# Now the bot received the notice that password is accepted. 
# Right here, we will turn off identifying variable as a preparation for
# the next ident request and since we are now identified we will turn the
# memory variable is_identified and chanserv_success to on.
proc pass_accepted { nick uhost hand chan text } {
global is_identified identifying chanserv_success
    set nickservTimerID [timerexists nickserv_reset]
    set identifying 0
    set is_identified 1
    set chanserv_success 1
    if { $nickservTimerID != "" } {	
       killtimer $nickservTimerID
    }
}

# Reset the variables to an initial value after timer expires.
proc nickserv_reset {} {
global is_identified identifying chanserv_success
    set identifying 0
    set is_identified 0
    set chanserv_success 0
    nickserv "" "" "" "" ""
}

# Send op, unban & invite request to ChanServ.
proc chanserv {where what} {
global botnick is_identified chanserv_success chanserv_time 
    if { ($is_identified == 1) && ($chanserv_success == 1) } {
       set chanserv_success 0
       timer $chanserv_time chanserv_reset
       putserv "PRIVMSG ChanServ@services@3dbuzz.com :$what $where $botnick"
    } 
} 

# This procedure will verify if ChanServ is responding to the service requests.
# It will help if ChanServ is lagged, thus preventing multiple requests.
proc mode_proc {nick uhost hand chan mc {victim ""}} {
global botnick chanserv_success
   if {(($nick == "ChanServ") && ($victim == $botnick) && (($mc == "+o") || ($mc == "-b" )))}  {
        set chanservTimerID [timerexists chanserv_reset]
        set chanserv_success 1
        if { $chanservTimerID != "" } {	
           killtimer $chanservTimerID
        }
   }
}

# This procedure will call after the chanserv_timer expires
proc chanserv_reset {} {
   global chanserv_success
   set chanserv_success 1
}

# The following are those tcl binds for this script. 
bind notc - "*This nick is owned by someone else*" nickserv
bind notc - "*Password accepted*" pass_accepted
bind mode - * mode_proc
bind evnt - * init-server evnt:init_serv

proc evnt:init_serv {type} {
 global botnick
  putserv "MODE $botnick +i-sw"; putserv "PRIVMSG Nickserv : ur_id_msg"
}

putlog " * Loaded [file tail [info script]] successfully."

# Script Written by Rey C. Geroleo - Jan. 07, 2002
# Script modified by mematrix (mematrix@gmail.com) for SQL, and XBot on the 3dbuzz IRC server (irc.3dbuzz.com)
and this is what i got when i did a .restart:

Code: Select all

[17:46:45] [XBot] [19:04] Tcl error in file 'XBot.conf':
[17:46:45] [XBot] [19:04] wrong # args: should be "bind type flags cmd/mask ?procname?"
[17:46:45] [XBot] while executing
[17:46:45] [XBot] "bind evnt - * init-server evnt:init_serv"
[17:46:45] [XBot] (file "scripts/botident.tcl" line 119)
[17:46:45] [XBot] invoked from within
[17:46:45] [XBot] "source scripts/botident.tcl"
[17:46:45] [XBot] (file "XBot.conf" line 122)
[17:46:45] [XBot] [19:04] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
DCC session closed
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

I made a mistake in the bind, it should read like this:

Code: Select all

bind evnt - init-server evnt:init_server
You have to modify this procedure for your bot. Replace 'ur_id_msg' with your networks id syntax...

Code: Select all

bind evnt - init-server evnt:init_server
proc evnt:init_server {type} {
global botnick
 putserv "MODE $botnick +iw-sv"; putserv "PRIVMSG Nickserv :ur_id_msg"
}
Open up the default eggdrop.conf that came with your bot and read it. :mrgreen:
User avatar
mematrix
Voice
Posts: 29
Joined: Sat Aug 07, 2004 5:44 pm

Post by mematrix »

*sigh* ok, it isn't even running the script it loads it, but it isn't executed. ok, so new question. could you do something like this

Code: Select all

PRIVMSG nickserv identify pass
in a .tcl file and it execute that command? i'm not sure but is that the equivilent of doing a ".msg nickserv identify pass" in dcc chat?
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

mematrix wrote:*sigh* ok, it isn't even running the script it loads it, but it isn't executed. ok, so new question. could you do something like this

Code: Select all

PRIVMSG nickserv identify pass
in a .tcl file and it execute that command? i'm not sure but is that the equivilent of doing a ".msg nickserv identify pass" in dcc chat?
This is exactly what I have been :-? attempting to show you. I don't know what version egg you have, but a quick check at egghead's uptime showed me it's most likely v.1.6.1x, so this all will apply to you directly.
There are a few settings in the server module you need/should set appropriately, one of which is set init-server. This information is located in the ~/doc directory of every eggdrop distributed... there is an 'online' version available here as well.

Code: Select all

bind evnt - init-server evnt:init_server
   proc evnt:init_server {type} {
     global botnick
     putquick "MODE $botnick +i-ws"
   }
This is a Tcl script to be run immediately after connecting to a server. The same thing can be done by using the 'init-server' variable:

Code: Select all

set init-server { putquick "MODE $botnick +i-ws" }
This is a Tcl script to be run immediately after connecting to a server.
It is limited to 120 characters, and is depriciated due to the EVNT bind
(see doc/tcl-commands.doc).[/code]You can modify this to suit your needs. Here it is on a silver platter, mematrix... don't say I never gave you nothin'! :mrgreen:

Code: Select all

##SET THIS TO YOUR PASSWORD HOMER ##
set mypassword "this_is_my_password"

bind evnt - init-server evnt:init_server
   proc evnt:init_server {type} {
     global botnick
     putquick "MODE $botnick +i-ws"
     putserv "PRIVMSG Nickserv :IDENTIFY $mypassword"
   }
There ya go, simply replace "this_is_my_password" with your bot's desired password, copy this to your conf file, remove the other identifying script, rehash your bot, and presto, magico, problem solved. Now this means you owe me a beer :mrgreen:
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

YooHoo wrote:
mematrix wrote:*sigh* ok, it isn't even running the script it loads it, but it isn't executed. ok, so new question. could you do something like this

Code: Select all

PRIVMSG nickserv identify pass
in a .tcl file and it execute that command? i'm not sure but is that the equivilent of doing a ".msg nickserv identify pass" in dcc chat?
This is exactly what I have been :-? attempting to show you. I don't know what version egg you have, but a quick check at egghead's uptime showed me it's most likely v.1.6.1x, so this all will apply to you directly.
There are a few settings in the server module you need/should set appropriately, one of which is set init-server. This information is located in the ~/doc directory of every eggdrop distributed... there is an 'online' version available here as well.

Code: Select all

bind evnt - init-server evnt:init_server
   proc evnt:init_server {type} {
     global botnick
     putquick "MODE $botnick +i-ws"
   }
This is a Tcl script to be run immediately after connecting to a server. The same thing can be done by using the 'init-server' variable:

Code: Select all

set init-server { putquick "MODE $botnick +i-ws" }
This is a Tcl script to be run immediately after connecting to a server.
It is limited to 120 characters, and is depriciated due to the EVNT bind
(see doc/tcl-commands.doc).[/code]You can modify this to suit your needs. Here it is on a silver platter, mematrix... don't say I never gave you nothin'! :mrgreen:

Code: Select all

##SET THIS TO YOUR PASSWORD HOMER ##
set mypassword "this_is_my_password"

bind evnt - init-server evnt:init_server
   proc evnt:init_server {type} {
     global botnick
     putquick "MODE $botnick +i-ws"
     putserv "PRIVMSG Nickserv :IDENTIFY $mypassword"
   }
There ya go, simply replace "this_is_my_password" with your bot's desired password, copy this to your conf file, remove the other identifying script, rehash your bot, and presto, magico, problem solved. Now this means you owe me a beer :mrgreen:
You forgot to make mypassword variable global ;)
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

]Kami[ wrote:You forgot to make mypassword variable global ;)
:o hahaha all too right mate, all too right. That's what I get for not showing him what I personally do in my conf file; defining the variables that change from bot to bot at the beginning of my conf file, which looks something like this:

Code: Select all

set mynet "irc.austnet.org"
set myhomechan "#Adult_Flirt_Trivia"
set mycserv "ChanOp"
set mynserv "nickop@austnet.org"
set mypasswd "sup3r_s3cr3t_passW3rd"
set myidmsg "IDENTIFY $mypasswd"

##  Here are the server mod variables:

bind evnt - init-server evnt:init_server
proc evnt:init_server {type} {
global botnick mynserv myidmsg
 putserv "MODE $botnick +iw-sv"
 putserv "PRIVMSG $mynserv :$myidmsg"
}

bind evnt - connect-server evnt:connect_server
proc evnt:connect_server {type} {
global botnick mynserv myidmsg
 putserv "MODE $botnick +iw-sv"
 putserv "PRIVMSG $mynserv :$myidmsg"
}
Thanks ]Kami[ :wink:
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

You could try this option by creating a new TCL file for the bot to load:

Code: Select all

# name: autoident.tcl
# NOTE: uses Bahamut (DALnets ircd) specific features (watch),
# won't work on other ircds that dont support them.

# Name of one part of Services (e.g. NickServ, ChanServ)
# (or any other nick)
set servicesname "NickServ"

# Name of NickServ
set nickservicename "NickServ@services.dal.net"

# Set the next line as your bot's nick to identify to
set mynick "BotNick"

# Set the next line as your bot's password on nickserv
set nickserv_pass "nickpass"

## Don't change below this.

bind raw - 601 services_offline
bind raw - 605 services_offline
bind raw - 604 services_online
bind raw - 600 services_online

bind evnt - init-server dowatch

proc dowatch { type } {
putserv "watch +$::servicesname"
}

proc services_offline { from keyword args } {
 putlog "Services have left the building!"
}

proc services_online { from keyword args } {
 putserv "PRIVMSG $::nickservicename :identify $::mynick $::nickserv_pass"
 putlog "Identified to $::servicesname"
}

bind dcc o identify manual_identify

proc manual_identify {hand idx mascara} {
 putserv "PRIVMSG $::nickservicename :identify $::nickserv_pass"   
 putlog "Identifying manually for nick \002\[$::botnick\]\002"
}

putlog "AutoIdent, enabling watch.. (for $servicesname)"
putserv "watch +$servicesname"
putlog "AutoIdent loaded."
The above works with UltimateIRCd. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked