This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

On Text Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

On Text Script

Post by Football »

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.
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Try it:

Code: Select all

# 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/
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

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.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Oh and I did get this error

Code: Select all

[11:52:01] Tcl error [monitorProc]: Unknown channel setting.
Idling at #Football, Quakenet.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

replace:

Code: Select all

if {![channel get $chan +monitorText]} { 
with:

Code: Select all

if {![channel get $chan monitorText]} { 
Once the game is over, the king and the pawn go back in the same box.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

yeah that worked, cheers username and caesar! appreciate it very much!
Idling at #Football, Quakenet.
Post Reply