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 

only echo stuff starting with a [

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Sun Nov 27, 2005 8:17 am    Post subject: only echo stuff starting with a [ Reply with quote

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 Smile

thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 27, 2005 10:31 am    Post subject: Reply with quote

Code:
bind pubm - "\[*" pre

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon Nov 28, 2005 9:43 am    Post subject: Reply with quote

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 Wink
_________________
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
View user's profile Send private message MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Nov 28, 2005 10:38 am    Post subject: Reply with quote

Ah yeah, my bad Embarassed
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Tue Nov 29, 2005 4:27 pm    Post subject: Reply with quote

thanks that works Smile

is it also to filter some lines out?

like we dont when to let the users see for example
[SYSOP] - blabbla
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Nov 29, 2005 5:57 pm    Post subject: Reply with quote

Code:
if {"[lindex [split $text] 0]" == "\[SYSOP\]"} { return 0 }

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Wed Nov 30, 2005 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Nov 30, 2005 1:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
brood
Voice


Joined: 01 Sep 2005
Posts: 30

PostPosted: Sat Dec 03, 2005 6:16 am    Post subject: Reply with quote

thanks Very Happy
Back to top
View user's profile Send private message
kaotech
Voice


Joined: 20 Dec 2005
Posts: 2

PostPosted: Wed Dec 21, 2005 5:25 pm    Post subject: Reply with quote

if the [ is red what is necessary to change on the code ?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Dec 22, 2005 2:21 am    Post subject: Reply with quote

Sir_Fz wrote:

if {($nick == "nick")} {

Huh?! Shocked 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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