This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

on part script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
Demp
Voice
Posts: 6
Joined: Sat Dec 29, 2007 7:11 am

on part script

Post by Demp »

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.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
D
Demp
Voice
Posts: 6
Joined: Sat Dec 29, 2007 7:11 am

Post by Demp »

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
:)
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Try this (not tested):

Code: Select all

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"?
D
Demp
Voice
Posts: 6
Joined: Sat Dec 29, 2007 7:11 am

Post by Demp »

thnx, it works! :D

but how can i get it to work in only one channel?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
Post Reply