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 

On Text Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sun Mar 11, 2012 4:25 am    Post subject: On Text Script Reply with quote

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
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Mon Mar 12, 2012 6:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 12, 2012 6:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 12, 2012 6:57 am    Post subject: Reply with quote

Oh and I did get this error


Code:

[11:52:01] Tcl error [monitorProc]: Unknown channel setting.

_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
caesar
Mint Rubber


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

PostPosted: Mon Mar 12, 2012 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 12, 2012 2:54 pm    Post subject: Reply with quote

yeah that worked, cheers username and caesar! appreciate it very much!
_________________
Idling at #Football, Quakenet.
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 -> Script Requests 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