| View previous topic :: View next topic |
| Author |
Message |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Sun Mar 11, 2012 4:25 am Post subject: On Text Script |
|
|
Hey, I need a rather simple script (I think its simple).
I need a script that will be set on certain channels via flag (lets say .chanset #channel +monitorText)
The script will 'monitor' that channel (a main channel) and will look for:
A Line that contains 10 commas
example:
Alan, Howard, Toni, Joe, Robert, Laurent, Michael, Ronnie, Mounty, Spark, Yellow
AND / OR
A line that contains two ';'
example:
Joe; Robert; Tony
AND / OR
a line that contains the phrase 'XI':
Example: my top XI movies are: Matrix, Harry Potter...
And if it matches one of these conditions, the bot will auto-message that line matching one or more of these conditions to a sub channel, lets say '#subchannel'
Please help _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Mon Mar 12, 2012 6:18 am Post subject: |
|
|
Try it:
| Code: | # Channel flag.
setudef flag monitorText
# Subchannel.
set subchannel #subchannel
# Bind all text in all channels.
bind pubm - * monitorProc
proc monitorProc {nick uhost hand chan text} {
global subchannel
# Check channel flag.
if {![channel get $chan +monitorText]} {
return 0
}
# Check text for matching values.
if {[string match "*,*,*,*,*,*,*,*,*,*,*" $text] || [string match "*;*;*" $text] || [string match "*XI*" $text]} {
# Send matching text to subchannel.
putserv "PRIVMSG $subchannel :$text"
}
} |
I didnt text this code. _________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 12, 2012 6:47 am Post subject: |
|
|
hey username,
Thanks for the reply and the effort & time.
I've tested the script, once with a sentences using 10 times " , "
once with a line containing two times " ; "
and once with a sentence using " XI "
I've set the flag +monitorText on the channel I wanted it to monitor #World
I've set the sub channel as #Staff
And it didn't relay anything from #world to #staff _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 12, 2012 6:57 am Post subject: |
|
|
Oh and I did get this error
| Code: |
[11:52:01] Tcl error [monitorProc]: Unknown channel setting. |
_________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Mar 12, 2012 9:00 am Post subject: |
|
|
replace:
| Code: |
if {![channel get $chan +monitorText]} {
|
with:
| Code: |
if {![channel get $chan monitorText]} {
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 12, 2012 2:54 pm Post subject: |
|
|
yeah that worked, cheers username and caesar! appreciate it very much! _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
|
|
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
|
|