| View previous topic :: View next topic |
| Author |
Message |
Demp Voice
Joined: 29 Dec 2007 Posts: 6
|
Posted: Sat Dec 29, 2007 2:19 pm Post subject: on part script |
|
|
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 |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Sat Dec 29, 2007 2:48 pm Post subject: |
|
|
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 |
|
 |
Demp Voice
Joined: 29 Dec 2007 Posts: 6
|
Posted: Sat Dec 29, 2007 3:00 pm Post subject: |
|
|
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
 |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Sat Dec 29, 2007 3:07 pm Post subject: |
|
|
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 |
|
 |
Demp Voice
Joined: 29 Dec 2007 Posts: 6
|
Posted: Sat Dec 29, 2007 3:19 pm Post subject: |
|
|
thnx, it works!
but how can i get it to work in only one channel? |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Sat Dec 29, 2007 3:30 pm Post subject: |
|
|
| 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 |
|
 |
|