| View previous topic :: View next topic |
| Author |
Message |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sat Mar 03, 2007 5:10 pm Post subject: Help with a script |
|
|
| Code: | bind pub - !kiss kiss
proc kiss {nick uhost hand chan arg} {
if {[lsearch {#channel } $chan] == -1} return
global afkiss
if {![onchan $nick $chan]} {return 0}
if {![info exists afkiss([set nickchan [string tolower $nick:$chan]])]} {
set afkiss($nickchan) [list [unixtime] 0]
}
foreach {t o} $afkiss($nickchan) {break}
if {[unixtime]-$t > 120} { set t [unixtime]; set o 0 }
if {[incr o] > 5} { return 0 }
set afkiss($nickchan) [list $t $o]
if {[onchan [set kissed [lindex [split $arg] 0]] $chan]} {
putserv "privmsg $chan :\00306$nick kisses $kissed\003 :o"
}
}
|
I'd like that if someone use botnick, eggdrop will respond an alternative message
I'd like (if it's possible) the same thing to users asking for themselves
Note: this is Sir_Fiz's rock script (modified)
Thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Mar 03, 2007 10:58 pm Post subject: |
|
|
| Code: | bind pub - !kiss kiss
proc kiss {nick uhost hand chan arg} {
if {[lsearch {#channel } $chan] == -1} return
global afkiss
if {![onchan $nick $chan]} {return 0}
if {![info exists afkiss([set nickchan [string tolower $nick:$chan]])]} {
set afkiss($nickchan) [list [unixtime] 0]
}
foreach {t o} $afkiss($nickchan) {break}
if {[unixtime]-$t > 120} { set t [unixtime]; set o 0 }
if {[incr o] > 5} { return 0 }
set afkiss($nickchan) [list $t $o]
if {[onchan [set kissed [lindex [split $arg] 0]] $chan]} {
if {[isbotnick $kissed]} {
puthelp "privmsg $chan :<kissed botnick>"
} elseif {[string equal -nocase $nick $kissed]} {
puthelp "privmsg $chan :<kissed himself>"
} {
puthelp "privmsg $chan :\00306$nick kisses $kissed\003 :o"
}
}
} |
Edit: Added other feature (self-kissing). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sun Mar 04, 2007 10:51 am; edited 1 time in total |
|
| Back to top |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun Mar 04, 2007 10:13 am Post subject: Re: Help with a script |
|
|
First request works correctly (botnick)
I guess it's not easy to add the second one
Thanks
Last edited by Torrevado on Sun Mar 25, 2007 11:44 am; edited 1 time in total |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 04, 2007 10:53 am Post subject: |
|
|
Didn't notice the 2nd feature. I edited the code above; look at it, it's not hard at all so you should learn how to do it yourself now. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|