mIRC Home    About    Download    Register    News    Help

Print Thread
#57130 24/10/03 03:21 AM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
hey can someone help me with an ON OFF switch for this add-on I want to shut it off some times becuse it pisses some people off lol. thanks o and sorry for making it so long.


; +--------------+
; | AFRAC v1.4 |
; +--------------+

; *** Settings start

; Basic settings

alias kick.ops return 1
alias exempt.chans return #example1 #example2
alias ban.type return 2
alias show.ban.length return 1

; Flood protection settings

alias flood.enable return 1
alias flood.lines return 4
alias flood.secs return 3
alias flood.warnings return 2
alias flood.warning.expire return 600
alias flood.ban.length return 600
alias flood.kick.reason return warning! flooding is not allowed on $chan
alias flood.ban.reason return I just told you, flooding is not allowed!

; Repeat protection settings

alias repeat.enable return 1
alias repeat.secs return 30
alias repeat.difference return 5
alias repeat.warnings return 4
alias repeat.warning.expire return 1800
alias repeat.ban.length return 300
alias repeat.kick.reason return warning! repeating is not allowed on $chan
alias repeat.ban.reason return I just told you, repeating is not allowed!

; Advertise protection settings

alias advertise.enable return 1
alias advertise.words return 2
alias advertise.chanlen return 1
alias advertise.numbers return 1
alias advertise.keywords return come to, idle, join
alias advertise.warnings return 2
alias advertise.warning.expire return 3600
alias advertise.ban.length return 3600
alias advertise.kick.reason return warning! advertising is not allowed on $chan
alias advertise.ban.reason return I just told you, advertising is not allowed!

; Capitals protection settings

alias capitals.enable return 1
alias capitals.percentage return 0.5
alias capitals.minlength return 10
alias capitals.warnings return 3
alias capitals.warning.expire return 600
alias capitals.ban.length return 900
alias capitals.kick.reason return warning! excessive use of capitals is not allowed on $chan
alias capitals.ban.reason return I just told you, excessive use of capitals is not allowed!

; *** Settings /end

; *** Script start

alias trim {
var %a $1-
while ($left(%a, 1) == $chr(32)) {
var %a $right($1-, -1)
}
while ($right(%a, 1) == $chr(32)) {
var %a $left($1-, -1)
}
return %a
}

on @*:text:*:#:{

; pre

if ($nick isop $chan) && (!$kick.ops) halt

var %a 1
while (%a <= $numtok($exempt.chans, 32)) {
if ($chan == $gettok($exempt.chans, %a, 32)) halt
inc %a
}

; flood

if ($flood.enable) {
if (!%flood.lines. [ $+ [ $nick ] ]) {
set -z %flood.secs. [ $+ [ $nick ] ] $flood.secs
}
inc -u [ $+ [ $flood.secs ] ] %flood.lines. [ $+ [ $nick ] ]
if (%flood.lines. [ $+ [ $nick ] ] >= $flood.lines) {
if (%flood.secs. [ $+ [ $nick ] ]) {
unset %flood.lines. [ $+ [ $nick ] ]
if (%flood.warnings. [ $+ [ $nick ] ] >= $flood.warnings) {
if ($nick isop $chan) mode $chan -o $nick
ban $iif($flood.ban.length, -u [ $+ [ $flood.ban.length ] ]) $chan $nick $ban.type
kick $chan $nick $flood.ban.reason $iif($show.ban.length, ( $+ $duration($flood.ban.length) ban))
unset %flood.warnings. [ $+ [ $nick ] ]
}
else {
inc $iif($flood.warning.expire, -u [ $+ [ $flood.warning.expire ] ]) %flood.warnings. [ $+ [ $nick ] ]
kick $chan $nick $flood.kick.reason
}
}
else {
set -z %flood.secs. [ $+ [ $nick ] ] $flood.secs
set -u [ $+ [ $flood.secs ] ] $calc(%flood.lines. [ $+ [ $nick ] ] - $flood.lines)
}
}
}

; repeat

