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.

help on a greeting script.

Help for those learning Tcl or writing their own scripts.
Post Reply
B
BigBen
Voice
Posts: 21
Joined: Sat Oct 07, 2006 6:49 pm

help on a greeting script.

Post by BigBen »

i need help on making a eggdrop script, like

on *:TEXT:*!Commands*:#: { //msg $nick Hello, to get commands.

then etc.
User avatar
kris
Voice
Posts: 14
Joined: Tue Sep 12, 2006 10:46 am
Location: Perth, Australia
Contact:

Post by kris »

i hope you know thats mIRC not TCL.
this is TCL

Code: Select all

bind pub "-|-" !commands msg_command 
proc msg_command { nick chan host handle text } {
putquick "NOTICE $nick :TEXT"
}
that'll work, but its not hard, ill explain for you.

bind = tells the eggdrop that a command is starting.
proc = starts the command.
putquick = makes it start the text in ""
} = close' it, im not to good at explaining, but i know what it does, just search on google and you will learn, also these people here are also good to read scripts, they know their stuff.
KrisDC Eggdrop Services - 2006
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

bind pub -|- !commands msg_command
proc msg_command {nick host handle chan text} {
  putquick "NOTICE $nick :TEXT"
}
Insert proper indenting.

Explaining it abit better..

Code: Select all

bind pub -|- !commands msg_command
This makes an internal 'bind' to pub (PUBLIC) with flags -|- (which means anyone). The command the bot needs to watch for is "!commands" in this case, and if the bot finds this command, it should send the data to the handler 'msg_command'.

Code: Select all

proc msg_command { nick chan host handle text } {
This is the start of our handler (AKA Procedure).
We start with the name of the handler so TCL knows what you mean when you call it later.

"nick host handle chan text" are the handler arguments, these are filled in by eggdrop.

These should be fairly self-explaining.

Code: Select all

putquick
putquick is simply a procedure (handler) to send something to the queue.
An IRC command generally comes after this, such as notice in the example.

NOTE: You MUST always end with as much closing braces/brackets (}/]) as you start.

For example

if {$bla} {
return 1
}
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Kinda old topic but is there anyway to modify it like only reacting in a specific
channel, and also make it not notice voiced users and above?
Post Reply