egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

NickServ auto-identify e.g. chanservneed

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
slacker
Voice


Joined: 13 Apr 2006
Posts: 7

PostPosted: Fri Apr 14, 2006 1:19 pm    Post subject: NickServ auto-identify e.g. chanservneed Reply with quote

Hello!
Does anyone has a script for NickServ auto-identify. I have read all the forums and tried almost all the scripts. All came up with error messages.
For example, in chanservneed, I get the error in

set joinbindunban "set bind \"$joinbindunban\""

No such variable joinbindunban

I will really appreaciate a help with a script that actually works. I am using IRCstorm server.

Thanks in advance.

Slacker
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Fri Apr 14, 2006 2:15 pm    Post subject: Reply with quote

Code:
bind evnt - init-server evnt:init_server

proc evnt:init_server {init-server} {
  global botnick
  putquick "MODE $botnick +i"
  putquick "PRIVMSG Nickserv :identify password"
}

Replace 'password' with the correct nickserv password.
Place code in bot's conf file.
Back to top
View user's profile Send private message
slacker
Voice


Joined: 13 Apr 2006
Posts: 7

PostPosted: Fri Apr 14, 2006 3:45 pm    Post subject: Thanks Reply with quote

DragnLord:

Thank yoou sooooooooooooooo much. What you have suggested worked. You have put to an end to one of my nitemares Smile. Does it also work in the cases of a netsplit ?

THANKS AGAIN

Slacker
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Apr 14, 2006 4:57 pm    Post subject: Re: NickServ auto-identify e.g. chanservneed Reply with quote

slacker wrote:
set joinbindunban "set bind \"$joinbindunban\""

No such variable joinbindunban

dont mess with the config of the script. change the values as needed, but dont uncomment/delete them.
first read, then change:
Quote:
# change these only if network uses other strings than these
# the set lines are the bind mask for rejoin


slacker wrote:
Does it also work in the cases of a netsplit ?

of course not. it sends on connect, not on nickserv asking for auth. you hav to bind to a text like shown in the config of my script.

PS: please use the thread of the script, if you have again trouble with my script.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
slacker
Voice


Joined: 13 Apr 2006
Posts: 7

PostPosted: Fri Apr 14, 2006 5:23 pm    Post subject: chanservneed Reply with quote

De Kus:
Thanks for your comment. I have only deleted the Dalnet Part and renamed default to IRCstorm. Here is the script I used, which produced the error I mentioned. Thanks again.
Code:

# change these only if network uses other strings than these
# the set lines are the bind mask for rejoin
switch $network {
   
   Ircstorm {
      bind notc f "*This nickname is registered and protected*" handle:nickneed
      bind notc f "*Password accepted*" handle:nickauthed
      bind notc f "*Ghost with your nick has been killed*" handle:nickchange
      bind notc f "*Your nickname is now being changed to \002Guest*" handle:release
      bind notc m "*Permission denied*" handle:permneed

      set joinbindunban "*You have been unbanned from \002\$channel\002*"
      set releasebind "*Services' hold on your nick has been released*"
      set noreleasebind "*Nick \002$nick\002 isn't being held*"
   }
}

#
# End of configuration
#
bind need - "*" handle:need
bind evnt - init-server handle:serverinit
bind dcc m nsfix handle:nsfix
bind raw - 601 {handle:servwatch 0}
bind raw - 605 {handle:servwatch 0}
bind raw - 604 {handle:servwatch 1}
bind raw - 600 {handle:servwatch 1}
bind raw - 440 {handle:servwatch 0}
bind raw - 403 handle:release2
set nickauthed 0
set serviceson 1
set joinbindunban "set bind \"$joinbindunban\""

proc handle:need {channel need} {
   global botnick chanservmask
   if {$::serviceson && ![string match -nocase Guest* $botnick]} {
      switch $need {
         op {
            if {[matchattr chanserv "|l" $channel]} {
               if {![matchattr chanserv "|o" $channel]} {
                  putquick "$chanservmask :halfop $channel $botnick"
               } else {
                  putquick "$chanservmask :op $channel $botnick" -next
                  if { [matchattr chanserv "|m" $channel] } {
                     putquick "$chanservmask :admin $channel $botnick"
                  }
               }
            }
         }
         unban {
            if {[matchattr chanserv "|m" $channel]} {    #just to stop bot fighting in chans he has "only" op
               putquick "$chanservmask :unban $channel" -next
               eval $::joinbindunban
               bind notc m $bind [list handle:join $channel $bind]
               return 0
            }
         }
         limit  -
         key    -
         invite {
            if {[matchattr chanserv "|o" $channel]} {
               putquick "$chanservmask :invite $channel" -next
            }
         }
      }
   }
   return 0
}

