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 

on part script

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


Joined: 29 Dec 2007
Posts: 6

PostPosted: Sat Dec 29, 2007 2:19 pm    Post subject: on part script Reply with quote

i need an on-part script that will work for a specified channel and network (if $network == bmxnet), if a person without op\voice parts the channel, the bot will notice him, ban his host and change the topic to +1 on the third word (ex: 'flybye is 3' -> 'flybye is 4').

thnx for the help in advance.
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Sat Dec 29, 2007 2:48 pm    Post subject: Reply with quote

Why would the script need to know which network your bot is on? Are you moving the bot around alot? What if there's no topic? What if the third word is not an integer?
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Demp
Voice


Joined: 29 Dec 2007
Posts: 6

PostPosted: Sat Dec 29, 2007 3:00 pm    Post subject: Reply with quote

so never mind the network... i'll just be careful with the servers.
can there be a validity check for the topic.. (if there is one and if the third word is a number?)
if not, just assume there is a topic and the third word is an integer
Smile
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Sat Dec 29, 2007 3:07 pm    Post subject: Reply with quote

Try this (not tested):
Code:
bind part - * annoy
proc annoy {n u h c r} {
   if {[isop $n $c]||[isvoice $n $c]} return;# Edit: forgot this :P
   set t [topic $c]
   if {[scan $t %*s%*s%d i]==1} {
      pushmode $c +b [maskhost $n!$u]
      puthelp "TOPIC $c :[join [lreplace [regexp -all -inline {\S+} $t] 2 2 [incr i]]]"
      puthelp "NOTICE $n :I love you!"
   } {
      # invalid topic - do nothing
   }
}

_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Demp
Voice


Joined: 29 Dec 2007
Posts: 6

PostPosted: Sat Dec 29, 2007 3:19 pm    Post subject: Reply with quote

thnx, it works! Very Happy

but how can i get it to work in only one channel?
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Sat Dec 29, 2007 3:30 pm    Post subject: Reply with quote

Demp wrote:
how can i get it to work in only one channel?

change the bind mask from * to "#yourchan *" and .restart
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
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