forked from DooubleTap/mIRC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autolimit.mrc
71 lines (70 loc) · 2.92 KB
/
autolimit.mrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
;Auto-Limiter Remote Script
on *:load:{
echo -a -
echo -a You just Loaded The Channel Auto-Limit Remote.
halt
}
on *:Op:#:{
if ($opnick == $me) && ([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null) {
var %climit = [ % [ $+ [ $chan ] $+ ] .limit ]
.timer [ $+ [ $chan ] $+ ] llimit off
.timer [ $+ [ $chan ] $+ ] llimit 1 2 addlimit $chan %climit
}
}
on *:Join:#:{
if ($nick != $me) && ($me isop $chan) && ([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null) {
var %climit = [ % [ $+ [ $chan ] $+ ] .limit ]
.timer [ $+ [ $chan ] $+ ] llimit off
.timer [ $+ [ $chan ] $+ ] llimit 1 10 addlimit $chan %climit
}
}
on *:Part:#:{
if ($nick == $me) { halt }
if ($nick == $nick) && ($me isop $chan) { if ([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null) {
var %climit = [ % [ $+ [ $chan ] $+ ] .limit ]
.timer [ $+ [ $chan ] $+ ] llimit off
.timer [ $+ [ $chan ] $+ ] llimit 1 2 addlimit $chan %climit
}
}
}
on *:Quit:{
var %q = 1 | while ( %q <= $comchan($nick,0) ) {
if ([ % [ $+ [ $comchan($nick,%q) ] $+ ] .autolimit ] != $null) && ($me isop $comchan($nick,%q)) {
var %climit = [ % [ $+ [ $comchan($nick,%q) ] $+ ] .ch.limit ]
.timer [ $+ [ $comchan($nick,%q) ] $+ ] llimit off
.timer [ $+ [ $comchan($nick,%q) ] $+ ] llimit 1 2 raw -q mode $comchan($nick,%q) +l $calc(%climit - 1) }
inc %q
}
}
on *:Mode:#:{
if (l isin $1) { set % [ $+ [ $chan ] $+ ] .ch.limit $2 }
if ($nick != $me) && ($me isop $chan) {
if ([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null) {
if (l isin $1) {
inc -u10 % [ $+ [ $chan ] $+ ] .inclimit
if ([ % [ $+ [ $chan ] $+ ] .inclimit ] < 2) {
var %climit = [ % [ $+ [ $chan ] $+ ] .limit ]
.timer [ $+ [ $chan ] $+ ] llimit off
.timer [ $+ [ $chan ] $+ ] llimit 1 2 addlimit $chan %climit
}
}
}
}
}
alias addlimit { raw -q mode $$1 +l $calc($nick($$1,0) + $2) }
on 1:Kick:#:{
if ($knick != $me) && ($me isop $chan) { if ([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null) {
var %climit = [ % [ $+ [ $chan ] $+ ] .limit ]
.timer [ $+ [ $chan ] $+ ] llimit off
.timer [ $+ [ $chan ] $+ ] llimit 1 2 addlimit $chan %climit
}
}
}
menu nicklist,channel {
-
Auto-Limit( $+ $iif([ % [ $+ [ $chan ] $+ ] .autolimit ] != $null,ON + $+ [ % [ $+ [ $chan ] $+ ] .limit ] $+ $chr(41),OFF $+ $chr(41)) :{
if ([ % [ $+ [ $chan ] $+ ] .autolimit ] == $null) { var %limit = $$?="Auto Limit Float Margin (1-999):" | set % [ $+ [ $chan ] $+ ] .limit %limit | set % [ $+ [ $chan ] $+ ] .autolimit $chan | echo -a *** Turning ON the Autolimit on: $chan $+ . | if ($me isop $chan) { var %climit = [ % [ $+ [ $chan ] $+ ] .limit ] | addlimit $chan %climit } }
else { unset % [ $+ [ $chan ] $+ ] .limit % [ $+ [ $chan ] $+ ] .autolimit | echo -a *** Turning OFF the Autolimit on: $chan $+ . | if ($me isop $chan) { raw -q mode # -l } }
}
-
}