proc handle:join {chan bind nick uhost hand text dest} {
   if { $hand == "chanserv" && $::serviceson } {
      putquick "JOIN :$chan"
      unbind notc m $bind [list handle:join $chan $bind]
   }
   return 0
}

proc handle:nickneed {nick uhost hand text dest} {
   global nickservmask nickpass nickauthed
   if { $hand == "nickserv" && $nickauthed == 0 } {
      set nickauthed 2
      set serviceson 1
      putquick "$nickservmask :IDENTIFY $nickpass" -next
      putlog "chanserv.tcl: \[Status\] sending password to NickServ"
      utimer 20 [list set nickauthed 0]
   }
}

proc handle:permneed {nick uhost hand text dest} {
   global nickservmask nickpass nickauthed
   if { $hand == "chanserv" && $nickauthed == 0 } {
      set nickauthed 2
      set serviceson 1
      putquick "$nickservmask :IDENTIFY $nickpass" -next
      putlog "chanserv.tcl: \[Status\] sending password to NickServ"
      utimer 20 [list set nickauthed 0]
   }
}

proc handle:nickauthed {nick uhost hand text dest} {
   global nickauthed
   if { $hand == "nickserv" } {
      set nickauthed 1
      putlog "NickServ accepted identification."
      foreach timer [utimers] {
         if {[string match {set nickauthed ?} [lindex $timer 1]]} {
            killutimer [lindex $timer 2]
         }
      }
      utimer 120 [list set nickauthed 0]
   }
}

#needed for decrypting password. copy & find proof
#set csnp pass
#set crypt$csnp {55pJp.9fkD0.fc7nD1gMc9d/LjE/r0L57bP/mH3kw.vOCVO1hd12K13WU9/.vx3iG.iTcAQ.}
#unset csnp

proc handle:nickchange {n host h t d} {
   global nick nickauthed
   if { $h == "nickserv" } {
      putquick "NICK $nick" -next
      if { $nickauthed == 1 } {
         bind nick - "*$nick" handle:nickchangeauth
      }
      set nickauthed 0
   }
}

proc handle:nickchangeauth {n host h c nn} {
   global nick nickpass nickservmask
   putquick "$nickservmask :IDENTIFY $nickpass" -next
   set nickauthed 2
   utimer 20 [list set nickauthed 0]
   putlog "chanserv.tcl: \[Status\] sending password to NickServ"
   unbind nick - "*$nick" handle:nickchangeauth
   return 0
}

proc handle:serverinit {type} {
   global nick nickpass nickservmask nickauthed initservpassneeded
   set nickauthed 2
   utimer 20 [list set nickauthed 0]
   if {![isbotnick $nick]} {
      putquick "$nickservmask :GHOST $nick $nickpass" -next
   } elseif { $initservpassneeded } {
      putquick "$nickservmask :IDENTIFY $nickpass" -next
      putlog "chanserv.tcl: \[Status\] sending password to NickServ"
   }
   putserv "WATCH +NickServ +ChanServ"
   return 0
}

proc handle:release {n host h t d} {
   if { $h == "nickserv" } {
      set nickauthed 1
      putquick "$::nickservmask :RELEASE $::nick $::nickpass" -next
      bind notc f $::releasebind handle:deguest
      if {$::noreleasebind != {}} {
         bind notc f $::noreleasebind handle:deguest
      }
   }
   return 0
}

proc handle:release2 {from key text} {
   if { [string equal -nocase $::botnick [lindex [split $text] 1]] } {
      set nickauthed 1
      putquick "$::nickservmask :RELEASE $::nick $::nickpass" -next
      bind notc f $::releasebind handle:deguest
      if {$::noreleasebind != {}} {
         bind notc f $::noreleasebind handle:deguest
      }
   }
   return 0
}

