| View previous topic :: View next topic |
| Author |
Message |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Sun Jun 07, 2009 9:42 am Post subject: Common channels |
|
|
Hi all,
I need script which will make my bot to say common channels with some other nick.Should work like .common <nick>
Bot:My common channels with <nick> are: #chan1 #chan2 etc..
Regards,
Darko. |
|
| Back to top |
|
 |
BLaCkShaDoW Op

Joined: 11 Jan 2009 Posts: 115 Location: Romania
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Jun 07, 2009 5:10 pm Post subject: |
|
|
Wow, there is no need to issue a whois to do this, nor is reading raw replies even necessary. Not to mention the huge flaw in that script's display. It won't display them all on one line as the poster suggested.
It has the putserv done incorrectly, for some reason it is within the foreach. This means it will spam so much it's likely if the poster's bot and the nickname share enough common channels the bot will be killed for issuing an excess text flood.
Just use the small script below and remember on partyline to .chanset #yourchan +common after you source it. This will work exactly as the poster has requested. | Code: | setudef flag common
bind pub - .common check:common
proc check:common {nick uhost hand chan text} {
if {![channel get $chan common]} { return }
if {![string length [set n [lindex [split $text] 0]]]} {
puthelp "Usage: .common <nick> - please supply nickname ;P"
return
}
foreach c [channels] {
if {[onchan $n $c]} { lappend common $c }
}
if {[info exists common]} {
puthelp "privmsg $chan :My common channels with $n are: [join $common ", "]."
} else {
puthelp "privmsg $chan :I share no common channels with $n."
}
} |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
DaRkOoO Halfop
Joined: 27 Sep 2008 Posts: 67
|
Posted: Mon Jun 08, 2009 10:01 am Post subject: |
|
|
| Thanks,that script is doing its job very good =) |
|
| Back to top |
|
 |
|