egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with a script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sat Mar 03, 2007 5:10 pm    Post subject: Help with a script Reply with quote

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) Smile

Thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Mar 03, 2007 10:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Mar 04, 2007 10:13 am    Post subject: Re: Help with a script Reply with quote

First request works correctly (botnick)

I guess it's not easy to add the second one Smile

Thanks


Last edited by Torrevado on Sun Mar 25, 2007 11:44 am; edited 1 time in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 04, 2007 10:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber