| View previous topic :: View next topic |
| Author |
Message |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Tue Feb 09, 2010 2:38 pm Post subject: Topic script |
|
|
Hey,
I couldn't find a regula, simple script, that allows flag "v" to change a selected channel's topic via private message.
Would be glad if anyone could help, shouldn't be a long script right? _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Feb 09, 2010 3:24 pm Post subject: |
|
|
I just use a this simple bit of script to do channel topics
| Code: | bind msg v|v topic cmd:topic
proc cmd:topic {nick uhost hand arg} {
set chan [lindex [split $arg] 0]
set text [join [lrange [split $arg] 1 end]]
putserv "TOPIC $chan :$text"
}
|
/msg botnick topic #chan topic text _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Feb 09, 2010 6:46 pm Post subject: |
|
|
| Code: | setudef flag mytopic
bind msg v|v topic cmd:topic
proc cmd:topic {nick uhost hand arg} {
set chan [lindex [split $arg] 0]
set text [join [lrange [split $arg] 1 end]]
if {[string match *[string index $chan 0]* "#&"]} {
if {[validchan $chan] && [botison $chan]} {
if {[botisop $chan]} {
if {[channel get $chan mytopic]} {
if {[onchan $nick $chan]} {
putserv "TOPIC $chan :$text"
} else {
putserv "NOTICE $nick :You need to be in the channel to witness the topic change. Nice try. :P"
}
} else {
putserv "NOTICE $nick :You CANNOT change topic of $chan. Nice try."
}
} else {
putserv "NOTICE $nick :I'm not op of $chan so no topic change for you. :P"
}
} else {
putserv "NOTICE $nick :I'm not on $chan. How do you expect me to change topic?!"
}
} else {
putserv "NOTICE $nick :What is $chan? That doesn't look like any IRC channel I've ever seen. :P"
}
} |
Here's the same script with some extra checks to make sure users aren't causing your bot to send garbage to the IRCD.
To get it to work in #yourchan: .chanset #yourchan +mytopic
After that, it will work for users with voice in #yourchan. Other users cannot manipulate your bot without being in it's presence. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Wed Feb 10, 2010 12:47 pm Post subject: |
|
|
That doesn't seem to work, even though I used .chanset #EPL +mytopic and added the user with a +v flag, and he is voiced on the channel.
[17:45] Tcl error [cmd:topic]: invalid command name "botison" _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Feb 10, 2010 6:05 pm Post subject: |
|
|
| Sir_Fz wrote: | | Replace "botison" with "botonchan". |
DOH! Sir_Fz to the rescue..
Thanks for the save.. keke _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
|