| View previous topic :: View next topic |
| Author |
Message |
brood Voice
Joined: 01 Sep 2005 Posts: 30
|
Posted: Sun Nov 27, 2005 8:17 am Post subject: only echo stuff starting with a [ |
|
|
We have a sitebot on a channel where the SiTEOPS are in. Now we made a channel for users who got axx to the ftp will be in. The problem is the sitebot tels stuff (like pre of a release) we dont want the users to see. So we want to echo stuff the bot says in the users channel, but not that kind of stuff.
We are using this very easy script atm:
| Quote: |
bind pubm * "*" pre
proc pre {nick uhost handle channel text} {
if {($nick == "nick") && ($channel == "#channel")} {
putserv "privmsg #userchannel :$text"
}
}
|
I was wondering if it could be change, it will only echo stuff we like it to be show in the user channel.
Like the sitebot announce:
<sitebot> PRE : blablabla
<sitebot> [TV] - blabla
So it have to echo only the text that starts with a "["
Hope this is clear
thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Mon Nov 28, 2005 9:43 am Post subject: |
|
|
| Sir_Fz wrote: | | Code: | | bind pubm - "\[*" pre |
|
psst!
| TCL-Commands.doc wrote: | | The mask is matched against the channel name followed by the text and can contain wildcards. |
your are better off with:
| Code: | | bind pubm - {#channel [*} pre |
you can skip the $chan == #channel part then  _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
brood Voice
Joined: 01 Sep 2005 Posts: 30
|
Posted: Tue Nov 29, 2005 4:27 pm Post subject: |
|
|
thanks that works
is it also to filter some lines out?
like we dont when to let the users see for example
[SYSOP] - blabbla |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Nov 29, 2005 5:57 pm Post subject: |
|
|
| Code: | | if {"[lindex [split $text] 0]" == "\[SYSOP\]"} { return 0 } |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
brood Voice
Joined: 01 Sep 2005 Posts: 30
|
Posted: Wed Nov 30, 2005 12:26 pm Post subject: |
|
|
it doesnt seems to work.
| Quote: |
bind pubm - {#channel1 [*} pre
proc pre {nick uhost handle channel text} {
if {($nick == "nick")} {
if {"[lindex [split $text] 0]" == "\[SYSOP\]"} { return 0 }
putserv "privmsg #channel2 :$text"
}
}
|
It still echo the [SYSOP] announcement |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Nov 30, 2005 1:40 pm Post subject: |
|
|
| Code: | bind pubm - {#channel1 [*} pre
proc pre {nick uhost handle channel text} {
if {($nick == "nick")} {
if {[string equal \[SYSOP\] [lindex [split $text] 0]]} { return 0 }
putserv "privmsg #channel2 :$text"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
brood Voice
Joined: 01 Sep 2005 Posts: 30
|
Posted: Sat Dec 03, 2005 6:16 am Post subject: |
|
|
thanks  |
|
| Back to top |
|
 |
kaotech Voice
Joined: 20 Dec 2005 Posts: 2
|
Posted: Wed Dec 21, 2005 5:25 pm Post subject: |
|
|
| if the [ is red what is necessary to change on the code ? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Dec 22, 2005 2:21 am Post subject: |
|
|
| Sir_Fz wrote: |
if {($nick == "nick")} {
|
Huh?! Elementary! My Dear Watson!
kaotech check this page. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|