if ($repeat.enable) {
if (%repeat.lastmsg. [ $+ [ $nick ] ]) {
var %sub $calc($len(%repeat.lastmsg. [ $+ [ $nick ] ]) - $len($1-))
if ((%sub < 0) && (%sub >= $calc($repeat.difference / -1)) && ($left($1-, %sub) == %repeat.lastmsg. [ $+ [ $nick ] ])) || ($1- == %repeat.lastmsg. [ $+ [ $nick ] ]) {
if (%repeat.warnings. [ $+ [ $nick ] ] >= $repeat.warnings) {
if ($nick isop $chan) mode $chan -o $nick
ban $iif($repeat.ban.length, -u [ $+ [ $repeat.ban.length ] ]) $chan $nick $ban.type
kick $chan $nick $repeat.ban.reason $iif($show.ban.length, ( $+ $duration($repeat.ban.length) ban))
unset %repeat.warnings. [ $+ [ $nick ] ]
}
else {
inc $iif($repeat.warning.expire, -u [ $+ [ $repeat.warning.expire ] ]) %repeat.warnings. [ $+ [ $nick ] ]
kick $chan $nick $repeat.kick.reason
}
}
}
set $iif($repeat.secs, -u [ $+ [ $repeat.secs ] ]) %repeat.lastmsg. [ $+ [ $nick ] ] $1-
}

; advertise

if ($advertise.enable) {
var %a 1
while (%a <= $numtok($advertise.keywords, 44)) {
if ($trim($gettok($advertise.keywords, %a, 44)) isin $1-) {
var %advertise.override $true
}
inc %a
}
if ((($numtok($1-, 32) < $advertise.words) || (!$advertise.words)) || (%advertise.override)) && (*#* iswm $1-) {
var %a 1
while (%a <= $numtok($1-, 32)) {
if (#* iswm $gettok($1-, [ %a ], 32)) && ($gettok($1-, [ %a ], 32) != $chan) && (($len($right($gettok($1-, [ %a ], 32), -1)) > $advertise.chanlen) || (!$advertise.chanlen)) {
if (!$advertise.numbers) || ($right($gettok($1-, [ %a ], 32), -1) !isnum) {
if (%advertise.warnings. [ $+ [ $nick ] ] >= $advertise.warnings) {
if ($nick isop $chan) mode $chan -o $nick
ban $iif($advertise.ban.length, -u [ $+ [ $advertise.ban.length ] ]) $chan $nick $ban.type
kick $chan $nick $advertise.ban.reason $iif($show.ban.length, ( $+ $duration($advertise.ban.length) ban))
unset %advertise.warnings. [ $+ [ $nick ] ]
}
else {
inc $iif($advertise.warning.expire, -u [ $+ [ $advertise.warning.expire ] ]) %advertise.warnings. [ $+ [ $nick ] ]
kick $chan $nick $advertise.kick.reason
}
}
}
inc %a
}
}
}

; capitals

if ($capitals.enable) {
var %a 1
var %upper 0
while (%a <= $len($1-)) {
if ($left($right($1-, $calc($len($1-) - %a)), 1) isalpha) {
if ($left($right($1-, $calc($len($1-) - %a)), 1) === $upper($left($right($1-, $calc($len($1-) - %a)), 1))) {
inc %upper
}
inc %length
}
inc %a
}
if (%length >= $capitals.minlength) {
if ($calc(%upper / %length) >= $capitals.percentage) {
if (%capitals.warnings. [ $+ [ $nick ] ] >= $capitals.warnings) {
if ($nick isop $chan) mode $chan -o $nick
ban $iif($capitals.ban.length, -u [ $+ [ $capitals.ban.length ] ]) $chan $nick $ban.type
kick $chan $nick $capitals.ban.reason $iif($show.ban.length, ( $+ $duration($capitals.ban.length) ban))
unset %capitals.warnings. [ $+ [ $nick ] ]
}
else {
inc $iif($capitals.warning.expire, -u [ $+ [ $capitals.warning.expire ] ]) %capitals.warnings. [ $+ [ $nick ] ]
kick $chan $nick $capitals.kick.reason
}
}
}
}
}

; *** Script /end




if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }
#57131 24/10/03 04:14 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Code:
menu channel {
  .switch script $iif($group(#script) == on,off,on): $iif($group(#script) == on,.disable,.enable) #script
}

#script on
your code here
#script end 


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#57132 24/10/03 04:25 AM
Joined: Oct 2003
Posts: 143
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 143
THANKS alot that made it way way better I LOVE YOU haha j/k thanks agen.


if (Windows isin %txt.1) { /kick # $nick Windows is a badword tisk tisk tisk. }

Link Copied to Clipboard