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 for those learning Tcl or writing their own scripts.
dq
Voice
Posts: 32 Joined: Mon Apr 03, 2006 12:28 am
Post
by dq » Fri May 05, 2006 11:37 am
Code: Select all
bind PUB n|- ${trigger}join pub:join
proc pub:join {nickname hostname handle channel arguments} {
if {![llength [split $arguments]] || [validchan [set channel [lindex [split $arguments] 0]]]} {
putserv "NOTICE $nickname :Please use $::lastbind #channel"
} else {
channel add $channel
}
}
@Join #Channel, if the owner displays that command in a public channel the bot will obey, however is it possible to pm the bot with the @join command and it will obey?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri May 05, 2006 11:56 am
Change PUB to MSG .
dq
Voice
Posts: 32 Joined: Mon Apr 03, 2006 12:28 am
Post
by dq » Fri May 05, 2006 12:09 pm
lol.. thanks
gotta learn somewhere ;p
EDIT: Can it work for both pub and msg?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri May 05, 2006 7:15 pm
The way your proc is written, yes it can work. And if you want to learn about Eggdrop binds, read Tcl-commands.doc.
dq
Voice
Posts: 32 Joined: Mon Apr 03, 2006 12:28 am
Post
by dq » Fri May 26, 2006 9:23 am
Sorry for such a late reply, hadn't had time to check it out.. it still doesn't work it wont respond via PM
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri May 26, 2006 9:52 am
dq wrote: Sorry for such a late reply, hadn't had time to check it out.. it still doesn't work it wont respond via PM
Do you expect
Code: Select all
putserv "NOTICE $nickname :Please use $::lastbind #channel"
to result in a PRIVMSG?
Have you ever read "The Manual"?
BarkerJr
Op
Posts: 104 Joined: Sun Mar 30, 2003 1:25 am
Contact:
Post
by BarkerJr » Sun Jun 11, 2006 5:49 pm
Here ya go...
Code: Select all
bind PUB n|- ${trigger}join {dojoin $_pub1 $_pub5; #}
bind MSG n|- ${trigger}join {dojoin $_msg1 $_msg4; #}
proc dojoin {nickname channel} {
if {![llength [split $channel]] || [validchan [set channel [lindex [split $channel] 0]]]} {
putserv "NOTICE $nickname :Please use $::lastbind #channel"
} else {
channel add $channel
}
}
What you see as the last argument of the bind is like an anonymous function.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sun Jun 11, 2006 10:24 pm
a wonderful example of using eggdrop's hardcoded argument names
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Jun 12, 2006 8:50 am
Excellent documentation, I didn't know you can do that
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Tue Jun 13, 2006 6:37 am
I don't want to destroy this great idea... I haven't thought on using the vars directly till now and I am sure you can make very simple scripts with it, but wouldn't a:
Code: Select all
bind PUB n|- ${trigger}join dojoin
bind MSG n ${trigger}join dojoin
proc dojoin {nickname uhost hand args} {
if {[validchan [set channel [lindex $args end]]] || $channel == ""} {
...
be also very simple and short in that particular case?
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under
The MIT License
Love hurts, love strengthens...