#you can enable that to use an encrypted password in the config part
#Note: dont uncomment it, if you don't trust me and/or your decrypting skills ;)
#eval [decrypt pass $cryptpass]

proc handle:deguest {n host hand text dest} {
   if { $hand == "nickserv" } {
      putquick "NICK $::nick" -next
      unbind notc f $::releasebind handle:deguest
      if {$::noreleasebind != {}} {
         unbind notc f $::noreleasebind handle:deguest
      }
   }
}

proc handle:servwatch {status from keyword arg} {
   if { $keyword == 440 } {
      set ::serviceson $status
   } else {
      set arg [split $arg]
      set nick [lindex $arg 1]
      set uhost "[lindex $arg 2]@[lindex $arg 3]"
      set nickserv [split [lindex [getuser nickserv HOSTS] 0] !]
      set chanserv [split [lindex [getuser chanserv HOSTS] 0] !]
      if { ([string match -nocase [lindex $nickserv 0] $nick] && [string match -nocase [lindex $nickserv 1] $uhost]) || ([string match -nocase [lindex $chanserv 0] $nick] && [string match -nocase [lindex $chanserv 1] $uhost]) } {
         set ::serviceson $status
      }
   }
   return 0
}

proc handle:nsfix {hand idx text} {
   if { $::serviceson || [string match -nocase "*-force*" $text] } {
      set ::serviceson 1
      if { [isbotnick $::nick] } {
         putdcc $idx "Sending auth to NickServ..."
         putquick "$::nickservmask :IDENTIFY $::nickpass"
      } else {
         putdcc $idx "Requesting release of primary nick..."
         uplevel #0 {handle:release n h nickserv t d}
      }
   } else {
      putdcc $idx "I see the Services offline, if you are sure that they are online use -force as argument."
   }
}

putlog "ChanservNeed v1.4.6 loaded"

# Copyright © 2004-2005 De Kus
# This tcl script (ChanservNeed) for the eggdrop IRC bot is
# released under GNU GPL, refer GPL.txt included in the archive.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Please use code tags in future.
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Apr 14, 2006 5:35 pm    Post subject: Reply with quote

obviously your var $network does not contain the same value than you entered. note that switch is case sensitiv. Just dont play with thing you have no idea about:
http://www.tcl.tk/man/tcl8.4/TclCmd/switch.htm
read the parts around default.
If you remove the flexiblity of the switch construct, you can remove it completely, but I am not sure if you even know which braces you have to remove and which not Very Happy.

PS: I doubt an unmodified version gives an error about DALnet (except your var $network starts with a -)
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...


Last edited by De Kus on Fri Apr 14, 2006 6:43 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
slacker
Voice


Joined: 13 Apr 2006
Posts: 7

PostPosted: Fri Apr 14, 2006 5:41 pm    Post subject: Chanservneed Reply with quote

Thanks again De Kus, but thing is, the script doesn't work even if you don't touch anything. In that case, it gives you an error msg about Dalnet part.
Anyway, I won't be using anymore. Thanks Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Apr 14, 2006 7:51 pm    Post subject: Reply with quote

You can remove the switch command and it should work perfectly. Try just:
Code:
bind notc f "*This nickname is registered and protected*" handle:nickneed
bind notc f "*Password accepted*" handle:nickauthed
bind notc f "*Ghost with your nick has been killed*" handle:nickchange
bind notc f "*Your nickname is now being changed to \002Guest*" handle:release
bind notc m "*Permission denied*" handle:permneed

set joinbindunban "*You have been unbanned from \002\$channel\002*"
set releasebind "*Services' hold on your nick has been released*"
set noreleasebind "*Nick \002$nick\002 isn't being held*"

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
slacker
Voice


Joined: 13 Apr 2006
Posts: 7

PostPosted: Sat Apr 15, 2006 1:54 am    Post subject: You are right! Reply with quote

Sir_Fz
You are absolutely right!!! I see no error msg anymore.
Shukren ya ustaz, alla yefta7 3alaik Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 15, 2006 6:14 am    Post subject: Reply with quote

Tekram Smile

Note that, as De Kus told you, if you set network Ircstorm in your eggdrop.conf file then you wouldn't have faced any errors using the script.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber