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 

Common channels

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


Joined: 27 Sep 2008
Posts: 67

PostPosted: Sun Jun 07, 2009 9:42 am    Post subject: Common channels Reply with quote

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
View user's profile Send private message
BLaCkShaDoW
Op


Joined: 11 Jan 2009
Posts: 115
Location: Romania

PostPosted: Sun Jun 07, 2009 2:13 pm    Post subject: Reply with quote

Try it Smile

http://tclscripts.net/common.tcl
_________________
BLaCkShaDoW Production @ WwW.TclScripts.Net
Back to top
View user's profile Send private message Send e-mail Visit poster's website
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Jun 07, 2009 5:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
DaRkOoO
Halfop


Joined: 27 Sep 2008
Posts: 67

PostPosted: Mon Jun 08, 2009 10:01 am    Post subject: Reply with quote

Thanks,that script is doing its job very good =)
Back to top
View user's profile Send private message
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