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.

Notice ban Script needed

Old posts that have not been replied to for several years.
S
Smurff
Voice
Posts: 7
Joined: Wed Feb 09, 2005 6:31 pm

Notice ban Script needed

Post by Smurff »

hi

I need a script which can set the channel +m for specified time incase there is a single channel notice.
I tried Noticeban1.1.tcl by Pulse. But it only bans for the channel notice and doesn't set the channel as +m. This could be helpful against (channel notice floods).

thanxx
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Just modify the script by inserting the following line before each of the 3 bans being set:

Code: Select all

putquick "MODE $chanz +m" -next
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Alchera wrote:Just modify the script by inserting the following line before each of the 3 bans being set:

Code: Select all

putquick "MODE $chanz +m" -next
he wants to have it a specified time, so he needs also:

Code: Select all

timer 10 [subst "pushmode $chanz -m"]
to add after the putquick. time is in minutes, if you need less than 2, you should use utimer which works in seconds.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Ooops! Need to clean my glasses. :shock:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

De Kus wrote:

Code: Select all

timer 10 [subst "pushmode $chanz -m"]
'subst'? how did you get that idea...try 'list' instead :)
Have you ever read "The Manual"?
S
Smurff
Voice
Posts: 7
Joined: Wed Feb 09, 2005 6:31 pm

Post by Smurff »

# Punishment method
# 1 - kick 2 - server ban 3 - local ban, 4 - global ban

set punishm "2"

# Kick Reason

set kickr "Don't use channel notice, \002only\002 channel ops(@)/voices(+) can use it."

# Ban type
# I guess it's enough ;)
# 1 - *!*@host.domain

set bantype "1"

# Ban reason
set banr "You may \002NOT\002 use channel notice."

# Ban time in mins, 0 = perm ban, will be used only if you set punishm to 3 or 4
set btime "360"

bind NOTC - * NoticeBan
proc NoticeBan {nick uhost handle text dest} {
global botnick punishm kickr banr btime chanz bantype
if {(![validchan $dest]) || (![botisop $dest])} { return 0 }
if {[matchattr $nick mo|mo $dest] || [isop $nick $dest] || [isvoice $nick $dest] || [matchattr $nick o|o $dest]} {return 0}
if {([isbotnick $nick]) || ([string tolower $nick] == "chanserv") || (![onchan $nick $dest])} {return 0}
if {($chanz != "") && ([lsearch -exact [split [string tolower $chanz]] [string tolower $dest]] == -1)} {return 0}
if {$punishm != "1"} {
switch -- $bantype {
1 { set banmask "*!*@[lindex [split $uhost @] 1]" }
2 { set banmask "*!$uhost" }
3 { set banmask "*!*$uhost" }
4 { set banmask "*![lindex [split $uhost @] 0]@*" }
5 { set banmask "*!*[lindex [split $uhost @] 0]@*" }
6 { set banmask "$nick!*@*" }
7 { set banmask "$nick![lindex [split $uhost @] 0]@*" }
8 { set banmask "$nick!$uhost" }
9 { set banmask "$nick!*$uhost" }
10 { set banmask "$nick!*@[lindex [split $uhost @] 1]" }
default { set banmask "*!*@[lindex [split $uhost @] 1]" }
return $banmask
}
}
if {$punishm == "1"} {
putquick "MODE $chanz +m" -next
timer 10 [subst "pushmode $chanz -m"]

putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "2"} {
putquick "MODE $chanz +m" -next
timer 10 [subst "pushmode $chanz -m"]
putserv "MODE $dest +b $banmask"
putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "3"} {
newchanban "$dest" "$banmask" "NoticeBan" "$banr" "$btime"
putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "4"} {
newban "$banmask" "NoticeBan" "$banr" "$btime"
putserv "KICK $dest $nick :$kickr"
}
return 1
}


Have i put it in the proper place ? and if i want to use utimer for the +m in seconds should i put "utimer" instead of "timer" ?

Thanks alot for your help :-)
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

