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.

Insulter.tcl

Help for those learning Tcl or writing their own scripts.
Post Reply
r
roughnecks
Voice
Posts: 33
Joined: Sun Sep 14, 2008 9:33 am
Location: Italy

Insulter.tcl

Post by roughnecks »

Hi guys, i'm going to make a request..if anybody can help :)

I'm using the script in the subject, but have this problem: the bot gets pwned by users who simply !insult non-existent nick or insulting the bot adding a character to its nickname : for example. let's say the botnick is "roger", you can simply do a !insult Roger, or !insult roger: and you get a bot insulting itself :(

Because i'm not able to modify the tcl by myself, i was asking if anybody can help me.

Hoping it's not a problem for you, i'm going to insert the code.
Thank so much !

Code: Select all

#################################################################
#                            Insulter				#
#                Per insultare con parole random		#
#								#
#            Written by IRC Club Staff (SerialCRACK)		#
#################################################################

### BINDS
bind pub - !insulta insulta
bind pub - !insulter ad

### SETS
set insulti {
 {Stronzo}
 {Strunz}
 {Testa di cazzo}
 {Vaffanculo}
 {Fanculo}
 {Deficiente}
 {[censored]}
 {Lamer}
 {Ma per vedere la tua faccia ti guardi dietro?? (Chi ha capito ha capito, chi non ha capito... è come te!)}
 {Il classico tipo che va al cesso ed è fiero dello stronzo che fa}
 {Se avessimo voluto uno stronzo in canale, avremmo fatto scorta di lassativi}
 {Fossi in te, quando uso il pc non permetterei ai miei genitali di chattare}
}

### PROCS
proc insulta {nick host hand chan arg} {
	global insulti botnick owner
	if {[isop $nick $chan]==0} {
		putserv "NOTICE $nick :Questo comando è accessibile solo agli op del canale!"
		putserv "PRIVMSG $chan :$nick, you're lame!"
	} else {
		set lamer [lindex $arg 0]
		set word [lindex $insulti [rand [llength $insulti]]]
		if {($lamer == $botnick) || ($lamer == $owner)} {
			putserv "PRIVMSG $chan :$nick, mi credi come te? (scemo)"
			putserv "PRIVMSG $chan :12Insult revenge -> $nick: $word"
			return 0
		}
		if {$lamer == ""} {
			putserv "PRIVMSG $chan :$nick, chi devo fanculizzare?"
		} else {
			putserv "PRIVMSG $chan :$lamer: $word"
			putlog "* Insulter - $nick ha insultato $lamer ('$word')"
		}
	}
}

proc ad {nick host hand chan arg} {
	putserv "PRIVMSG $chan :Insulter TCL was created by IRC Club Staff - http://irc-club.6go.net"
}

putlog "TCL Script: Insulter v1.0 created by IRC Club Staff - http://irc-club.6go.net"
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Insulter.tcl

Post by user »

This should prevent insulting of people not on the channel, the bot and any owner (not tested):

Code: Select all

proc insulta {nick uhost hand chan arg} {
	if {[isop $nick $chan]} {
		if {[scan $arg %s lamer]==1} {
			if {![onchan $lamer $chan]} {
				# $lamer is not on $chan...
				puthelp "PRIVMSG $chan :\"$lamer\"?"
			} else {
				global insulti
				set insult [lindex $insulti [rand [llength $insulti]]]
				if {[isbotnick $lamer]||[matchattr [nick2hand $lamer] n]} {
					puthelp "PRIVMSG $chan :$nick, mi credi come te? (scemo)" 
					puthelp "PRIVMSG $chan :12Insult revenge -> $nick: $insult"
				} else {
					puthelp "PRIVMSG $chan :$lamer: $insult"
				}
			}
		} else {
			puthelp "PRIVMSG $chan :$nick, chi devo fanculizzare?"
		}
	} else {
		puthelp "NOTICE $nick :Questo comando è accessibile solo agli op del canale!" 
		puthelp "PRIVMSG $chan :$nick, you're lame!"
	}
}
Have you ever read "The Manual"?
r
roughnecks
Voice
Posts: 33
Joined: Sun Sep 14, 2008 9:33 am
Location: Italy

Post by roughnecks »

going to test .. thank U !
r
roughnecks
Voice
Posts: 33
Joined: Sun Sep 14, 2008 9:33 am
Location: Italy

[SOLVED] was: Insulter.tcl bug

Post by roughnecks »

ok what can i say ?
It seems just to be working !!!!!

:lol: :lol: :lol: :lol: :lol:

Very very happy...good job !
Thanks again!
Post Reply