| View previous topic :: View next topic |
| Author |
Message |
opsb Halfop
Joined: 01 Sep 2007 Posts: 41
|
Posted: Sat Jun 14, 2008 2:35 pm Post subject: on whois msg chan |
|
|
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 |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sat Jun 14, 2008 3:26 pm Post subject: |
|
|
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 |
|
 |
opsb Halfop
Joined: 01 Sep 2007 Posts: 41
|
Posted: Sat Jun 14, 2008 6:19 pm Post subject: |
|
|
thnx for trying but not working for me  |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Jun 14, 2008 9:29 pm Post subject: |
|
|
| 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 |
|
 |
opsb Halfop
Joined: 01 Sep 2007 Posts: 41
|
Posted: Sun Jun 15, 2008 7:53 pm Post subject: |
|
|
| Even your code wont work |
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Sun Jun 15, 2008 9:51 pm Post subject: |
|
|
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 |
|
 |
|