| View previous topic :: View next topic |
| Author |
Message |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Fri May 05, 2006 11:37 am Post subject: PM? |
|
|
| Code: | 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? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Fri May 05, 2006 12:09 pm Post subject: |
|
|
lol.. thanks
gotta learn somewhere ;p
EDIT: Can it work for both pub and msg? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri May 05, 2006 7:15 pm Post subject: |
|
|
The way your proc is written, yes it can work. And if you want to learn about Eggdrop binds, read Tcl-commands.doc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Fri May 26, 2006 9:23 am Post subject: |
|
|
| Sorry for such a late reply, hadn't had time to check it out.. it still doesn't work it wont respond via PM |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri May 26, 2006 9:52 am Post subject: |
|
|
| 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: | | putserv "NOTICE $nickname :Please use $::lastbind #channel" | to result in a PRIVMSG?  _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
BarkerJr Op

Joined: 30 Mar 2003 Posts: 104
|
Posted: Sun Jun 11, 2006 5:49 pm Post subject: |
|
|
Here ya go...
| Code: |
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. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Jun 11, 2006 10:24 pm Post subject: |
|
|
a wonderful example of using eggdrop's hardcoded argument names _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
BarkerJr Op

Joined: 30 Mar 2003 Posts: 104
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Jun 12, 2006 8:50 am Post subject: |
|
|
Excellent documentation, I didn't know you can do that  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Tue Jun 13, 2006 6:37 am Post subject: |
|
|
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: | 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... |
|
| Back to top |
|
 |
|