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.

Event driven nickserv handler

Old posts that have not been replied to for several years.
Locked
r
rtfmoz

Event driven nickserv handler

Post by rtfmoz »

This is making my hair go grey.

No idea why I get the following Tcl error ...

[17:20] Nickservices started
[17:20] Channels set inactive
[17:20] Nickservices finished
[17:20] (irc.homelan.com claims to be irc2.homelan.com; updating server list)
[17:20] Tcl error [ident_nick]: called "ident_nick" with too many arguments
[17:20] -NickServ (services@homelan.com)- This nickname is registered and protected. If it is your
[17:20] -NickServ (services@homelan.com)- nick, type /msg NickServ IDENTIFY password. Otherwise,
[17:20] -NickServ (services@homelan.com)- please choose a different nick.

Script is in next message...
Last edited by rtfmoz on Fri Aug 23, 2002 11:30 am, edited 1 time in total.
r
rtfmoz

Post by rtfmoz »

# nickserv event driven identify script

set nickserv "NickServ"
set chanserv "ChanServ"
set mynick "Bartender"
set mypass "christie"
set recovery 0
set mydebug 1

bind evnt - init-server my-initserver
bind notc - "*nickname is registered*" ident_nick
bind notc - "*password accepted*" authsuccess
bind raw - 436 { set recovery 1 }
bind need - "% op" needop

proc my-initserver {type} {
nickservices
}


proc nickservices {} {
global mydebug passauth channels recovery
if {$mydebug} { putlog "Nickservices started" }

# turn channels off until ident complete
chanoff
if {$recovery} { recovernick }

# ok we are done :)
if {$mydebug} { putlog "Nickservices finished" }
}

proc authsuccess {} {
global mydebug
if {$mydebug} { putlog "Authenticaion Success" }

# turn channels back on
chanon

unbind notc - "password accepted" authsuccess
unbind notc - "please choose a different nick" identnick
unbind raw - 436 { set recovery 1 }
}


# turn all channels on
proc chanon {} {
global mydebug channels
if {$mydebug} { putlog "Channels set active" }
foreach ch [channels] {
channel set $ch -inactive
}
}

# turn all channels off
proc chanoff {} {
global mydebug channels
if {$mydebug} { putlog "Channels set inactive" }
foreach ch [channels] {
channel set $ch +inactive
}
}

proc recovernick {} {
global mydebug mynick mypass nick nickserv
if {$mydebug} { putlog "Recovering nick" }
bind notc - "RELEASE $mynick" releasenick
putserv "PRIVMSG $nickserv RECOVER $mynick $mypass"
}

proc releasenick {} {
global mydebug mynick mypass nick nickserv
if {$mydebug} { putlog "Releasing nick" }
unbind notc - "RELEASE $mynick" releasenick
bind notc - "your nick has been released" revertnick
putserv "PRIVMSG $nickserv RELEASE $mynick $mypass"
}

proc revertnick {} {
global mydebug nick mynick
if {$mydebug} { putlog "Reverting nick" }
unbind notc - "your nick has been released" revertnick
set nick mynick
}

proc ident_nick {} {
global mydebug nickserv mypass
if {$mydebug} { putlog "Identify myself" }
putserv "PRIVMSG $nickserv IDENTIFY $mypass"
}

proc needop {channel type} {
global mydebug chanserv nick
if {$mydebug} { putlog "I need ops" }
putserv "PRIVMSG $chanserv OP $channel $nick"
}
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Post by spyda »

putserv <text> [options]
Description: sends text to the server, like '.dump' (intended for direct
server commands); output is queued so that the bot won't flood itself
off the server.
Options: -next: push messages to the front of the queue
Returns: nothing
Module: server

puthelp <text> [options]
Description: sends text to the server, like 'putserv', but it uses a
different queue intended for sending messages to channels or people.
Options: -next: push messages to the front of the queue
Returns: nothing
Module: server
You need to fix up the prefix of it:

Code: Select all

bind MSG m|m kick asus_kick
proc asus_kick {nick uhost hand vasus} {
 global botnick
 if {$vasus == ""} {
  puthelp "NOTICE $nick :Where is the chan??"
  puthelp "NOTICE $nick :Usage: /msg $botnick kick <chan> <who>"
  return
  } else {
  set asus_who [lindex $vasus 2]
  puthelp "NOTICE $nick :Kicked $asus_who from [lindex $vasus 1]"
  putserv "KICK $asus_who :Ban by $nick"
  return 0
 }
}
Hope that helps you out...
------------------------------
r
rtfmoz

Post by rtfmoz »

Man, I shoud learn to read ...

But, I was tired after 4 hours coding a new language to me...

Thanks

BK :)
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Post by spyda »

That is no problem it happens to the best of people...

Just remember if you cant figure it out! Their is two places to look:

tcl-commands.doc [/home/user/eggdrop/docs]
and
http://dev.scriptics.com/man/

Have fun coding!!

----------
ThePope
r
rtfmoz

Post by rtfmoz »

Well, the script is going well.

It will identify the nick with nickserv and if it not registered then it will register it. If it cannot register it will kill the bot. If the nick is in use it will use nickserv to recover it and then use it. Once I get all these features in place then I will start adapting it for dalnet. Once I have dalnet running you think I would find some testers avail?

Presently I am using it on homelan servers. Is there a reliable way I can tell what server type it is using some server query? eg version et al ? I want to make the script so easy that you put in your nick, email and pass and off she goes. No more nickserv worries ever.

Most of the config is via a set of variables so it wont be that hard.

Regards

BK
Locked