yes thats in the right place but as user said you should use list rather than subst and utimer is used in seconds.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Smurff wrote:timer 10 [subst "pushmode $chanz -m"]
this is a timer, meaning the bot will remove the +m after 10 minutes. If you want to decrease this to seconds you can use utimer. for example:

Code: Select all

utimer 30 [list pushmode $dest -m]
which will set mode -m after 30 seconds.

NOTE: $dest is the variable for the channel in your code not $chanz
B
Bingooss
Voice
Posts: 11
Joined: Sun Sep 19, 2004 6:32 pm

Post by Bingooss »

try this it will work for u

#Channels where the notice script is supposed to work on.
set noticechans "#channel #channel2 #channel3"

bind notc - "*" chan:notice:kick

proc chan:notice:kick {nick uhost hand text {chan ""}} {
global botnick noticechans notice_lock
if {([lsearch -exact [string tolower $noticechans] [string tolower $chan]] == -1) || ([string equal $nick "ChanServ"]) || (![botisop $chan]) || ([isbotnick $nick]) || ([isop $nick $chan]) || ([isvoice $nick $chan]) || ([string match "Server flood protection activated for" $text])} { return 0 }
if {(![info exists notice_lock($chan)]) && (![string match *m* [getchanmode $chan]])} {
putquick "MODE $chan +mR flood.locked" -next;
set notice_lock($chan) "locked"; utimer 10 [list remove:lock $chan]
if {([info exists notice_lock($chan)])} { utimer 20 [list unset notice_lock($chan)] }
}
set noticeban "*!*@[lindex [split $uhost "@"] 1]"; putquick "MODE $chan +b $noticeban" -next; timer 5 "pushmode $chan -b $noticeban"
putquick "KICK $chan $nick :12,0The Usage Of 2*Notices* 12In This Channel 2Is Prohibited." -next
foreach user [chanlist $chan] {
if {([string match -nocase *$noticeban* "${user}![getchanhost $user $chan]"]) && (![isop $user $chan]) && (![isvoice $user $chan])} {
putquick "KICK $chan $user :(3Channel Notice Detected.)" -next
}
}
return 0
}

proc remove:lock {chan} {
if {([botisop $chan]) && ([string match *m* [getchanmode $chan]])} {
putquick "MODE $chan -mR unlocked"; return
}
}
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

please use he code tag when posting code :idea:
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

user wrote:
De Kus wrote:

Code: Select all

timer 10 [subst "pushmode $chanz -m"]
'subst'? how did you get that idea...try 'list' instead :)
lol, sorry, I don't know, figured it out just today. I don't know, I must have copied any script which used it wrong and then continued to use it @_o. fixed today already 2 scripts of mine relating to this :D. using subst works... as long there are no strings like [die] :D.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Use the one Bingooss gave. I made it for the same purpose which you wish to use it for some time earlier ago. It will basically lock the channel on a single channel notice and kick/ban the user who made the notice and everyone match that users hostmask in the format: *!*@domain.host.com.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

awyeah wrote:and everyone match that users hostmask in the format: *!*@domain.host.com.
So, every poor sod using the same ISP gets banned for the error of just one user?

I prefer *!*user@*.domain myself, simply to be fair. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

and why noone is using the built in maskhost feature is beyond me..
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Maskhost will definately ban a whole ISP, so its better if we just dont use it in *!*@host.domain.com types of banmasks, espcially for channels who have user limit 300+, well you can modify the banmask, thats not my concern. :)
So, every poor sod using the same ISP gets banned for the error of just one user?
Needless to say Alchera, I use the same script, well bit more modified according to my intentions on one of DALnet's largest populated channels, and the most flooded too. The script works fine there, no user, op, sop or anyone has complained ever.

See this stops drones from entering and kicks them, because mass join botnets mostly use notices as a tactic for flooding, so when it sees a notice from anyone wham, ban all those lamers and kick them. However yes it kicks people who perform a notice which isn't an op or voice. Everyone knows the rule no one can notice the channel except the ops/voices. :)

Besides even if an *!*@host gets banned, and we don't kick them there already banned? right? so they can't speak or do anything while in the channel so we might as well kick them heh. :)
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked