I am trying to get 3 variables to merge to one for chaning a topic.
I have this
Code: Select all
set fulltopic $info_topiccss,$info_topiccs,$info_topich3
putserv "PRIVMSG ChanServ :topic $chan [set fulltopic]"
Thanks for your help!
Code: Select all
set fulltopic $info_topiccss,$info_topiccs,$info_topich3
putserv "PRIVMSG ChanServ :topic $chan [set fulltopic]"
Code: Select all
set fulltopic "$info_topiccss, $info_topiccs, $info_topich3"
putserv "privmsg chanserv :topic $chan $fulltopic"
Code: Select all
set fulltopic ""
append fulltopic $info_topiccss
append fulltopic ", $info_topiccs"
append fulltopic ", $info_topich3"
putserv "privmsg chanserv :topic $chan $fulltopic"
Code: Select all
# MULTICLAN BOT V1 SCRIPTS #
# TOPIC SETUP SCRIPT #
bind pub o|o .csnews topic_cschange
bind pub o|o .cssnews topic_csschange
bind pub o|o .h3news topic_h3change
bind pub o|o .updatetopic topic_set
proc topic_cschange { nick uhost hand chan arg } {
set cstopic [open /home/crave/irc/cravebot/scripts/cstopics.log w]
set topic $arg
puts $cstopic $topic
close $cstopic
putserv "NOTICE $nick :CS Topic Changed to $arg"
topic_set $chan $nick
}
proc topic_csschange { nick uhost hand chan arg } {
set csstopic [open /home/crave/irc/cravebot/scripts/csstopics.log w]
set topic $arg
puts $csstopic $topic
close $csstopic
putserv "NOTICE $nick :CS:S Topic Changed to $arg"
topic_set $chan $nick
}
proc topic_h3change { nick uhost hand chan arg } {
set h3topic [open /home/crave/irc/cravebot/scripts/h3topics.log w]
set topic $arg
puts $h3topic $topic
close $h3topic
putserv "NOTICE $nick :h3 Topic Changed to $arg"
topic_set $chan $nick
}
proc topic_set { chan nick } {
#CS
set topic_cs [open /home/crave/irc/cravebot/scripts/cstopics.log r]
set info_topiccs [read $topic_cs]
close $topic_cs
#CSS
set topic_css [open /home/crave/irc/cravebot/scripts/csstopics.log r]
set info_topiccss [read $topic_cs]
close $topic_css
#h3
set topic_h3 [open /home/crave/irc/cravebot/scripts/h3topics.log r]
set info_topich3 [read $topic_h3]
close $topic_h3
set fulltopic "$info_topiccss, $info_topiccs, $info_topich3"
putserv "privmsg chanserv :topic $chan $fulltopic"
putserv "NOTICE $nick :Updated Topic"
}
putlog "Mult-Bots V1.0 by Saurav Pokhrel - Topics Script Loaded -"
Code: Select all
proc topic_set { chan nick } {
Code: Select all
proc topic_set {nick uhost hand chan arg} {
Code: Select all
change all occurrences of:
topic_set $chan $nick
into:
topic_set $nick $uhost $hand $chan $arg
Code: Select all
#CS
set topic_cs [open /home/crave/irc/cravebot/scripts/cstopics.log r]
set info_topiccs [read $topic_cs]
close $topic_cs
#CSS
set topic_css [open /home/crave/irc/cravebot/scripts/csstopics.log r]
set info_topiccss [read $topic_cs]
close $topic_css
#h3
set topic_h3 [open /home/crave/irc/cravebot/scripts/h3topics.log r]
set info_topich3 [read $topic_h3]
close $topic_h3
Code: Select all
set fulltopic "[join $info_topiccss], [join $info_topiccs], [join $info_topich3]"
regsub -all {(?:\n|\r|\t|\v)} $fulltopic "" fulltopic
putserv "privmsg chanserv :topic $chan $fulltopic"
putserv "notice $nick :Updated Topic"
Code: Select all
set info_topich3 [gets $topic_h3]
Code: Select all
set topic $arg
puts $h3topic $topic
close $h3topic
Code: Select all
puts $h3topic [split $arg]
close $h3topic