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.

dal.net authentication script

Support & discussion of released scripts, and announcements of new releases.
Post Reply
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

dal.net authentication script

Post by CP1832 »

I modified this script I found online to be able to authenticate on dal.net.

Code: Select all

# Keep nick v2.0 by Mezen <mezen0@msn.com>
# This script allows to solve connection issue after receiving
# Invalid Nick notice from the network. It will make the bot release
# its nickname and identify to it.
# This script is made for Dalnet but can be adapted to any other
# network with small modifications
# to install it, just copy it to the folder /path/to/eggdrop/scripts
# then add this line at the end of the eggdrop.conf
# source scripts/keepnick.tcl
#######################################
# Config #
#######################################
# set here bot's password
set KP(botpass) ""

# set here nickserv's hostname
set KP(nickserv) "nickserv@services.dal.net"

#######################################
# Do not edit below this line #
#######################################

# removing old binds
unbind evnt - init-server evnt:init_server

# creating new binds

foreach bind [binds kp_invalid_server_proc] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}
bind evnt - init-server kp_init_server_proc

foreach bind [binds kp_invalid_nick_proc] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}
bind raw - 432 kp_invalid_nick_proc
bind raw - 433 kp_invalid_nick_proc

# saving bot's nick in a variable
set KP(botnick) $nick

proc kp_invalid_nick_proc { from keyword text } {
global nick altnick botnet-nick
set newnick $nick
set chars "abcdefghijkmnopqrstuvwxyz023456789";
set anick $altnick
while {[regexp -all {\?} $anick]>0} {
	set char [string index $chars [expr int(rand()*[string length $chars])]]
	if {[expr rand()]>0.5} {set char [string toupper $char]}
	regsub {\?} $anick $char anick
}
putlog "Alternating Nick: $nick -> $anick"
set nick $anick
if {[string match -nocase ${botnet-nick} $newnick]} {
	putlog "Jumping to next server..."
	jump
    }
}

proc kp_init_server_proc {type} {
global nick KP
putquick "MODE $nick +i-ws"
putserv "PRIVMSG $KP(nickserv) :identify $KP(botnick) $KP(botpass)" -next
putserv "PRIVMSG $KP(nickserv) :release $KP(botnick) $KP(botpass)" -next
putserv "PRIVMSG $KP(nickserv) :ghost $KP(botnick) $KP(botpass)" -next
set nick $KP(botnick)
}

set KP(version) " 2.0"
set KP(script) "KP -- Keep Nick -- "
putlog "\002Loading\002: $KP(script)$KP(version) by Mezen."
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

DALnet is one of the few IRCds that use /watch
It's probably a good idea to use that, as lots of times, due to splits, the bots get confused (as their hostmasks haven't been added to their nickserv access lists *because people like to change vHosts*) so they get changed to Guest?????

This is the best script I've used, for DALnet. It will also send a ghost command, if it's not using set Nickname, and it identifies to your mainnickname, so it doesn't matter what nick the bot connects with (like Guest?????, it will still Identify).

Code: Select all

##############################################
# AutoIdent.tcl

# Name of Service you Identify to (for /watch, so if they come back online, bot will attempt to identify.
set servicesname "NickServ"

# Name of ChanServ
set chanservicename "ChanServ@services.dal.net"

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

# Set the next line as your bot's Nickname to identify to.
set mynick "BotNickname"

# Set the next line as your bot's password on NickServ.
set nickserv_pass "nickpasshere"

############################################################################################## DO NOT EDIT BELOW THIS LINE!! ##############################################################################################


#################
# BINDS #
#################
bind raw - 601 services_offline
bind raw - 605 services_offline
bind raw - 604 services_online
bind raw - 600 services_online
bind evnt - init-server check_ghost

#################
# PROCEDURES #
#################
proc check_ghost {type} {
    if {![isbotnick $::mynick]} {putquick "PRIVMSG $::nickservicename :GHOST $::mynick $::nickserv_pass" -next}
    putquick "PRIVMSG $::nickservicename :identify $::mynick $::nickserv_pass"; 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"
}

putlog "AutoIdent, enabling watch.. (for $servicesname)"
putserv "watch +$servicesname"
There are probably a few thousand scripts like this, made for bots to identify, but the one that is inside your bot.conf file, that is the easiest and fastest method. You could even add a public/message command, to the code I posted above, and it would make it just that much better :P
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Post Reply