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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Sun Nov 13, 2005 10:59 am
i would like to have say 3 preset topics which could be used by a command in 1 chat room to change another chat rooms topic, any idea how i would do this?
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Sun Nov 13, 2005 11:12 am
This should work:
Code: Select all
bind pub n "!topic" pub:topic
set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"
set topicchan "#yourchan"
proc pub:topic {nick uhost hand chan text}
{
switch -- [string tolower [lindex $text 0]]
{
"1"
{
putquick "TOPIC $::topicchan :$::topic1"
return
}
"2"
{
putquick "TOPIC $::topicchan :$::topic2"
return
}
"3"
{
putquick "TOPIC $::topicchan :$::topic3"
return
}
}
}
Use command !topic 1 or !topic 2 or !topic 3 in any channel you want and bot will set topic for channel you defined in variable $topicchan.
Last edited by
]Kami[ on Sun Nov 13, 2005 11:42 am, edited 1 time in total.
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Sun Nov 13, 2005 11:37 am
i get this when i try to rehash the bot
[15:36] <ToF> [07:35] Tcl error in file 'bot.conf':
[15:36] <ToF> [07:35] wrong # args: should be "proc name args body"
[15:36] <ToF> while executing
[15:36] <ToF> "proc pub:topic {nick uhost hand chan text}"
[15:36] <ToF> (file "scripts/Topic.tcl" line 9)
[15:36] <ToF> invoked from within
[15:36] <ToF> "source scripts/Topic.tcl"
[15:36] <ToF> (file "bot.conf" line 177)
[15:36] <ToF> [07:35] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Nov 13, 2005 12:47 pm
Code: Select all
proc pub:topic {nick uhost hand chan text}
{
should be
Code: Select all
proc pub:topic {nick uhost hand chan text} {
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Sun Nov 13, 2005 1:31 pm
getting this error now :/
<ToF> [11:53] Tcl error [pub:topic]: wrong # args: should be "switch ?switches? string pattern body ... ?default body?"
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Nov 14, 2005 6:39 am
I guess ]Kami[ got used to C or something
Code: Select all
bind pub n "!topic" pub:topic
set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"
set topicchan "#yourchan"
proc pub:topic {nick uhost hand chan text} {
switch -- [string tolower [lindex $text 0]] {
"1" {
putquick "TOPIC $::topicchan :$::topic1"
return
}
"2" {
putquick "TOPIC $::topicchan :$::topic2"
return
}
"3" {
putquick "TOPIC $::topicchan :$::topic3"
return
}
}
}
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Mon Nov 14, 2005 1:52 pm
thank you works now
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Mon Nov 14, 2005 3:29 pm
You are right, didn't use TCL for some time now (only C++)
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Tue Nov 15, 2005 4:02 am
sorry o be a pain, is thier anyway i can have public command like !topic and it shows the topic either in a message or notice on the channel?
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Tue Nov 15, 2005 4:17 am
Don't understand what you want.
Please explain it better
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Tue Nov 15, 2005 8:03 am
Seems we want a variation on the original request. The topic not only being set but also when !topic is used the topic on the channel is sent to the user who triggered it?
Add [SOLVED] to the thread title if your issue has been.
Search |
FAQ |
RTM
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Tue Nov 15, 2005 2:21 pm
ye when someone says does !topic in a channel i would like the bot to either msg the channel the topic or notice the person , just wondered if anyone could show me how to do this
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Tue Nov 15, 2005 3:29 pm
If i understood you good:
Code: Select all
bind pub n "!topic" pub:topic
set topic1 "topic 1"
set topic2 "topic 2"
set topic3 "topic 3"
set topicchan "#yourchan"
proc pub:topic {nick uhost hand chan text} {
switch -- [string tolower [lindex $text 0]] {
"1" {
putquick "TOPIC $::topicchan :$::topic1"
putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic1"
return
}
"2" {
putquick "TOPIC $::topicchan :$::topic2"
putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic2"
return
}
"3" {
putquick "TOPIC $::topicchan :$::topic3"
putquick "NOTICE $nick :Topic for channel $::topicchan is now $::topic3"
return
}
}
neilpkemp
Voice
Posts: 21 Joined: Sun Nov 13, 2005 10:52 am
Post
by neilpkemp » Tue Nov 15, 2005 3:31 pm
i just need it so if anyone wishes to view the topic in the channel they can just do a certain command like !topic and the bot will message them it
(sorry if im not making sense)