This is a snippet I made, mostly to get used to dialogs (Which wasnt that hard) and for a few issues in some of my channels.
just right click the channel, find the menu and voila.
Or you can use the alias itself, by typing /chan_flood
If any bugs are found, PM me or post a comment here.
And please, do not ripp or modify this script w/o my permission.
Also, thanks to xDaemon for pointing a few things out.
GL & HF with the script!
Edit:
Made a very quick update, took me 10 minutes to finish, enjoy.
on *:START: {
if ($version < 6.16) {
echo -st You are running a version below 6.16 which might cause troubble!
echo -st I highly advice you to download the newest mIRC client from http://www.mirc.com
unload -rs " $+ $script $+ "
}
else {
unset $+(%,flood,.%chan)
}
}
on *:LOAD: {
if ($version < 6.16) {
echo -st You are running a version below 6.16 which might cause troubble!
echo -st I highly advice you to download the newest mIRC client from http://www.mirc.com
unload -rs " $+ $script $+ "
}
}
#Channel.flood off
on !*:JOIN:%chan: {
if (!$nick($chan,$nick,oh)) {
inc $($+(%,flood,.,%chan))
if ($($+(%,flood,.,%chan),2) > %c) {
$+(,.timer,.unset,.flood) 1 %timeout unset $($+(%,flood,.,%chan),2)
if ($nick($chan,$nick,vr)) {
msg %chan Join flood detected at $+($asctime(HH:nn),/,$date(mmmm),$chr(32),$ord($date(d))) on %chan $+ .
msg %chan Locking channel for $duration(%fl.reset) $+ !
mode %chan +i
if (!$window(@Flood)) { window @Flood }
aline -hp @Flood Attempt at join flood was prevent at $+($asctime(HH:nn),/,$date(mmmm),$chr(32),$ord($date(d))) on %chan $+ .
$+(,.timer,.flood) 1 %fl.reset mode %chan -i
}
}
}
}
on !*:PART:%chan: {
if ($nick($chan,$nick,vr)) {
inc $($+(%,flood,.,%chan))
}
}
#Channel.flood end
alias flood_info {
echo -at The current settings are:
$iif(%chan,echo -at Channel: %chan, echo -at No present settings for the channel!)
$iif(%timeout,echo -at Timeout: $duration(%timeout), echo -at No present settings for the timeout!)
$iif(%fl.reset, echo -at Reset time: $duration(%fl.reset), echo -at No present settings for the reset time!)
$iif(%c,echo -at Max join/parts: %c, echo -at No present settings for maximum join/part!)
}
alias flood_reset {
set %timeout 30
set %fl.reset 20
set %chan #none
set %c 5
echo -at Everything was reset!
}
dialog chan_flood {
title "Channel flood control v.1.17 by: Lindrian"
Size -1 -1 260 285
box " Channel [Only works in one channel!] ", 1, 15 10 225 45
edit # $+ %chan, 2, 26 26 202 20, tab 100
box "Timeout", 3, 15 60 225 45
edit $duration(%timeout), 4, 26 75 202 20, tab 100
box "Reset time", 5, 15 110 225 45
edit $duration(%fl.reset), 6, 26 125 202 20, tab 100
box "Maximum join/parts [Must be a number!]", 7, 15 160 225 45
edit %c, 8, 26 175 202 20
button "Ok", 9, 85 210 55 20, ok
button "Cancel", 10, 20 210 55 20, cancel
button "Reset", 11, 20 230 55 20
button "Settings", 15, 85 230 55 20
button "Enable", 13, 20 250 55 20
Text "Channel Flood protection v.1.17 by Lindrian - Locks the channel on eventual flood!", 12, 145 210 100 180
}
alias chan_flood { if (!$dialog(chan_flood)) { dialog -m chan_flood chan_flood } }
on *:dialog:chan_flood:*:*: {
if ($devent == init) {
did -ra $dname 2 $iif(%chan,%chan,-No settings-)
did -ra $dname 4 $iif(%timeout,$duration(%timeout),-No settings-)
did -ra $dname 6 $iif(%fl.reset,$duration(%fl.reset),-No settings-)
did -ra $dname 8 $iif(%c,%c,-No settings-)
$iif($group(#channel.flood) == on,did -ra $dname 13 Disable,did -ra $dname 13 Enable)
}
elseif ($devent == sclick) {
if ($did == 15) {
flood_info
}
elseif ($did == 13) {
$iif($group(#channel.flood) == on,disable #channel.flood,enable #channel.flood)
$iif($group(#channel.flood) == on,did -ra $dname 13 Disable,did -ra $dname 13 Enable)
}
elseif ($did == 11) {
beep 2 | var %warn $input(Are you sure you wish to reset to default settings?,yv,Warning - Flood protection)
if (%warn == $no) { return }
if (%warn == $yes) {
flood_reset
}
}
}
elseif ($devent == edit) {
if ($did == 2) {
set %chan $did(2)
}
}
elseif ($did == 4) {
if ($did(4) isnum) {
set %timeout $did(4)
}
else {
beep 2 | var %error $input(You did not input a correct value in the edit box!
}
}
elseif ($did == 6) {
if ($did(6) isnum) {
set %fl.reset $did(6)
}
else {
beep 2 | var %error $input(You did not input a correct value in the edit box!
}
}
elseif ($did == 8) {
$iif($left($did(8),1) != $chr(35),set %c $+($chr(35),$did(8)),set %c $did(8))
}
}
menu * {
-
Flood prot
.Flood protection: chan_flood
.-
.Credits!: echo -at Channel protection by Lindrian! v.1.17 | echo -at Contact me through irc.deltaanime.net @ #Lindrian or #L2forever! Also join me at: irc.ungowa.org @ #Ungowa!
-
}
menu @flood {
.Clear @Flood: var %con $input(Are you sure you wish to clear the window?,yv,Confirm - Flood protection) | if (%con == $yes) { clear @flood }
}
mass join part if on UNREALIRCD servers .. you have server mode +j X;Y .it is designed to protect against join-part floods (revolving door floods). The mode takes a parameter of the form X:Y where X is the number of joins and Y is the number of seconds. If a user exceeds this limit, he/she will be prevented from joining the channel. to set it .. the command is /mode #channelname +j X:Y :)
note... This mode works on a per-user basis not global like mode +f :)
just food for thought to save scriptinh
Also to shorten you code alittle bit and make it operate a bit better instead of using: \'if ($nick !isop %chan) || ($nick !ishop %chan) {\' you can use \'if ($nick($chan,$nick,vr)) {\' which will make the script only go off when a voiced or regular user sets it off. Also in your alias rather then having 12 if (%variable) or if (!%variable) we can just simplify this by using an $iif statement like this: \'echo -a Channel: $iif(%chan,%chan,ERROR - The Channel is not set! Type /chan_flood and edit it!)\' which will handle both instances in one line and makes the script much neater. Other then those few things you have what looks to be a pretty good code just work on improving the way in which you code your scripts and you\'ll be making even better ones soon. Good job