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.
Old posts that have not been replied to for several years.
yvovandoorn
Voice
Posts: 15 Joined: Thu Apr 17, 2003 1:20 pm
Post
by yvovandoorn » Sat May 24, 2003 10:01 pm
Is there a tcl that has the ability to do the following... When an op changes the topic that it keeps part of the topic. For example (and just for example)
If Op A changes the topic to: I am a nerd, leave me alone
a bot does the following:
Welcome to #win98 || I am a nerd, leave me alone
So whenever an op changes the topic a bot appends it with a default text before what ever the op changes it too.
Another example:
Op A changes the topic to: Boy this sucks
a bot does the following:
Welcome to #win98 || Boy this sucks
Hope that makes sense.
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Sat May 24, 2003 10:53 pm
Code: Select all
bind topc -|- "#chan *" topc:check
proc topc:check { nick userhost handle chan topic } {
if { ( $nick == $::botnick ) } {
return 0
}
set static "welcome to $chan || "
puthelp "TOPIC $chan :$static $topic"
}
something like that
photon?
yvovandoorn
Voice
Posts: 15 Joined: Thu Apr 17, 2003 1:20 pm
Post
by yvovandoorn » Sat May 24, 2003 11:05 pm
awesome
this will only work in one channel right. The bots are in multiple channels and I know some channels would hate this.
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Sat May 24, 2003 11:07 pm
yes, in the bind you specify what chan its triggered in
"#yourchannel *"
photon?
yvovandoorn
Voice
Posts: 15 Joined: Thu Apr 17, 2003 1:20 pm
Post
by yvovandoorn » Sat May 24, 2003 11:56 pm
One more question...
(I don't know anything of TCL heh)
Is it possible so if someone updates the topic and the static part is already in place is that it wont add it again.
For example...
Op A sets topic to I am a nerd
Bot changes topic to Welcome to #win98 || I am a nerd
Op B edits the topic by adding a ! to nerd
Bot changes topic to Welcome to #win98 || Welcome to #win98 || I am a nerd!
Is it possible that the script doesn't add it again?
ReaLz
Op
Posts: 121 Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece
Post
by ReaLz » Sun May 25, 2003 1:11 am
I'm not sure but try this:
Code: Select all
bind topc -|- "#chan *" topc:check
proc topc:check { nick userhost handle chan topic } {
set static "welcome to $chan || "
if { ( $nick == $::botnick ) } {
return 0
}
if {[string match $static $topic]} {
putlog "The new topic already contains the static part. I'll not change it."
return 0
}
puthelp "TOPIC $chan :$static $topic"
}
«A fantastic spaghetti is a spaghetti that does not exist»
yvovandoorn
Voice
Posts: 15 Joined: Thu Apr 17, 2003 1:20 pm
Post
by yvovandoorn » Sun May 25, 2003 1:45 am
Nope it doesn't work
but I really appreciate the help guys.
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Sun May 25, 2003 9:37 am
Code: Select all
bind topc -|- "#chan *" topc:check
proc topc:check { nick userhost handle chan topic } {
set static "welcome to $chan ||"
if { ( $nick == $::botnick ) } {
return 0
}
if { [string match "$static *" $topic] } {
return 0
}
puthelp "TOPIC $chan :$static $topic"
}
putlog "topic.tcl loaded"
realz just forgot a wildcard in the match pattern
string match ?-nocase? pattern string
* Matches any sequence of characters in string, including a null string.
photon?
yvovandoorn
Voice
Posts: 15 Joined: Thu Apr 17, 2003 1:20 pm
Post
by yvovandoorn » Sun May 25, 2003 6:24 pm
great, it works.
thanks for all the help spock & realz.
Kaarel
Halfop
Posts: 91 Joined: Sat Apr 26, 2003 5:24 am
Post
by Kaarel » Mon May 26, 2003 11:45 am
HMM it doesn`t work on my BOT, What I have done wrong
Code: Select all
bind topc -|- "#kaarel *" topc:check
proc topc:check { nick userhost handle chan topic } {
set static "welcome to $chan ||"
if { ( $nick == $::botnick ) } {
return 0
}
if { [string match "$static *" $topic] } {
return 0
}
puthelp "TOPIC $chan :$static $topic"
}
putlog "topic.tcl loaded"
Kaarel
Halfop
Posts: 91 Joined: Sat Apr 26, 2003 5:24 am
Post
by Kaarel » Mon May 26, 2003 11:48 am
my bot says to me <Botman> [18:46] Tcl error [topc:check]: invalid command name "? "
<Botman> [18:47] Tcl error [topc:check]: invalid command name "? "
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Mon May 26, 2003 12:10 pm
"?" isnt used anywhere in the script as far as i can tell.
you must've injected it
photon?
Kaarel
Halfop
Posts: 91 Joined: Sat Apr 26, 2003 5:24 am
Post
by Kaarel » Mon May 26, 2003 12:17 pm
spock wrote: "?" isnt used anywhere in the script as far as i can tell.
you must've injected it
injected what?
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Mon May 26, 2003 12:23 pm
the questionmark --> ?
.tcl ?
<bot> TCL error: invalid command name "?"
.tcl invalidcommand
<bot> TCL error: invalid command name "invalidcommand"
and there shouldnt be any questionmark in the script so you must've put it there.
photon?
EEggy
Op
Posts: 122 Joined: Thu Sep 26, 2002 11:46 pm
Post
by EEggy » Tue Jun 17, 2003 9:56 am
Hi, that works great, but just wondering if someone set the topic manually, instead of using the bot, then is there anyway when person will set the topic manually and bot will grab that topic and check the default text, if not then append the default text to it and set it.?
let say default text is welcome to $chan
thanks
EEggy