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.

Script for public command !banlist and for # ban

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Script for public command !banlist and for # ban

Post by DaRkOoO »

Hey guys,can somebody write me tcl which will reacts when I type "!banlist" in some channel,and then he will say all bans in that channel..also public..I tried to edit code that I find in manager.tcl :

Code: Select all

# Usage: !banlist
proc pub:banlist {nick host hand chan arg} {
	global botnick
	putserv PRIVMSG $chan "\002Global bans:\002"
	if {[banlist] == ""} {
		putserv "PRIVMSG $chan :None."
	} else {
		foreach ig [banlist] {
			set what [lindex $ig 0]
			set by [lindex $ig 5]
			set comment [lindex $ig 1]
			putserv "PRIVMSG $chan : "$what - by $by, Reason: $comment"
		}
	}
	putserv "PRIVMSG $chan : Bans for $chan:"
	if {[banlist $chan] == ""} {
		putserv "PRIVMSG $chan :None."
	} else {
		foreach b [banlist $chan] {
			set what [lindex $b 0]
			set by [lindex $b 5]
			set comment [lindex $b 1]
			putserv "PRIVMSG $chan : $what - by #4$by#, Reason: $comment"
		}
	}
	putserv "PRIVMSG $chan : End Of Banlist."
	putcmdlog "<<$nick>> !$hand! banlist $chan"
}
And second tcl..I need script that will ban anyone who writes *#* in channel #bla..And I wanna to add more channels,2 or 3 ,but not all channels bot is on..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This should display the channel-bans after requesting !banlist (feel free to modify it).

Code: Select all

bind pub - !banlist proc:banlist

proc proc:banlist {nick uhost hand chan arg} {
 foreach b [chanbans $chan] {
  puthelp "privmsg $chan :[lindex $b 0] by [lindex $b 1]"
 }
}
As for the second request, there are tons of anti-advertising/bad words scripts in the Tcl archive.
D
DaRkOoO
Halfop
Posts: 67
Joined: Sat Sep 27, 2008 7:27 am

Post by DaRkOoO »

I tried tons of them, but no one works like i want.They usually works for all chanells and i need it just for few chanells which i can add and remove.

[EDIT] - Okey,I made this from few tcl scripts :

Code: Select all

bind pubm -* "*#*" badchar:pub


# Define the channel where u want the kickbans to work:
set bchan "#botchan"

proc badchar:pub {nick uhost hand chan arg} {
    global bchan
 if {$chan == "#botchan"} { 
    if {[botisop $bchan]} {
    putquick "MODE $bchan +b *!*@[lindex [split $uhost @] 1]"
    putserv "KICK $bchan $nick :Bad Character"

    }
       
    }
}
Now..I need to have an option that will protect channel ops (will not kick @'s even if they say # on some channel) ..But I need to can put 1 ( protect @'s) ,and 2 (don't protect ops)..And I wanna to can add more channels..
Post Reply