| View previous topic :: View next topic |
| Author |
Message |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Sun Nov 13, 2005 10:59 am Post subject: Preset topics |
|
|
| 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? |
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Sun Nov 13, 2005 11:12 am Post subject: |
|
|
This should work:
| Code: | 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. _________________ Slovene Eggdrop Page
Last edited by ]Kami[ on Sun Nov 13, 2005 11:42 am; edited 1 time in total |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Sun Nov 13, 2005 11:37 am Post subject: |
|
|
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) |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Nov 13, 2005 12:47 pm Post subject: |
|
|
| Code: | proc pub:topic {nick uhost hand chan text}
{ |
should be
| Code: | | proc pub:topic {nick uhost hand chan text} { |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Sun Nov 13, 2005 1:31 pm Post subject: |
|
|
getting this error now :/
<ToF> [11:53] Tcl error [pub:topic]: wrong # args: should be "switch ?switches? string pattern body ... ?default body?" |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Nov 14, 2005 6:39 am Post subject: |
|
|
I guess ]Kami[ got used to C or something
| Code: | 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
}
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Mon Nov 14, 2005 1:52 pm Post subject: |
|
|
thank you works now  |
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Mon Nov 14, 2005 3:29 pm Post subject: |
|
|
You are right, didn't use TCL for some time now (only C++)  _________________ Slovene Eggdrop Page |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Tue Nov 15, 2005 4:02 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Tue Nov 15, 2005 4:17 am Post subject: |
|
|
Don't understand what you want.
Please explain it better  _________________ Slovene Eggdrop Page |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Nov 15, 2005 8:03 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Tue Nov 15, 2005 2:21 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Tue Nov 15, 2005 3:29 pm Post subject: |
|
|
If i understood you good:
| Code: | 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
}
} |
_________________ Slovene Eggdrop Page |
|
| Back to top |
|
 |
neilpkemp Voice
Joined: 13 Nov 2005 Posts: 21
|
Posted: Tue Nov 15, 2005 3:31 pm Post subject: |
|
|
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) |
|
| Back to top |
|
 |
|