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 

on whois msg chan

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


Joined: 01 Sep 2007
Posts: 41

PostPosted: Sat Jun 14, 2008 2:35 pm    Post subject: on whois msg chan Reply with quote

hi

I need script whick will msg chan setted in script when someone do whois on eggdrop

snotice is in format

Code:
-irc.local.net- *** nick (ident@host) did a /whois on you.


And after receiving whois notice, PRIVMSG chan in format

nick (ident@host) just did a /whois on me.

Regards
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Jun 14, 2008 3:26 pm    Post subject: Reply with quote

Try it:
Code:
set wchan #yourchan
bind notc - * wproc
proc wproc {nick uhost hand text dest} {
global wchan
    if {[regexp {(.*?) did a /whois.*?} $text - wwho]} {
        putserv "PRIVMSG $wchan :$wwho just did a /whois on me."
    }
}

Such scripts better to write using RAW.
_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
opsb
Halfop


Joined: 01 Sep 2007
Posts: 41

PostPosted: Sat Jun 14, 2008 6:19 pm    Post subject: Reply with quote

thnx for trying but not working for me Sad
Back to top
View user's profile Send private message
speechles
Revered One


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

PostPosted: Sat Jun 14, 2008 9:29 pm    Post subject: Reply with quote

Code:
set wchan "#yourchan"

bind notc - * wproc

proc wproc {nick uhost hand text {dest ""} } {
   if {($dest == "" || [isbotnick $dest]) && [regexp {(.+?)\sdid a /whois} $text -> wwho]} {
      putserv "PRIVMSG $::wchan :$wwho just did a /whois on me."
   }
}

Greedy matching is needed in cases like this (.+? vs .*?) to contain as much of the line as possible. Also need to check the botnick is the one being sent the notice (the bot gets channel notices and without this check can set this script off erroneously).
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
opsb
Halfop


Joined: 01 Sep 2007
Posts: 41

PostPosted: Sun Jun 15, 2008 7:53 pm    Post subject: Reply with quote

Even your code wont work
Back to top
View user's profile Send private message
strikelight
Owner


Joined: 07 Oct 2002
Posts: 708

PostPosted: Sun Jun 15, 2008 9:51 pm    Post subject: Reply with quote

For server notices, you will most likely need to use a raw binding.

Code:

bind raw - NOTICE yourproc:rawnotice


See tcl-commands.doc for the paramaters a raw binding is called with.
Back to top
View user's profile Send private message Visit poster's website
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