setudef str welcome
bind pub m|m !setnotice pub:setnotice
bind join - * join:welcome
proc pub:setnotice {nickname hostname handle channel arguments} {
set message [join [lrange $arguments 0 end]]
set welcome [channel get $channel "welcome"]
if {($welcome == "")} {
set welcome ""
}
if {($message == "")} {
if {($welcome == "")} {
putquick "NOTICE $nickname :No welcome message is set for channel $channel"; return
}
putquick "NOTICE $nickname :Welcome message for channel $channel is: $welcome"
return 0
}
if {($message == "remove")} {
channel set $channel welcome ""
putquick "NOTICE $nickname :Done."
return 0
}
channel set $channel welcome "$message"
putquick "NOTICE $nickname :Done."
}
proc join:welcome { nickname hostname handle channel } {
global botnick
if {([channel get $channel "welcome"] != "")} {
putquick "NOTICE $nickname :\[$channel\] [channel get $channel "welcome"]"
}
}
This should work, When you do !setnotice it will show you the welcome message, if you do !setnotice <your welcome message> it will change it to that welcome message. If it doesnt work, maybe i forgot a brace.
Last edited by metroid on Mon Nov 08, 2004 2:41 am, edited 2 times in total.
i actually wanted to make a trigger.
eg:
!setnotice #channel notice
then the bot immediatly sets or changes the on join channel notice.
instead of having to go to the eggdrop config.
Tcl error [pub:chanset]: illegal channel option: windshrines
[02:51:08:pm] (foxy): illegal channel option: is a private chat and gathering channel. we permit invited people only.
[02:53:18:pm] (@Carynst): !chanset windshrines is a private chat and gathering channel. we permit invited people only.
[02:53:20:pm] -foxy- I don't monitor that channel.
[02:53:27:pm] (@Carynst): !chanset #windshrines windshrines is a private chat and gathering channel. we permit invited people only.
[02:53:31:pm] (@Carynst): >.<