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.

identifying nicks

Old posts that have not been replied to for several years.
Locked
User avatar
CooLB0Y
Voice
Posts: 29
Joined: Fri Mar 26, 2004 2:06 pm
Location: Australia

identifying nicks

Post by CooLB0Y »

hello,i want to ask if its possible to make a tcl that keeps the eggy to identify several nicks every 10 days?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Code: Select all

#De Kus' RnS-Guest script

set rnsgpass "PASS"
set rnsgnotify "OWNER"

bind time - "00 06 ?2*" rnsg:hold
bind pub m|m !recover rnsg:recover
catch {unbind notc f|- "*" rnsg:recover:cb}

proc rnsg:hold {m h d mo y} {
	set nick "RnS-Guest"
	set sock [socket irc.de.euirc.net 6667]
	if { [fconfigure $sock -error] != "" } {
		timer 1 [list rnsg:hold [expr $m + 1] $h $d $mo $y]]
		putlog "RnS-Guest.tcl: Verbindung fehlgeschlagen, versuche es gleich nochmal."
		return 0
	}
	puts $sock "NICK RnS-Guest"
	puts $sock "PASS $::rnsgpass"
	puts $sock "USER guesthold . . :der geschützte Gastnick für den RnS JavaChat"
	flush $sock
	while { [lindex [split [gets $sock] :] 1] == "Nickname is already in use." } {
		puts $sock "NICK [set nick \"RnS-Guest[rand 99]\"]"
		flush $sock
	}
	gets $sock line
	set lines "$line\n"
	set reply [lindex [split $line :] 1]
	puts $sock "PONG :$reply"
	puts $sock "NOTICE $reply :VERSION ${::ctcp-version}"
	puts $sock "MODE $nick +B"
	flush $sock
	while { [set line [gets $sock]] != ":$nick MODE $nick :+B" && ![eof $sock] } {
		append lines "$line\n"
	}
	if { $nick != "RnS-Guest" } {
		puthelp "PRIVMSG #rns :RnS-Guest: Es tut mir leid, dass dich stören musste, aber ich brauche Nick 2mal im Monat diesen Nick für 1 Sekunde. Du kannst ihn jetzt wieder haben."
		puts $sock "$::nickservmask :RECOVER RnS-Guest $::rnsgpass"
		flush $sock
		append lines "[gets $sock]\n"
		puts $sock "$::nickservmask :RELEASE RnS-Guest $::rnsgpass"
		flush $sock
		append lines "[gets $sock]\n"
		puts $sock "NICK RnS-Guest"
		flush $sock
		append lines "[gets $sock]\n"
		puts $sock "$::nickservmask :IDENTIFY $::rnsgpass"
		flush $sock
		append lines "[gets $sock]\n"
	}
	puts $sock "QUIT :thats all I wanted"
	flush $sock
	close $sock
	if { [string match "*Passwort akzeptiert*" $lines] } {
		putlog "RnS-Guest.tcl: Nick erfolgreich identifiziert"
	} else {
		putserv "PRIVMSG [hand2nick $::rnsgnotify]:Nick RnS-Guest nicht erfolgreich identifiziert. Schreibe error Log..."
		putlog "RnS-Guest.tcl: Nick nicht erfolgreich identifiziert. Schreibe error Log..."
		set fd [open logs/rnsg_error.log w]
			puts -nonewline $fd $lines
		close $fd
	}
	return 0
}

proc rnsg:recover {nick uhost hand chan text} {
	if { [string equal -nocase $chan "#rns"] && [string equal -nocase $text "RnS-Guest"] } {
		putquick "$::nickservmask :RECOVER RnS-Guest $::rnsgpass"
		set ::rnsglastnick $nick
		bind notc f|- "*" rnsg:recover:cb
		bind nick - "*" rnsg:sorry
		timer 2 [list catch {unbind notc f|- "*" rnsg:recover:cb}]
		timer 2 [list catch {unbind nick - "*" rnsg:sorry}]
		return 1
	}
	return 0
}

proc rnsg:recover:cb {nick uhost hand text dest} {
	if { $hand == "nickserv" } {
		puthelp "NOTICE $::rnsglastnick :NickServ antwortete: $text"
		catch {unbind notc f|- "*" rnsg:recover:cb}
		if { $text == "User claiming your nick has been killed." } {
			putserv "$::nickservmask :RELEASE RnS-Guest $::rnsgpass"
			puthelp "NOTICE $::rnsglastnick :Release Chatname wieder..."
		}
	}
	return 0
}

proc rnsg:sorry {nick uhost hand chan newnick} {
	if { [string equal -nocase $nick RnS-Guest] } {
		puthelp "NOTICE $newnick :Es tut mir leid, $::rnsglastnick veranlasste den allgemeinen Java-Chat Nick von RnS freizugeben. Dies geschah wahrscheinlich, weil du ihn zu lange ohne ersichtlichen Grund benutzt hattest."
		puthelp "NOTICE $newnick :Es ist dir freigestellt einen neuen Nick zu wählen. Wenn dich der Java-Client nicht ohnehin dazu auffordert kannst du dies mit \"/nick <neuernick>\" machen (ohne die Anführungszeichen)."
		catch {unbind nick - "*" rnsg:sorry}
	}
	return 0
}
I never inted the script to work for other nicks, so you probably best replace "RnS-Guest" with whatever nick you like in the wohle script. Perhaps someone else changes to use a global variable ^-^.

the time bind triggers on each 2nd, 12th and 22th of the month.
the public trigger can be used to use the nickserv command "RECOVER" on the nick (doesnt require the 2nd connection) to give it free.

I hope you can figure out the German lines within the context of the procedure structures ^-^.

NOTE: this script opens an second temporare IRC connection which could be against the rules of your IRC network or your shell account. You are all responsible yourself using this script!

PS: the script uses the forward of serverpass to nickserv (because it was not intented to be used on other networks ^^), so networks not supporting this have to send the password to nickserv after the login.

Don't forget to replace the IRC server domain name in the socket expression :D

there must be a global var called "nickservmask" which should be "nickserv" or "privmsg nickserv".
ctcp-version must not be unset and should contain a valid version accept by the server if requested.

The login sequenze may not work for non net-type 5 networks.
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...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Why need such a long code for the bot to identify to 10 nicks every day? Just make a simple proc, and continuous make it execute after 240hrs (10 days); only 2 timers needed or just make it execute on the 1st, 11th, 21st of every month, through bind time.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
CooLB0Y
Voice
Posts: 29
Joined: Fri Mar 26, 2004 2:06 pm
Location: Australia

Post by CooLB0Y »

there is no other way that it doesnt uses other connection i want the bot like used .dump nickserv identify nick passwd i,the same bot identifies.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

You cannot identify a nick you are not currently having (at least no nickserv I met until now supported that).
you have to change the nick, capture if its in use, then either identify it, or recover, release and retry and finally indentify (note, we have to change the bots primary nick, otherwise the hardcoded keep-primary nick will change us back before we identified), then we have to change back, we haev to be prepaired some idiots took our and might have to ghost it, then we need to reidentify the bot nick... so you see... its almost the same work, so since I dont have restrictions on connections I took way, if you need another, maybe someone else has something or codes something.
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...
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

De Kus wrote:You cannot identify a nick you are not currently having (at least no nickserv I met until now supported that).
heh... try "/ns help identify" on euirc ;)
-NickServ- If you provide a nickname, you will be identified for this
-NickServ- nick, including vhost and autojoin.
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
Locked