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.

auto-notice

Old posts that have not been replied to for several years.
Locked
C
Caryn

auto-notice

Post by Caryn »

I am wondering, how do i script a simple TCL script that allows me to EG:
trigger !setnotice

and the bot sets a channel notice to the channel automatically.
Not needing to have to go into the tcl config.

I have one channel notice TCL already.
If this is made and added, will it crash?

How do I go about scripting such a TCL?

Thanks for reading and helping :)
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

What are you trying to do?

If you mean like a welcome message when people join the channel,
Try this (i just wrote it in this window)

Code: Select all

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.
C
Caryn

thanks for replying

Post by Caryn »

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.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Check my post again :p
C
Caryn

!

Post by Caryn »

Oh man you're very good at it ya!
thanks so much.
one question, will it crash with my other on join notice tcl?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Well as this is a different script, i would suggest you remove the other one

EDIT: I found a small typo, so please copy and paste the script again, as i fixed a missing brace :p
C
Caryn

Post by Caryn »

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.
C
Caryn

Post by Caryn »

[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): >.<
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Did you restart the bot or rehashed?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Ok, i tested the code for myself, and came to the conclusion, it works fine.
The problem either lies in your eggdrop or something else.

Code: Select all

[13:52:10] <MeTroiD> !setnotice
[13:52:11] -Q14- No welcome message is set for channel #Q12
[13:52:13] <MeTroiD> !setnotice lol
[13:52:13] -Q14- Done.
[ /hop ]
[13:52:14] * Attempting to rejoin channel #Q12
[13:52:14] * L sets mode: +o MeTroiD
[13:52:14] -Q14- [#Q12] lol
[13:52:25] <MeTroiD> !setnotice
[13:52:25] -Q14- Welcome message for channel #Q12 is: lol
Locked