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.

Anope, Eggdrop and Global Notices

Old posts that have not been replied to for several years.
Locked
K
KevKev
Halfop
Posts: 67
Joined: Fri Oct 03, 2003 5:15 am

Anope, Eggdrop and Global Notices

Post by KevKev »

I'm trying to capture global notices from anope with a tcl in my eggdrop bot.

I have been completely unsucessful so far. Here are the bindings and procs that i have tried. Any help in pointing me in teh right direction would be helpful.
Thanks!

Code: Select all

bind raw - NOTICE raw:notice:parse
bind raw - *Global* raw:notice:parse
bind raw - Global raw:notice:parse
bind raw - NOTICE* raw:notice:parse
proc raw:notice:parse {from keyword text} {
	#if {![string match {*!*@*} $from]} {
	#	putlog "Server notice from ${from}: $text"
	#} else {
	#	putlog "Non-Server Notice from ${from}: $text"
	#}
	putlog "raw notice parse called with notice from ${from}: $text"
	return 0
}
bind NOTC - * notcparse
proc notcparse {nick uhost hand text {dest ""}} {
	global botnick
	putlog "notcparse called... From $nick: $text"
	if {$dest == ""} {
		set dest $botnick
	putlog "notice came direct to bot"
	}
}
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

here's a source of one of my tcl.
The eggdrop binds the server notices and if it's a connection, then performs a /version.
Sure, it binds the version reply too.
Hope it'll help you.

Code: Select all

bind raw - NOTICE client:connect
bind ctcr - VERSION client:version

set versions "./versions.txt"

proc client:connect {from word text} {
	global botnick
	if {[string first "connecting" $text] > 0} {
		putlog $text
		set b_nick [string first ": " $text]
		incr b_nick 2
		set e_nick [string first " (" $text $b_nick]
		incr e_nick -1
		set victim [string range $text $b_nick $e_nick]
		if { $botnick == $victim } {
			return 0
		} else {
			puthelp "PRIVMSG $victim :\001VERSION\001"
			return 0
		}
	} else {
		return 0
	}
}

proc client:version {nick uhost handle dest key text} {
	global botnick versions
	if {$dest == ""} {set dest $botnick}
	set fi [open $versions a]
	puts $fi $text
	close $fi
	return 1
}
K
KevKev
Halfop
Posts: 67
Joined: Fri Oct 03, 2003 5:15 am

Post by KevKev »

For no apparent reason the raw notice bind worked today when i sent a global ::shrugs:: Either i was completely insane yesterday or somethign odd was happening.

Thanks for the input.
K
KnightHawk
Voice
Posts: 13
Joined: Sun Jul 13, 2003 1:07 pm

Post by KnightHawk »

CrazyCat...... i am curious, what part exactly in the client:connect pulls the ctcp info, cause i have unbound the other proc ( the version proc, but it still pulls it.

Reason i ask, is cause u have helped me to get a raw bind on mine working that i have been trying to figure out for weeks, but my server prolly uses a diff format for the info, and i am hoping to extract other pieces of info than a version, mainly just nick from all users that connect to the server ( for oper reasons)
K
KnightHawk
Voice
Posts: 13
Joined: Sun Jul 13, 2003 1:07 pm

amendmant to previous post

Post by KnightHawk »

guess i shoulve mentioned i use Anope-1.6.2 , and the bot is opered, (unreal-icrd-rc final). Eggdrop version is 1.6.15, tcl version is either 8.3 or 8.4, not sure which.
Locked