rendered paste body–alias cbedit { nndlg -m cbedit }
dialog cbedit {
title "Clipboard editor [/cbedit]"
size -1 -1 498 380
option pixels
icon script\pics\nntray.ico
edit "", 1, 2 0 494 312, multi return autohs autovs hsbar vsbar
edit "", 20, 282 316 66 22, read center
text "lines", 21, 354 320 24 14
edit "", 22, 394 316 66 22, read center
text "bytes", 23, 464 320 28 14
button "C&opy", 3, 4 352 80 24
button "&Paste", 5, 88 352 80 24
button "&Re-load", 29, 184 352 80 24
button "&Close", 4, 414 352 80 24
box "", 2, -10 338 520 80
text "Amount of data currently in the clipboard:", 24, 4 320 206 16
menu "&File", 6
item "Copy &file to clipboard", 70, 6
item "&Save clipboard to file", 30, 6
item break, 31, 6
item "C&opy data to clipboard", 11, 6
item "&Reload clipboard content", 16, 6
item break, 28, 6
item "&Close", 8, 6
menu "&Edit clipboard", 7
item "&Add line numbers", 25, 7
item break, 26, 7
item "&Remove tokens", 10, 7
item "R&emove empty lines", 31, 7
item "Remove &lines containing...", 46, 7
item "Remove lines ¬ containing...", 47, 7
item break, 32, 7
menu "Str&ip codes", 9, 7
item "&All", 12, 9
item break, 13, 9
item "&Bold", 14, 9
item "&Color", 15, 9
item "Reset", 48, 9
item "&Reverse", 17, 9
item "&Underline", 18, 9
item break, 45, 7
menu "S&ort", 38, 7
menu "&Numerical", 42, 38
item "&Ascending", 43, 42
item "&Descending", 44, 42
item "&Ascending", 39, 38
item "&Descending", 40, 38
item break, 49, 7
item "Convert to lo&wercase", 33, 7
item "Convert to u&ppercase", 34, 7
item break, 37, 7
item "&Break lines", 50, 7
item "&Trim lines", 52, 7
item break, 60, 7
item "Replace strin&g", 61, 7
item break, 51, 7
item "Searc&h", 36, 7
item "&Select all", 41, 7
item break, 35, 7
item "&Clear clipboard", 27, 7
}
alias cbedit.cpfile {
var %f = $$sfile(C:\*.txt)
loadbuf -ro cbedit 1 %f
cbedit.copy
idialog File %f copied to clipboard.
}
alias cbedit.opentmp { .fopen -o tmp script\txt\cbedit.tmp }
alias cbedit.closetmp {
loadbuf -ro cbedit 1 script\txt\cbedit.tmp
did -c cbedit 1 1
.fclose tmp
tryremove script\txt\cbedit.tmp
}
alias cbedit.cupper {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
did -a cbedit 1 $replace($upper($2-),ü,Ü,ä,Ä,ö,Ö) $+ $crlf
}
alias cbedit.clower {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
did -a cbedit 1 $replace($lower($2-),Ü,ü,Ä,ä,Ö,ö) $+ $crlf
}
alias cbedit.strip {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
if (o isin %cbedit.strip) { did -a cbedit 1 $strip($remove($2-,),%cbedit.strip) $+ $crlf }
else { did -a cbedit 1 $strip($2-,%cbedit.strip) $+ $crlf }
}
alias cbedit.break {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
var %i = 1,%z = $len($2-)
while (%i <= %z) {
did -a cbedit 1 $mid($2-,%i,%cbedit.break) $+ $crlf
inc %i %cbedit.break
}
}
alias cbedit.trim {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
did -a cbedit 1 $left($2-,%cbedit.trim) $+ $crlf
}
alias cbedit.falias {
did -h cbedit 1
filter -ink cbedit 1 $1-
did -fvc cbedit 1 1
}
alias cbedit.replace {
tokenize 32 $1-
if ($1 == 1) { did -r cbedit 1 }
did -a cbedit 1 $replace($2-,%cbedit.replace.1,%cbedit.replace.2) $+ $crlf
}
alias cbedit.paste {
if ($istok(channel query chat,$window($active).type,32)) {
window -a $active
nndll sendkey CTRL V
.timer 1 0 dialog -v cbedit
}
else { errdialog you can't paste in $active $+ ! }
}
on *:dialog:cbedit:*:*:{
if ($devent == init) {
.timercbedit.ref -imo 0 100 cbedit.refcount
cbedit.refcount
cbedit.load
}
elseif ($devent == sclick) {
if ($did == 3) { cbedit.copy }
elseif ($did == 4) { cbedit.close }
elseif ($did == 29) { cbedit.load }
elseif ($did == 5) { cbedit.paste }
}
elseif ($devent == menu) {
if ($did == 8) { cbedit.close }
elseif ($did == 70) { cbedit.cpfile }
elseif ($did == 11) { cbedit.copy }
elseif ($did == 16) { cbedit.load }
elseif ($did == 41) { did -c $dname 1 1 1 -1 }
elseif ($did == 39) { filter -ioct 1 32 $dname 1 $dname 1 }
elseif ($did == 40) { filter -iocte 1 32 $dname 1 $dname 1 }
elseif ($did == 43) { filter -ioctu 1 32 $dname 1 $dname 1 }
elseif ($did == 44) { filter -ioctue 1 32 $dname 1 $dname 1 }
elseif ($did == 46) { filter -iocx $dname 1 $dname 1 $+(*,$$eddialog(Delete all lines containing the following string:),*) }
elseif ($did == 47) { filter -ioc $dname 1 $dname 1 $+(*,$$eddialog(Delete all lines except those containing the following string:),*) }
elseif ($did == 36) {
var %s = $$eddialog(What do you want to search for?)
if ($didwm(cbedit,1,$+(*,%s,*),1)) {
var %i = $v1,%l = $pos($did(1,%i),%s,1)
did -c $dname 1 %i %l $calc(%l + $len(%s))
}
else { idialog No occurences of $qt(%s) found. }
}
elseif ($did == 34) { cbedit.falias cbedit.cupper }
elseif ($did == 33) { cbedit.falias cbedit.clower }
elseif ($did == 50) {
set %cbedit.break $$eddialog(After how many characters do you want lines to be broken up?,80)
cbedit.falias cbedit.break
unset %cbedit.break
}
elseif ($did == 52) {
set %cbedit.trim $$eddialog(After how many characters do you want lines to be trimmed?,80)
cbedit.falias cbedit.trim
unset %cbedit.trim
}
elseif ($did == 31) { filter -iocxg $dname 1 $dname 1 /^[\s]*$/ }
elseif ($did == 25) { filter -inco $dname 1 $dname 1 }
elseif ($istok(12 14 15 17 18 48,$did,32)) {
set %cbedit.strip $replace($did,12,burc,14,b,15,c,17,r,18,u,48,o)
cbedit.falias cbedit.strip
unset %cbedit.strip
}
elseif ($did == 27) {
if (!$did(cbedit,1).edited) || (($did(cbedit,1).edited) && ($ydialog(Do you really want to discard the changes you made to the clipboard?))) {
did -rj $dname 1
clipboard
}
}
elseif ($did == 10) { noop $dialog(cbedit.remtok,cbedit.remtok,-4) }
elseif ($did == 61) { noop $dialog(cbedit.replace,cbedit.replace,-4) }
elseif ($did == 30) {
var %f = $relpath($$sfile($mircdir $+ clipboard.txt,Where do you want to save the clipboard?,Save))
if (!$isfile(%f)) || ($ydialog(The file $nopath(%f) already exists! Do you want to overwrite it?)) {
did -j cbedit 1
savebuf -o $dname 1 %f
idialog Clipboard saved to %f $+ .
}
}
}
}
dialog cbedit.replace {
title "Clipboard editor - replace strings"
size -1 -1 288 90
option pixels
icon script\pics\nntray.ico
box "", 1, -6 48 302 60
text "String to be replaced", 2, 6 8 106 16
text "New string", 3, 6 32 60 16
edit "", 4, 122 4 164 22, autohs limit 100
edit "", 5, 122 28 164 22, autohs limit 100
button "&Ok", 6, 120 62 80 24, ok
button "&Cancel", 7, 204 62 80 24, cancel
}
on *:dialog:cbedit.replace:*:*:{
if ($devent == sclick) && ($did == 6) {
set %cbedit.replace.1 $did(4)
set %cbedit.replace.2 $did(5)
cbedit.falias cbedit.replace
unset %cbedit.replace.?
}
}
dialog cbedit.remtok {
title "Clipboard editor - remove tokens"
size -1 -1 240 104
option pixels
icon script\pics\nntray.ico
box "", 1, -6 62 254 62
text "Token number(s) to remove (single number or range)", 2, 6 8 140 30
text "Token separator", 3, 6 44 88 16
edit "", 4, 156 4 80 22, center
combo 5, 156 40 80 166, size edit limit 1 drop
button "&Ok", 6, 72 76 80 24
button "&Cancel", 7, 156 76 80 24, cancel
}
on *:dialog:cbedit.remtok:*:*:{
if ($devent == init) {
did -a $dname 4 1
did -a $dname 5 [tab]
var %i = 32,%z
while (%i < 256) {
%z = ""
if (%i = 32) { %z = [space] }
elseif (%i = 160) { %z = [hard space] }
else { %z = $chr(%i) }
did -a $dname 5 %z
inc %i
}
did -c $dname 5 2
}
elseif ($devent == sclick) && ($did == 6) {
if (!$regex($did(4),/^[\d\-]+$/)) { errdialog you have to enter a number or number range! }
else {
cbedit.opentmp
var %i = 1,%t = $did(cbedit,1).lines,%z,%ch = $iif($did(5).sel > 1,$calc($v1 +30),9)
while (%i <= %t) {
%z = $deltok($did(cbedit,1,%i),$did(4),%ch)
if ($spcnull(%z)) { .fwrite -n tmp $cr }
else { .fwrite -n tmp %z }
inc %i
}
dialog -c $dname
cbedit.closetmp
}
}
}
alias cbedit.copy {
did -fj cbedit 1
nndll copyselctrl
.timer 1 0 cbedit.refcount
}
alias cbedit.refcount {
if ($dialog(cbedit)) {
if (!$cb(0).len) { did -ra cbedit 20,22 0 }
else {
if ($did(cbedit,20) != $bytes($cb(0),b)) { did -ra cbedit 20 $v2 }
if ($did(cbedit,22) != $bytes($cb(0).len,b)) { did -ra cbedit 22 $v2 }
}
}
else { .timercbedit.ref off }
}
alias cbedit.load {
if (!$did(cbedit,1).edited) || (($did(cbedit,1).edited) && ($ydialog(Do you really want to discard the changes you made to the clipboard?))) {
did -rf $dname 1
nndll sendkey CTRL V
.timer 1 0 cbedit.refcount $chr(124) did -j $dname 1 $chr(124) did -c $dname 1 1
}
}
alias cbedit.close {
if ($did(cbedit,1).edited) { if ($ydialog(Do you really want to discard the changes you made to the clipboard?)) { dialog -x cbedit } }
else { dialog -x cbedit }
}
; ––––––––––––––––––––––––––––––––––––––––
; NoNameScript v4.1 - channel central - coded by greeny & mute
; Don't edit anything in here unless you REALLY know what you're doing!
; ––––––––––––––––––––––––––––––––––––––––
alias cc {
if ($1 == -t) { var %c = $iif($2 ischan,$2,$active) }
else { var %c = $iif($1 ischan,$1,$active) }
if ($status == connected) {
if (%c ischan) {
if ($me ison %c) {
set %chancentral.chan %c
set %chancentral.cid $cid
set %chancentral.stt $iif($1 == -t,1,0)
noop $dialog(chancentral,chancentral,-4)
}
else { thmerror -a You are currently not in $thmhl(%c) $+ . }
}
else { thmerror -a This feature is only available on channels. }
}
else { thmerror -a You are not connected to the server. }
}
dialog chancentral {
title %chancentral.chan channel central [/cc]
size -1 -1 478 448
option pixels
icon script\pics\nntray.ico, 0
tab "Channel modes", 16, 4 4 468 348
box "General information", 38, 13 31 432 120, tab 16
text "Active channel", 44, 23 51 82 14, tab 16
edit "", 48, 173 47 264 22, tab 16 read autohs
text "Active server/network", 51, 23 75 116 14, tab 16
edit "", 50, 173 71 264 22, tab 16 read autohs
text "Current modes", 39, 23 99 82 14, tab 16
edit "", 40, 173 95 264 22, tab 16 read autohs
text "Available modes", 41, 23 123 86 14, tab 16
edit + $+ $chanmodes, 42, 173 119 264 22, tab 16 read autohs
box "Default channel modes", 24, 13 159 212 180, tab 16
check "&Limit to", 26, 23 179 58 18, tab 16
edit "", 27, 83 177 78 22, disable tab 16 limit 5
check "&Key", 29, 23 201 44 18, tab 16
edit "", 30, 83 199 130 22, disable tab 16 pass autohs limit 30
edit "", 130, 83 199 130 22, disable tab 16 autohs limit 30
check "&Only ops set topic", 31, 23 223 112 18, tab 16
check "&No external messages", 32, 23 241 132 18, tab 16
check "&Invite only", 33, 23 259 74 18, tab 16
check "&Moderated", 36, 23 277 78 18, tab 16
check "&Private", 35, 23 295 58 18, tab 16
check "S&ecret", 34, 23 313 58 18, tab 16
list 25, 244 177 108 150, tab 16 size
text "users", 28, 169 181 30 14, tab 16
box "Other channel modes", 23, 232 159 132 180, tab 16
tab "Bans", 17
list 6, 9 33 455 292, tab 17 size
text "Current/maximum bans:", 45, 11 329 122 14, tab 17
text "", 49, 155 329 290 14, tab 17 right
text "", 21, 7 155 444 44, hide tab 17 center
tab "Invites", 18
list 54, 9 33 455 292, tab 18 size
text "Current invites:", 63, 11 329 84 14, tab 18
text "unknown", 62, 155 329 290 14, tab 18 right
text "", 20, 7 155 444 44, hide tab 18 center
tab "Excepts", 43
list 55, 9 33 455 292, tab 43 size
text "Current excepts:", 65, 11 329 88 14, tab 43
text "unknown", 64, 155 329 290 14, tab 43 right
text "", 22, 7 155 444 44, hide tab 43 center
tab "Topic", 52
text "Topics", 4, 23 51 34 16, tab 52
box "Topic history", 14, 13 31 452 62, tab 52
combo 5, 88 47 368 120, tab 52 drop
text "Set on", 10, 23 71 36 14, tab 52
box "Current topic", 15, 13 99 452 242, tab 52
edit "", 13, 23 115 434 80, tab 52 multi vsbar limit 600
button "", 8, 23 199 434 100, tab 52
text "Characters available:", 1, 23 305 106 14, tab 52
text "", 2, 23 321 431 12, tab 52
text "", 3, 147 305 308 14, tab 52 right
text "<no topic selected>", 11, 87 71 348 14, tab 52 right
button "Clear history", 12, 3 355 80 24, tab 52
button "Set w/ &Q", 9, 87 355 80 24, tab 52
button "&Set", 7, 171 355 80 24, tab 52 ok
tab "Statistics", 53
list 46, 9 33 455 214, disable tab 53 size
list 47, 9 249 455 94, disable tab 53 size
button "&Ok", 19, 310 354 80 24, ok
button "&Cancel", 37, 394 354 80 24, cancel
icon 56, 4 384 468 60
text "Loading...", 57, 216 403 49 16
}
alias cc.refmodes {
var %i = 1,%z = $gettok($chanmodes,-1,44)
while ($mid(%z,%i,1)) {
if ($regex(cm,$v1,/([^tnimpslkbe])/)) { did -a $dname 25 1 + 0 0 $iif($regml(cm,1) isincs $wd($chan(%chancentral.chan).mode,1),2,1) + $+ $regml(cm,1) }
inc %i
}
var %x = $wd($chan(%chancentral.chan).mode,1)
if (t isincs %x) { did -c $dname 31 }
if (n isincs %x) { did -c $dname 32 }
if (i isincs %x) { did -c $dname 33 }
if (m isincs %x) { did -c $dname 36 }
if (p isincs %x) { did -c $dname 35 }
if (s isincs %x) { did -c $dname 34 }
if (l isincs %x) {
did -c $dname 26
did -ae $dname 27 $chan(%chancentral.chan).limit
}
if (k isincs %x) {
did -c $dname 29
did -ae $dname 130,30 $chan(%chancentral.chan).key
did -h $dname $iif($gettok($readini($mircini,options,n7),7,44),130,30)
}
}
alias cc.getbans {
did -ra chancentral 6 Refreshing bans...
did -ra chancentral 49 unknown/ $+ $iif(%maxbans. [ $+ [ $cid ] ],$v1,unknown)
set -u100 %chancentral.getbans %chancentral.chan
mode %chancentral.chan +b
}
alias cc.refbans {
var %c = %chancentral.chan,%i = $ibl(%c,0),%t = %i
if (%i) {
window -h @loadbans
while (%i) {
tokenize 33 $ibl(%c,%i).by
echo @loadbans 1 + 0 0 0 $ibl(%c,%i) $+ + 0 0 0 $1 $iif($2,$nbr($2)) $+ + 0 0 0 $asctime($ibl(%c,%i).ctime,dd/mm/yyyy HH:nn)
dec %i
}
filter -cwo @loadbans chancentral 6
close -@ @loadbans
}
else { did -ra chancentral 6 1 + 0 0 0 No bans set. }
if (%maxbans. [ $+ [ $cid ] ]) { did -ra chancentral 49 $+(%t,/,$v1) }
else { did -ra chancentral 49 %t $+ /unknown }
cc.checkop
}
alias cc.getinvites {
did -ra chancentral 54 Refreshing invites...
did -ra chancentral 62 unknown
set -u100 %chancentral.getinvites %chancentral.chan
mode %chancentral.chan +I
}
alias cc.refinvites {
var %c = %chancentral.chan,%i = $iil(%c,0),%t = %i
if (%i) {
window -h @loadinvites
while (%i) {
tokenize 33 $iil(%c,%i).by
echo @loadinvites 1 + 0 0 0 $iil(%c,%i) $+ + 0 0 0 $1 $iif($2,$nbr($2)) $+ + 0 0 0 $asctime($iil(%c,%i).ctime,dd/mm/yyyy HH:nn)
dec %i
}
filter -cwo @loadinvites chancentral 54
close -@ @loadinvites
}
else { did -ra chancentral 54 1 + 0 0 0 No invites set. }
did -ra chancentral 62 %t $+ /unknown
cc.checkop
}
alias cc.getexcepts {
did -ra chancentral 55 Refreshing excepts...
did -ra chancentral 64 unknown
set -u100 %chancentral.getexcepts %chancentral.chan
mode %chancentral.chan +e
}
alias cc.refexcepts {
var %c = %chancentral.chan,%i = $iel(%c,0),%t = %i
if (%i) {
window -h @loadexcepts
while (%i) {
tokenize 33 $iel(%c,%i).by
echo @loadexcepts 1 + 0 0 0 $iel(%c,%i) $+ + 0 0 0 $1 $iif($2,$nbr($2)) $+ + 0 0 0 $asctime($iel(%c,%i).ctime,dd/mm/yyyy HH:nn)
dec %i
}
filter -cwo @loadexcepts chancentral 55
close -@ @loadexcepts
}
else { did -ra chancentral 55 1 + 0 0 0 No excepts set. }
did -ra chancentral 64 %t $+ /unknown
cc.checkop
}
raw 367:*:{
if (%chancentral.getbans == $2) {
haltdef
if ($dialog(chancentral)) {
if (* Refreshing bans... * iswm $did(chancentral,6,2)) { did -d chancentral 6 2 }
did -a chancentral 6 0 + 0 0 0 $3 $+ + 0 0 0 $4 $+ + 0 0 0 $asctime($5,dd/mm/yyyy HH:nn)
}
}
}
raw 368:*:{
if (%chancentral.getbans == $2) {
haltdef
unset %chancentral.getbans
if ($dialog(chancentral)) {
if ($did(chancentral,6).lines == 2) && (* Refreshing bans... * iswm $did(chancentral,6,2)) {
did -ra chancentral 6 1 + 0 0 0 No bans set.
did -ra chancentral 49 0/ $+ $iif(%maxbans. [ $+ [ $cid ] ],$v1,unknown)
}
else { did -ra chancentral 49 $calc($did(chancentral,6).lines -1) $+ / $+ $iif(%maxbans. [ $+ [ $cid ] ],$v1,unknown) }
set %chancentral.bansrefreshed 1
}
}
}
raw 346:*:{
if (%chancentral.getinvites == $2) {
haltdef
if ($dialog(chancentral)) {
if (* Refreshing invites... * iswm $did(chancentral,54,2)) { did -d chancentral 54 2 }
did -a chancentral 54 0 + 0 0 0 $3 $+ + 0 0 0 $4 $+ + 0 0 0 $asctime($5,dd/mm/yyyy HH:nn)
}
}
}
raw 347:*:{
if (%chancentral.getinvites == $2) {
haltdef
unset %chancentral.getinvites
if ($dialog(chancentral)) {
if ($did(chancentral,54).lines == 2) && (* Refreshing invites... * iswm $did(chancentral,54,2)) {
did -ra chancentral 54 1 + 0 0 0 No invites set.
did -ra chancentral 62 0
}
else { did -ra chancentral 62 $calc($did(chancentral,54).lines -1) }
set %chancentral.invitesrefreshed 1
}
}
}
raw 348:*:{
if (%chancentral.getexcepts == $2) {
haltdef
if ($dialog(chancentral)) {
if (* Refreshing excepts... * iswm $did(chancentral,55,2)) { did -d chancentral 55 2 }
did -a chancentral 55 0 + 0 0 0 $3 $+ + 0 0 0 $4 $+ + 0 0 0 $asctime($5,dd/mm/yyyy HH:nn)
}
}
}
raw 349:*:{
if (%chancentral.getexcepts == $2) {
haltdef
unset %chancentral.getexcepts
if ($dialog(chancentral)) {
if ($did(chancentral,55).lines == 2) && (* Refreshing excepts... * iswm $did(chancentral,55,2)) {
did -ra chancentral 55 1 + 0 0 0 No excepts set.
did -ra chancentral 64 0
}
else { did -ra chancentral 64 $calc($did(chancentral,55).lines -1) }
set %chancentral.exceptsrefreshed 1
}
}
}
alias cc.remselmodes {
if ($1 == -b) { var %did = 6,%md = b }
elseif ($1 == -I) { var %did = 54,%md = I }
elseif ($1 == -e) { var %did = 55,%md = e }
var %r,%d = $did(chancentral,%did).lines
while (%d > 1) {
var %h = $did(chancentral,%did,%d)
if (s isin $wd(%h,2)) { %r = %r $gettok($wd(%h,6),1,9) }
if ($numtok(%r,32) == $modespl) {
mode %chancentral.chan - $+ $str(%md,$numtok(%r,32)) %r
%r = ""
}
dec %d
}
if (%r) { mode %chancentral.chan - $+ $str(%md,$numtok(%r,32)) %r }
}
alias cc.clearmodes {
if ($1 == -b) { var %did = 6,%md = b }
elseif ($1 == -I) { var %did = 54,%md = I }
elseif ($1 == -e) { var %did = 55,%md = e }
var %r,%d = $did(chancentral,%did).lines
while (%d > 1) {
%r = %r $gettok($wd($did(chancentral,%did,%d),6),1,9)
if ($numtok(%r,32) == $modespl) {
mode %chancentral.chan - $+ $str(%md,$numtok(%r,32)) %r
%r = ""
}
dec %d
}
if (%r) { mode %chancentral.chan - $+ $str(%md,$numtok(%r,32)) %r }
}
on *:dialog:chancentral:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 2 ProgressBar smooth > script\dlls\ctl_gen.mdx
mdx SetControlMDX $dname 6,54,55 ListView report showsel rowselect labeltip editlabels > script\dlls\views.mdx
mdx SetControlMDX $dname 25 ListView report showsel labeltip checkboxes noheader > script\dlls\views.mdx
mdx SetControlMDX $dname 46 ListView report showsel rowselect labeltip > script\dlls\views.mdx
mdx SetControlMDX $dname 47 ListView report showsel rowselect labeltip noheader > script\dlls\views.mdx
mdx SetFont $dname 13 - $+ $window(Status Window).fontsize 300 $window(Status Window).font
did -a $dname 40 $iif($chan(%chancentral.chan).mode,$v1,none)
did -a $dname 48 %chancentral.chan $nbr($nick(%chancentral.chan,0) users)
did -a $dname 50 $iif($network,$network $nbr($server),$server)
did -i $dname 6,54,55 1 headerdims 220:1 80:2 110:3
did -i $dname 6,54,55 1 headertext + 0 Address + 0 Set by + 0 Date
did -i $dname 25 1 headerdims 80:1
did -i $dname 47 1 headerdims 200:1 60:2 60:3
did -i $dname 47 1 headertext + 0 a + 0 b + 0 c
did -i $dname 46 1 headerdims 40:1 30:2 80:3 80:4 80:5 60:6 110:7 80:8 50:9 50:10
did -i $dname 46 1 headertext + 0 User number + 0 Status + 0 Nick + 0 Auth + 0 Name + 0 Ident + 0 Host + 0 IP + 0 Away + 0 IrcOp
did -i $dname 6,25,46,47,54,55 1 settxt bgcolor none
set %chancentral.oldtab 16
did -ra $dname 49 unknown/ $+ $iif(%maxbans. [ $+ [ $cid ] ],$v1,unknown)
ppwin $dname 8
if (Q !ison %chancentral.chan) { did -b $dname 9 }
did -a $dname 13 $chan(%chancentral.chan).topic
topic.crev
prevtopic
var %i = $hfind(topichist,$+($network,%chancentral.chan,$cr,*),0,w),%r,%z = 1,%g,%n = $nick(%chancentral.chan,0),%cm = $gettok($chanmodes,1,44)
while (%i) {
%r = $addtok(%r,$hget(topichist,$hfind(topichist,$+($network,%chancentral.chan,$cr,*),%i,w)) %i,124)
dec %i
}
%r = $sorttok(%r,124)
while ($gettok(%r,%z,124)) {
tokenize 32 $v1
did -i $dname 5 1 $+($decode($gettok($hfind(topichist,$+($network,%chancentral.chan,$cr,*),$2,w),2,13),m),$str( ,150),$1)
inc %z
}
cc.refmodes
cc.checkop
did -a $dname 47 1 + 0 0 0 Total users on the channel + 0 0 0 %n
did -a $dname 47 1 + 0 0 0 Operators + 0 0 0 $nick(%chancentral.chan,0,o) $+ + 0 0 0 $percent($nick(%chancentral.chan,0,o),%n,1)
did -a $dname 47 1 + 0 0 0 Voiced users + 0 0 0 $nick(%chancentral.chan,0,v) $+ + 0 0 0 $percent($nick(%chancentral.chan,0,v),%n,1)
did -a $dname 47 1 + 0 0 0 Regulars + 0 0 0 $nick(%chancentral.chan,0,r) $+ + 0 0 0 $percent($nick(%chancentral.chan,0,r),%n,1)
did -a $dname 47 1 + 0 0 0 Away users + 0 0 0 0 + 0 0 0 0%
did -a $dname 47 1 + 0 0 0 IRC operators + 0 0 0 0 + 0 0 0 0%
if (%chancentral.stt) {
var %x = $dialog($dname).x,%y = $dialog($dname).y
dialog -sp $dname -1000 -1000 -1 -1
.timer 1 0 did -f $dname 52 $chr(124) dialog -sp $dname %x %y -1 -1
}
if (b !isincs %cm) {
did -h $dname 6,45,49
did -vra $dname 21 Bans are not supported on $iif($network,$v1,$server) $+ .
}
if (I !isincs %cm) {
did -h $dname 54,62,63
did -vra $dname 20 Invites are not supported on $iif($network,$v1,$server) $+ .
}
if (e !isincs %cm) {
did -h $dname 55,64,65
did -vra $dname 22 Excepts are not supported on $iif($network,$v1,$server) $+ .
}
loadbanner cc chancentral 57 56
}
elseif ($devent == edit) {
if ($did == 13) {
topic.crev
if ($did(3) < 0) { mdx SetColor 3 text 255 }
else { mdx SetColor 3 text reset }
prevtopic
}
elseif ($did == 27) { numonlyedit $dname $did }
}
elseif ($devent == sclick) {
if ($istok(46 47 6 25 54 55,$did,32)) { sortmdx }
if ($did == 46) {
tokenize 32 $did($did,1)
if ($1 == rclick) {
var %o = $iif(!$ccontrol(%chancentral.chan),+d,+),%n = $cell($did,3)
popdll.new popup
popdll.add popup +d 0 0 — $shorten(10,%n) —
popdll.add popup
popdll.add popup + 0 0 Whois $cr we %n
popdll.add popup
popdll.add popup %o 0 0 Kick $cr k %chancentral.chan %n
popdll.add popup %o 0 0 Kickban $cr kb %chancentral.chan %n
popdll.add popup %o 0 0 Timekickban $cr tkb %chancentral.chan %n
popdll.disp popup
}
}
elseif ($did == 56) { url -n $read(script\pics\banner_cc_link.txt,n) }
elseif ($did == 6) {
var %r
if ($did($did).sel) && (* No bans set.* !iswm $did($did).seltext) && ($ccontrol(%chancentral.chan)) { %r = 1 }
if (beginlabeledit * iswm $did($did,1)) && (!$did(20).enabled) { did -i $dname $did 1 cancel }
elseif (endlabeledit * iswm $did($did,1)) { cc.chgban $cell($did,1) $wd($did($did,1),3-) }
else { cc.checkop }
if (rclick * iswm $did($did,1)) {
tokenize 47 $did(49)
popdll.new popup
if (%r) {
popdll.add popup +d 0 0 — $shorten(10,$cell($did,1)) —
popdll.add popup
}
popdll.add popup $iif($1 == $2,+d,+) 0 0 &Add ban... $cr cc.addban
popdll.add popup $iif(%r,+,+d) 0 0 &Edit ban... $cr cc.chgban $cell($did,1) -e
popdll.add popup
popdll.add popup $iif(%r,+,+d) 0 0 &Remove ban(s) $cr cc.remselmodes -b
popdll.add popup $iif($1 && %r,+,+d) 0 0 &Clear ban(s) $cr cc.clearmodes -b
popdll.disp popup
}
}
elseif ($did == 54) {
var %r
if ($did($did).sel) && (* No invites set.* !iswm $did($did).seltext) && ($ccontrol(%chancentral.chan)) { %r = 1 }
if (beginlabeledit * iswm $did($did,1)) && (!$did(57).enabled) { did -i $dname $did 1 cancel }
elseif (endlabeledit * iswm $did($did,1)) { cc.chginvite $cell($did,1) $wd($did($did,1),3-) }
else { cc.checkop }
if (rclick * iswm $did($did,1)) {
popdll.new popup
if (%r) {
popdll.add popup +d 0 0 — $shorten(10,$cell($did,1)) —
popdll.add popup
}
popdll.add popup + 0 0 &Add invite... $cr cc.addinvite
popdll.add popup $iif(%r,+,+d) 0 0 &Edit invite... $cr cc.chginvite $cell($did,1) -e
popdll.add popup
popdll.add popup $iif(%r,+,+d) 0 0 &Remove invite(s) $cr cc.remselmodes -I
popdll.add popup $iif($did(62),+,+d) 0 0 &Clear invite(s) $cr cc.clearmodes -I
popdll.disp popup
}
}
elseif ($did == 55) {
var %r
if ($did($did).sel) && (* No excepts set.* !iswm $did($did).seltext) && ($ccontrol(%chancentral.chan)) { %r = 1 }
if (beginlabeledit * iswm $did($did,1)) && (!$did(60).enabled) { did -i $dname $did 1 cancel }
elseif (endlabeledit * iswm $did($did,1)) { cc.chgexcept $cell($did,1) $wd($did($did,1),3-) }
else { cc.checkop }
if (rclick * iswm $did($did,1)) {
popdll.new popup
if (%r) {
popdll.add popup +d 0 0 — $shorten(10,$cell($did,1)) —
popdll.add popup
}
popdll.add popup + 0 0 &Add except... $cr cc.addexcept
popdll.add popup $iif(%r,+,+d) 0 0 &Edit except... $cr cc.chgexcept $cell($did,1) -e
popdll.add popup
popdll.add popup $iif(%r,+,+d) 0 0 &Remove except(s) $cr cc.remselmodes -e
popdll.add popup $iif($did(64),+,+d) 0 0 &Clear except(s) $cr cc.clearmodes -e
popdll.disp popup
}
}
elseif ($did == 12) {
if ($ydialog(Do you really want to clear the topic history?)) {
did -r $dname 5
did -ra $dname 11 <no topic selected>
hdel -w topichist *
}
}
elseif ($did == 17) {
if (b isincs $gettok($chanmodes,1,44)) {
if ($chan(%chancentral.chan).ibl == $true) { cc.refbans }
else { cc.getbans }
}
}
elseif ($did == 18) {
if (I isincs $gettok($chanmodes,1,44)) {
if ($chan(%chancentral.chan).iil == $true) { cc.refinvites }
else { cc.getinvites }
}
}
elseif ($did == 56) { cc.getinvites }
elseif ($did == 43) {
if (e isincs $gettok($chanmodes,1,44)) {
if ($chan(%chancentral.chan).iel == $true) { cc.refexcepts }
else { cc.getexcepts }
}
}
elseif ($did == 59) { cc.getexcepts }
elseif ($did == 53) {
if (!%chancentral.statsdone) {
if (!$remc(who)) {
set %chanstats. $+ $cid %chancentral.chan
set %chancentral.statsdone 1
who %chancentral.chan $iif($q.net || $u.net,% $+ acfhinru)
}
else {
idialog there is already another /who request going on. Please wait for it to finish before trying to refresh the channel statistics.
did -f $dname %chancentral.oldtab
return
}
}
}
elseif ($did == 26) { did $iif($did($did).state,-e,-b) $dname 27 }
elseif ($did == 29) { did $iif($did($did).state,-e,-b) $dname 130,30 }
elseif ($did == 5) {
var %t = $gettok($did($did),-1,160)
did -ra $dname 13 $deltok($did($did),-1,160)
did -ra $dname 11 $longtime(%t) $nbr($sduration($calc($ctime - %t)).nosec ago)
topic.crev
if ($did(3) < 0) { mdx SetColor 3 text 255 }
else { mdx SetColor 3 text reset }
prevtopic
}
elseif ($istok(7 9,$did,32)) {
var %c = %chancentral.chan,%z = $edtxt($dname,13)
if ($did == 9) { .msg q settopic %c $iif(%z,%z,) }
else { .raw topic %c : $+ %z }
}
elseif ($did == 20) { cc.chgban $cell(6,1) -e }
elseif ($did == 57) { cc.chginvite $cell(54,1) -e }
elseif ($did == 60) { cc.chgexcept $cell(55,1) -e }
elseif ($did == 21) { cc.remselmodes -b }
elseif ($did == 58) { cc.remselmodes -I }
elseif ($did == 61) { cc.remselmodes -e }
elseif ($did == 22) { cc.getbans }
elseif ($did == 19) {
var %a = %chancentral.chan,%i = $did(25).lines,%r,%d,%m = $wd($chan(%a).mode,1),%z,%j = 1
while (%i > 1) {
tokenize 32 $gettok($did(25,%i),1,9)
var %z = $mid($6,2)
if ($5 == 2) { if (%z !isincs %m) { %r = $+(%r,$iif(!%r,+),%z) } }
elseif (%z isincs %m) { %d = $+(%d,$iif(!%d,-),%z) }
if ($regex(%r $+ %d,/[a-zA-Z]/g) >= $modespl) {
mode %chancentral.chan %r $+ %d
var %r = "",%d = ""
}
dec %i
}
if ($did(26).state) { if (l !isincs %m) || ($chan(%a).limit != $did(27)) { mode %a +l $did(27) } }
elseif (l isincs %m) { %d = $+(%d,$iif(!%d,-),l) }
if ($did(29).state) {
var %z = $iif($did(30).visible,$did(30),$did(130))
if (%z != $null) && ((k !isincs %m) || ($chan(%a).key != %z)) {
if (k isincs %m) { mode %a -k $chan(%a).key }
mode %a +k %z
}
}
elseif (k isincs %m) { mode %a -k $chan(%a).key }
while ($wd(31 t 32 n 33 i 36 m 35 p 34 s,$+(%j,-,$calc(%j +1)))) {
tokenize 32 $v1
if ($did($1).state) { if ($2 !isincs %m) { %r = $+(%r,$iif(!%r,+),$2) } }
elseif ($2 isincs %m) { %d = $+(%d,$iif(!%d,-),$2) }
if ($regex(%r $+ %d,/[a-zA-Z]/g) >= $modespl) {
mode %chancentral.chan %r $+ %d
var %r = "",%d = ""
}
inc %j 2
}
if (%r) || (%d) { mode %a %r $+ %d }
if ($edtxt($dname,13) !== $chan(%a).topic) { topic %a $v1 }
}
if ($istok(16 17 18 43 52 53,$did,32)) { set %chancentral.oldtab $dialog($dname).tab }
}
elseif ($devent == dclick) && ($istok(6 54 55,$did,32)) { did -i $dname $did 1 labeledit begin $did($did).sel }
elseif ($devent == close) {
unset %modedsp. [ $+ [ %chancentral.cid ] $+ ] . [ $+ [ %chancentral.chan ] ]
unset %chancentral.oldtab %chancentral.cid %chancentral.chan %chancentral.statsdone %chancentral.invitesrefreshed %chancentral.exceptsrefreshed %chancentral.bansrefreshed
if ($sock(loadbanner)) { .sockclose loadbanner }
}
}
alias cc.addban { mode %chancentral.chan +b $$eddialog(Please enter a ban mask in nick!ident@host.com format.) }
alias cc.addexcept { mode %chancentral.chan +e $$eddialog(Please enter an except mask in nick!ident@host.com format.) }
alias cc.addinvite { mode %chancentral.chan +I $$eddialog(Please enter an invite mask in nick!ident@host.com format.) }
alias chanstats.add {
if ($1 == -l) { var %a = unknown,%h = $4,%p = unknown }
else { var %a = $iif($8,$8,n/a),%h = $5,%p = $iif($4 == 127.0.0.1,unknown,$4) }
var %w = $iif(G isincs $7,Yes,No),%o = $iif(* isin $7,Yes,No)
if (G isincs $7) {
var %z = $calc($wd($gettok($did(chancentral,47,6),2,9),5) +1)
did -o chancentral 47 6 1 + 0 0 0 Away users + 0 0 0 %z $+ + 0 0 0 $percent(%z,$nick($2,0),1)
}
if (* isin $7) {
var %y = $calc($wd($gettok($did(chancentral,47,7),2,9),5) +1)
did -o chancentral 47 7 1 + 0 0 0 IRC operators + 0 0 0 %y $+ + 0 0 0 $percent(%y,$nick($2,0),1)
}
did -a chancentral 46 1 + 0 0 0 $did(chancentral,46).lines $+ . + 0 0 0 $iif($6 !isreg $2,$left($nick($2,$6).pnick,1)) $+ + 0 0 0 $6 $+ + 0 0 0 %a $+ + 0 0 0 $strip($9-) $+ + 0 0 0 $3 $+ + 0 0 0 %h $+ + 0 0 0 %p $+ + 0 0 0 %w $+ + 0 0 0 %o
}
on *:op:%chancentral.chan:{ if (%chancentral.cid == $cid) && ($opnick == $me) { cc.checkop } }
on *:deop:%chancentral.chan:{ if (%chancentral.cid == $cid) && ($opnick == $me) { cc.checkop } }
on *:help:%chancentral.chan:{ if (%chancentral.cid == $cid) && ($hnick == $me) { cc.checkop } }
on *:dehelp:%chancentral.chan:{ if (%chancentral.cid == $cid) && ($hnick == $me) { cc.checkop } }
on *:usermode:{ if (%chancentral.cid == $cid) && (%chancentral.chan) { cc.checkop } }
on *:part:%chancentral.chan:{
if (%chancentral.cid == $cid) && ($nick == $me) {
dialog -c chancentral
.timer 1 0 errdialog you have been kicked out of $chan $+ , closing channel central...
}
}
on *:kick:%chancentral.chan:{
if (%chancentral.cid == $cid) && ($knick == $me) {
dialog -c chancentral
.timer 1 0 errdialog you have been kicked out of $chan $+ , closing channel central...
}
}
on *:rawmode:%chancentral.chan:{
if (b isincs $1) { cc.refbans }
if (e isincs $1) { cc.refexcepts }
if (I isincs $1) { cc.refinvites }
}
raw 315:*:{
if (%chanstats. [ $+ [ $cid ] ] == $2) {
haltdef
unset %chanstats. $+ $cid
if ($dialog(chancentral)) { did -e chancentral 46,47 }
}
}
raw 333:*:{ topic.shist $2 $4 $chan($2).topic }
raw 352:*:{
if (%chanstats. [ $+ [ $cid ] ] == $2) {
haltdef
if ($dialog(chancentral)) { chanstats.add -l $2- }
}
}
raw 354:*:{
if (%chanstats. [ $+ [ $cid ] ] == $2) {
haltdef
if ($dialog(chancentral)) { chanstats.add -a $2- }
}
}
alias cc.chgban {
if ($2 == -e) { tokenize 32 $1 $$eddialog(Please enter the changed ban.,$1) }
if ($1 != $2) { mode %chancentral.chan -b+b $1-2 }
}
alias cc.chginvite {
if ($2 == -e) { tokenize 32 $1 $$eddialog(Please enter the changed invite.,$1) }
if ($1 != $2) { mode %chancentral.chan -I+I $1-2 }
}
alias cc.chgexcept {
if ($2 == -e) { tokenize 32 $1 $$eddialog(Please enter the changed except.,$1) }
if ($1 != $2) { mode %chancentral.chan -e+e $1-2 }
}
alias topic.crev {
var %z = $edlen(chancentral,13),%t = $topiclen,%v = $calc(%t - %z)
if (%t) {
did -ra chancentral 3 $+(%v,/,%t) $nbr($round($calc(%v / %t *100),0) $+ %)
did -a chancentral 2 %z 0 %t
}
else {
did -ra chancentral 3 unknown
did -a chancentral 2 0 0 1
}
}
alias topiclen { return $iif(%topiclen. [ $+ [ $cid ] ],$v1,0) }
alias prevtopic {
var %i = 0,%w = @sprev.chancentral.8,%y = 1,%t = $edtxt(chancentral,13),%f = $window(%chancentral.chan).font,%s = $window(%chancentral.chan).fontsize,%h = $calc($height(%t,%f,%s) +1)
drawrect -nf %w $color(back) 1 0 0 $window(%w).w $window(%w).h
if (%t != $null) {
while (%y < $window(%w).h) {
drawtext -npb %w $color(topic) $color(back) $qt(%f) %s $calc(2-(%i *($window(%w).w -6))) %y %t
inc %y %h
inc %i
}
drawrect -n %w $color(back) 2 0 0 $calc($window(%w).w -2) $calc($window(%w).h -2)
}
drawdot %w
}
alias cc.checkop {
var %z = 7 $+ $chr(44)
if (t !isincs $wd($chan(%chancentral.chan).mode,1)) {
did -e chancentral 7
%z = ""
}
if ($ccontrol(%chancentral.chan)) { did -e chancentral 7,19 }
else { did -b chancentral %z $+ 19 }
}
alias topic.shist {
if ($encode($3-,m)) {
var %t = $v1,%h = $+($network,$1,$cr,%t)
if ($1 == %chancentral.chan) && (!$hget(topichist,%h)) { did -i chancentral 5 1 $+($3-,$str( ,150),$2) }
hadd -m topichist %h $2
}
if ($hfind(topichist,$+($network,$1,$cr,*),0,w) > 50) {
var %i = $v1,%l = $ctime,%r
while (%i) {
var %h = $hfind(topichist,$+($network,$1,$cr,*),%i,w)
if ($hget(topichist,%h) < %l) { var %l = $v1,%r = %h }
dec %i
}
hdel topichist %r
}
}
on *:dialog:cprot.*.edit:sclick:7:{
tokenize 32 $did($did,1)
if (slclick select * iswm $1-) {
if ($5) { did -e $dname 11 }
else { did -b $dname 11,30 }
if ($5) && (!$6) { did -e $dname 30 }
else { did -b $dname 30 }
}
}
on *:dialog:cprot.*.edit:sclick:30:{
did -i $dname 7 1 page select
did -i $dname 7 1 cb root $wd($did(7,1),4-5)
set %cprot.editaction $gettok($wd($prot.svac,$calc($wd($did(7,1),5) -1)),2-,58)
noop $dialog(cp.actionadd,cp.actionadd,-4)
unset %cprot.editaction
}
on *:dialog:cprot.*.edit:sclick:11:{ prot.delocc }
on *:dialog:cprot.*.edit:sclick:15:{ prot.addocc }
dialog cprot.ctcpflood.edit,cprot.join-/partflood.edit,cprot.mass-deop.edit,cprot.noticeflood.edit,cprot.repeating.edit,cprot.textflood.edit {
title "Edit channel protection"
size -1 -1 248 266
option pixels
icon script\pics\nntray.ico
box "", 1, 4 2 240 86
check "&Enable protection", 14, 12 20 108 18
text "Times", 2, 32 42 32 16
text "Seconds", 3, 32 64 46 16
edit "", 5, 118 38 118 22, limit 3
edit "", 6, 118 60 118 22, limit 3
list 7, 12 112 142 112, size
box "Actions to perform", 4, 4 96 240 136
button "&Add occasion", 15, 158 114 76 24
button "&Edit actions", 30, 158 138 76 24, disable
button "&Remove", 11, 158 168 76 24, disable
button "&Ok", 8, 80 238 80 24
button "&Cancel", 9, 164 238 80 24, cancel
}
on *:dialog:cprot.ctcpflood.edit:*:*:{ cprot.genflooddlg }
on *:dialog:cprot.join-/partflood.edit:*:*:{ cprot.genflooddlg }
on *:dialog:cprot.mass-deop.edit:*:*:{ cprot.genflooddlg }
on *:dialog:cprot.noticeflood.edit:*:*:{ cprot.genflooddlg }
on *:dialog:cprot.repeating.edit:*:*:{ cprot.genflooddlg }
on *:dialog:cprot.textflood.edit:*:*:{ cprot.genflooddlg }
alias cprot.genflooddlg {
if ($devent == init) {
mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx
cprot.edload
did -a $dname 1 $cell(settings,115,1) protection $nbr($did(settings,112).seltext)
cprot.chkstate 2,3,4,5,6,7,15
}
elseif ($devent == sclick) {
if ($did == 8) {
if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) {
cprot.edsave
dialog -c $dname
}
else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! }
}
elseif ($did == 14) {
if ($did($did).state) {
did -e $dname 2,5,7,4,15
if ($did(5) != 1) { did -e $dname 3,6 }
}
else { did -b $dname 2,3,5,6,7,4,11,15 }
did -u $dname 7
}
}
elseif ($devent == edit) {
if ($istok(5 6,$did,32)) { numonlyedit $dname $did }
if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 }
}
}
dialog cprot.codes.edit {
title "Edit channel protection"
size -1 -1 248 366
option pixels
icon script\pics\nntray.ico
box "", 1, 4 2 240 86
check "&Enable protection", 14, 12 20 108 18
text "Times", 2, 32 42 32 16
text "Seconds", 3, 32 64 46 16
edit "", 5, 118 38 118 22, limit 3
edit "", 6, 118 60 118 22, limit 3
box "Trigger on these control codes", 12, 4 94 240 96
check "A&ll", 13, 12 112 40 18
check "Color&s", 16, 70 112 56 18
check "Re&verse", 20, 146 112 64 18
check "&Bold", 17, 70 128 46 18
check "Rese&t", 19, 146 128 56 18
check "&Underline", 18, 70 144 70 18
text "Min. number of codes in text", 21, 14 164 140 16
edit "", 22, 162 160 74 22, limit 3
box "Actions to perform", 4, 4 196 240 136
list 7, 12 212 142 112, size
button "&Add occasion", 15, 158 214 76 24
button "&Edit actions", 30, 158 238 76 24, disable
button "&Remove", 11, 158 268 76 24, disable
button "&Ok", 8, 80 338 80 24
button "&Cancel", 9, 164 338 80 24, cancel
}
on *:dialog:cprot.codes.edit:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx
cprot.edload
var %s = $did(settings,112).seltext,%t = %cprot. [ $+ [ %s ] $+ ] .codes.trig
did -a $dname 1 Control codes protection $nbr(%s)
did -a $dname 22 %cprot. [ $+ [ %s ] $+ ] .codes.mincodes
if ( isin %t) { did -c $dname 16 }
if ( isin %t) { did -c $dname 17 }
if ( isin %t) { did -c $dname 18 }
if ( isin %t) { did -c $dname 20 }
if ( isin %t) { did -c $dname 19 }
if ($regex(%t,/[]/g) == 5) {
did -c $dname 13
did -b $dname 16,17,18,19,20
}
cprot.chkstate 2,3,4,5,6,7,12,15,13,16,17,18,19,20,21,22
}
elseif ($devent == sclick) {
if ($did == 8) {
if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) {
set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .codes.mincodes $iif($did(22),$did(22),1)
set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .codes.trig $+(/[,$iif($did(13).state,,$+($iif($did(16).state,),$iif($did(17).state,),$iif($did(18).state,),$iif($did(20).state,),$iif($did(19).state,))),]/g)
cprot.edsave
dialog -c $dname
}
else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! }
}
elseif ($did == 13) { did $iif($did($did).state,-b,-e) $dname 16,17,18,19,20 }
elseif ($did == 14) {
if ($did($did).state) {
if ($did(13).state) { did -e $dname 2,5,7,4,15,12,13 }
else { did -e $dname 2,5,7,4,15,12,13,16,17,18,19,20 }
if ($did(5) != 1) { did -e $dname 3,6 }
did -e $dname 21,22
}
else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16,17,18,19,20,21,22 }
did -u $dname 7
}
}
elseif ($devent == edit) {
if ($istok(5 6 22,$did,32)) { numonlyedit $dname $did }
if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 }
}
}
alias cprot.chkstate {
if ($wd($did(settings,115).seltext,5) == 2) { did -c $dname 14 }
else { did -b $dname $1 }
}
dialog cprot.caps.edit {
title "Edit channel protection"
size -1 -1 248 308
option pixels
icon script\pics\nntray.ico
box "", 1, 4 2 240 110
check "&Enable protection", 14, 12 20 108 18
text "Times", 2, 32 42 32 16
edit "", 5, 118 38 118 22, limit 3
text "Seconds", 3, 32 64 46 16
edit "", 6, 118 60 118 22, limit 3
text "Caps amount", 12, 32 86 70 16
edit "", 13, 118 82 96 22, limit 3
text "%", 16, 218 86 16 14
box "Actions to perform", 4, 4 118 240 156
list 7, 12 134 142 132, size
button "&Add occasion", 15, 158 136 76 24
button "&Edit actions", 30, 158 160 76 24, disable
button "&Remove", 11, 158 190 76 24, disable
button "&Ok", 8, 80 280 80 24
button "&Cancel", 9, 164 280 80 24, cancel
}
on *:dialog:cprot.caps.edit:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx
cprot.edload
var %s = $did(settings,112).seltext
did -a $dname 1 Caps protection $nbr(%s)
did -a $dname 13 $calc(%cprot. [ $+ [ %s ] $+ ] .caps.percent *100)
cprot.chkstate 2,3,4,5,6,7,12,15,13,16
}
elseif ($devent == sclick) {
if ($did == 8) {
if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) {
set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .caps.percent $calc($did(13) /100)
cprot.edsave
dialog -c $dname
}
else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! }
}
elseif ($did == 14) {
if ($did($did).state) {
did -e $dname 2,5,7,4,12,13,15,16
if ($did(5) != 1) { did -e $dname 3,6 }
}
else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16 }
did -u $dname 7
}
}
elseif ($devent == edit) {
if ($istok(5 6 13,$did,32)) { numonlyedit $dname $did }
if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 }
}
}
dialog cprot.badword.edit {
title "Edit channel protection"
size -1 -1 248 364
option pixels
icon script\pics\nntray.ico
box "", 1, 4 2 240 86
check "&Enable protection", 14, 12 20 108 18
text "Times", 2, 32 42 32 16
edit "", 5, 118 38 118 22, limit 3
text "Seconds", 3, 32 64 46 16
edit "", 6, 118 60 118 22, limit 3
box "Bad words", 12, 4 94 240 94
list 100, 12 110 142 68, sort size extsel vsbar
button "&Add", 101, 158 112 76 24
button "Re&move", 102, 158 136 76 24
box "Actions to perform", 4, 4 194 240 136
list 7, 12 210 142 112, size
button "Add o&ccasion", 15, 158 212 76 24
button "&Edit actions", 30, 158 236 76 24, disable
button "&Remove", 11, 158 266 76 24, disable
button "&Ok", 8, 80 336 80 24
button "&Cancel", 9, 164 336 80 24, cancel
}
on *:dialog:cprot.badword.edit:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx
cprot.edload
var %s = $did(settings,112).seltext
did -a $dname 1 Badword protection $nbr(%s)
didtok $dname 100 44 $mkregex(%cprot. [ $+ [ %s ] $+ ] .badword.words).re
cprot.chkstate 2,3,4,5,6,7,12,15,100,101,102
}
elseif ($devent == sclick) {
if ($did == 8) {
if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) {
set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .badword.words $mkregex($didtok(100,44))
cprot.edsave
dialog -c $dname
}
else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! }
}
elseif ($did == 101) {
var %x = $$eddialog(Enter a new bad word!)
if (!$didwm(100,%x)) { did -a $dname 100 %x }
else { errdialog this bad word is already in the list! }
}
elseif ($did == 100) { did $iif($did($did).sel,-e,-b) $dname 102 }
elseif ($did == 102) {
while ($did(100).sel) { did -d $dname 100 $v1 }
did -b $dname 102
}
elseif ($did == 14) {
if ($did($did).state) {
did -e $dname 2,5,7,4,15,12,100,101
if ($did(5) != 1) { did -e $dname 3,6 }
}
else { did -b $dname 2,3,5,6,7,4,11,15,12,100,101,102 }
did -u $dname 100,7
}
}
elseif ($devent == edit) {
if ($istok(5 6,$did,32)) { numonlyedit $dname $did }
if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 }
}
}
dialog cprot.advertising.edit {
title "Edit channel protection"
size -1 -1 248 364
option pixels
icon script\pics\nntray.ico
box "", 1, 4 2 240 86
check "&Enable protection", 14, 12 20 108 18
text "Times", 2, 32 42 32 16
edit "", 5, 118 38 118 22, limit 3
text "Seconds", 3, 32 64 46 16
edit "", 6, 118 60 118 22, limit 3
box "Strictness", 12, 4 94 240 94
list 13, 16 108 32 72, size
text "", 16, 62 110 172 16
text "", 17, 62 126 172 52
box "Actions to perform", 4, 4 194 240 136
list 7, 12 210 142 112, size
button "&Add occasion", 15, 158 212 76 24
button "&Edit actions", 30, 158 236 76 24, disable
button "&Remove", 11, 158 266 76 24, disable
button "&Ok", 8, 80 336 80 24
button "&Cancel", 9, 164 336 80 24, cancel
}
on *:dialog:cprot.advertising.edit:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 7 TreeView haslines hasbuttons showsel notooltips > script\dlls\views.mdx
mdx SetControlMDX $dname 13 TrackBar vertical > script\dlls\bars.mdx
mdx SetBorderStyle $dname 13
var %s = $did(settings,112).seltext
did -i $dname 13 1 params %cprot. [ $+ [ %s ] $+ ] .advertising.strict 1 3 * * * * 20
did -i $dname 13 1 ticfreq 1
bold $dname 16
adprot.sref
cprot.edload
cprot.chkstate 2,3,4,5,6,7,12,13,15,16,17
did -a $dname 1 Advertising protection $nbr(%s)
}
elseif ($devent == sclick) {
if ($did == 13) { adprot.sref }
elseif ($did == 8) {
if ($did(5) isnum 1-999) && ($did(6) isnum 1-999) {
set %cprot. [ $+ [ $did(settings,112).seltext ] $+ ] .advertising.strict $gettok($did(13,1),1,32)
cprot.edsave
dialog -c $dname
}
else { errdialog please enter valid numbers for the "Times" and "Seconds" fields! }
}
elseif ($did == 14) {
if ($did($did).state) {
did -e $dname 2,5,7,4,15,12,13,16,17
if ($did(5) != 1) { did -e $dname 3,6 }
}
else { did -b $dname 2,3,5,6,7,4,11,15,12,13,16,17 }
did -u $dname 7
}
}
elseif ($devent == edit) {
if ($istok(5 6,$did,32)) { numonlyedit $dname $did }
if ($did == 5) { did $iif($did($did) == 1,-b,-e) $dname 3,6 }
}
}
alias prot.addocc {
did -i $dname 7 1 cb root 2
var %n = $did(7).lines
if (%n < 6) {
did -i $dname 7 1 cb root 2
did -a $dname 7 +e 1 1 0 0 0 $ord(%n) occasion
}
else { errdialog you can only add up to 5 occasions! }
}
alias prot.cleanini {
if ($hget(cleanini)) { hfree cleanini }
hmake cleanini
var %v = $var(%?prot.*.action,0)
while (%v) {
var %c = $var(%?prot.*.action,%v),%e = [ [ %c ] ]
if ($regex(num,%e,/(?:cm|cc|s|es|k|kl|bn)\-([0-9A-Z]+)|(?:wu\-\d\-([0-9A-Z]+))/g)) {
var %z = 1
while ($regml(num,%z)) {
hadd -m cleanini $v1 1
inc %z
}
}
dec %v
}
.fopen $iif(!$isfile(script\txt\paction.ini),-o) paction.old script\txt\paction.ini
.fopen -o paction.new script\txt\paction.new
while (!$feof) {
var %l = $fread(paction.old)
if (%l) && (($hget(cleanini,$gettok(%l,1,61))) || ([*] iswm %l)) { .fwrite -n paction.new %l }
}
.fclose paction.*
hfree cleanini
tryremove script\txt\paction.ini
.rename script\txt\paction.new script\txt\paction.ini
}
alias prot.delocc {
did -i $dname 7 1 page select
var %t = $gettok($did(7,1),4-,32)
did -i $dname 7 1 cb root $deltok(%t,-1,32)
did -d $dname 7 $wd(%t,-1)
if ($numtok(%t,32) == 2) {
var %i = $did(7).lines
while (%i > 1) {
did -i $dname 7 1 replaceitem %i $puttok($did(7,%i),$ord($calc(%i -1)),7,32)
dec %i
}
}
did -u $dname 7
did -b $dname 11,30
}
alias cprot.edsave {
var %s = $did(settings,112).seltext,%t = $cell(settings,115,1),%r = $prot.svac,%d,%z
set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] ] $did(14).state
set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .action %r
if ($1 != -c) {
set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .secs $did(6)
%d = $did(6)
}
if ($1 != -i) {
set %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %t ] $+ ] .times $did(5)
%z = $did(5)
}
did -o settings 115 $did(settings,115).sel 0 +fs 0 0 $calc($did(14).state +1) $cell(settings,115,1) $+ + 0 0 0 $iif(%z,%z,n/a) $+ + 0 0 0 $iif(%d && %z != 1,%d $+ $iif($1 == -i,*60),n/a) $+ + 0 0 0 $prot.traction(%r) $+ $+ $gettok($did(settings,115).seltext,2-,4)
prot.cleanini
}
alias cprot.aload {
var %i = 1
did -i $dname 7 1 cb root
did -a $dname 7 +be 1 1 0 0 0 Actions
did -i $dname 7 1 cb last
while (%i <= $0) {
did -a $dname 7 +e 1 1 0 0 0 $ord(%i) occasion
did -i $dname 7 1 cb last
var %v = 1,%z = $numtok($ [ $+ [ %i ] ],43)
while (%v <= %z) {
var %u = $gettok($gettok($ [ $+ [ %i ] ],2-,58),%v,43)
if (%u) { did -a $dname 7 + 1 1 0 0 0 $+($prot.naction(%u), ,%u) }
inc %v
}
did -i $dname 7 1 cb up
inc %i
}
}
alias cprot.edload {
var %x = $cell(settings,115,1),%s = $did(settings,112).seltext
if ($1 != -c) { did -a $dname 6 %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .secs }
if ($1 != -i) { did -a $dname 5 %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .times }
if (!$1) && ($did(5) == 1) { did -b $dname 3,6 }
cprot.aload %cprot. [ $+ [ %s ] $+ ] . [ $+ [ %x ] $+ ] .action
}
alias adprot.sref {
var %x = $wd($did(13,1),1)
if (%x == 1) {
did -ra $dname 16 High:
did -ra $dname 17 The protection immediately triggers whenever a #channel or URL is mentioned in the channel you are protecting.
}
elseif (%x == 2) {
did -ra $dname 16 Medium (recommended):
did -ra $dname 17 The protection is only triggered when a #channel/URL along with a trigger like "join" or "visit" is mentioned.
}
else {
did -ra $dname 16 Low:
did -ra $dname 17 The protection is only triggered when a #chan/URL along with a trigger like "visit" is mentioned and there are control codes in the text.
}
}
alias cprot.edit {
var %s = $+(cprot.,$cell(115,1),.edit)
noop $dialog(%s,%s,-4)
}
alias cprot.setsave {
var %i = $did(settings,115).lines
while (%i > 1) {
set $+(%,cprot.,$did(settings,112).seltext,.,$cell(settings,115,%i,1)) $calc($wd($did(settings,115,%i),5) -1)
dec %i
}
}
alias cprot.loaddef {
var %c = $+(cprot.,$did(settings,112).seltext,.)
set % $+ %c $+ advertising 0 | set % $+ %c $+ advertising.strict 2 | set % $+ %c $+ advertising.times 1 | set % $+ %c $+ advertising.secs 30 | set % $+ %c $+ advertising.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ badword 0 | set % $+ %c $+ badword.times 1 | set % $+ %c $+ badword.secs 30 | set % $+ %c $+ badword.action 1:wu-1-d 2:b-1800-3+k-d | unset % [ $+ [ %c ] $+ ] badword.words
set % $+ %c $+ caps 0 | set % $+ %c $+ caps.times 2 | set % $+ %c $+ caps.secs 30 | set % $+ %c $+ caps.percent 0.9 | set % $+ %c $+ caps.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ codes 0 | set % $+ %c $+ codes.mincodes 3 | set % $+ %c $+ codes.trig /[]/g | set % $+ %c $+ codes.times 2 | set % $+ %c $+ codes.secs 30 | set % $+ %c $+ codes.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ ctcpflood 1 | set % $+ %c $+ ctcpflood.times 2 | set % $+ %c $+ ctcpflood.secs 10 | set % $+ %c $+ ctcpflood.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ join-/partflood 0 | set % $+ %c $+ join-/partflood.times 5 | set % $+ %c $+ join-/partflood.secs 10 | set % $+ %c $+ join-/partflood.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ mass-deop 0 | set % $+ %c $+ mass-deop.times 4 | set % $+ %c $+ mass-deop.secs 10 | set % $+ %c $+ mass-deop.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ noticeflood 1 | set % $+ %c $+ noticeflood.times 2 | set % $+ %c $+ noticeflood.secs 20 | set % $+ %c $+ noticeflood.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ repeating 1 | set % $+ %c $+ repeating.times 3 | set % $+ %c $+ repeating.secs 10 | set % $+ %c $+ repeating.action 1:wu-1-d 2:b-1800-3+k-d
set % $+ %c $+ textflood 0 | set % $+ %c $+ textflood.times 8 | set % $+ %c $+ textflood.secs 6 | set % $+ %c $+ textflood.action 1:wu-1-d 2:b-1800-3+k-d
if ($dialog(settings)) { cprot.setload }
prot.cleanini
}
alias cprot.setload {
var %s = $did(settings,112).seltext,%c = cprot. $+ %s,%t,%x = Advertising Badword Caps Codes CTCPflood Join-/Partflood Mass-deop Noticeflood Repeating Textflood,%i = 1
did -b settings 117
if ((% [ $+ [ %c ] $+ ] .usepreset) || (%cprot.presetonly)) && (%s != Preset) { did -b settings 37,145,146,147,36,115 }
else { did -e settings 37,145,146,147,36,115 }
if (%s != Preset) && (!%cprot.presetonly) { did -e $dname 144 }
else { did -b $dname 144 }
did $iif(%s == Preset,-b,-e) settings 114
did $iif(% [ $+ [ %c ] $+ ] .usepreset,-c,-u) settings 144
did $iif(% [ $+ [ %c ] $+ ] .punishops,-c,-u) settings 145
did $iif(% [ $+ [ %c ] $+ ] .punishvoiced,-c,-u) settings 146
window -h @cprot.setload
while ($wd(%x,%i)) {
var %u = $v1,%t = [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .times ]
echo @cprot.setload 0 + 0 0 $iif( [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] ] ] ,2,1) %u $+ + 0 0 0 %t $+ + 0 0 0 $iif(%t == 1,n/a, [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .secs ] ) $+ + 0 0 0 $prot.traction( [ % [ $+ [ %c ] $+ ] . [ $+ [ %u ] $+ ] .action ] )
inc %i
}
filter -cwo @cprot.setload settings 115
close -@ @cprot.setload
}
alias prot.naction {
if ($1 == bl) { return Blacklist user }
elseif ($1 == do) { return Deop/devoice user }
elseif ($1 == bp) { return Beep }
elseif ($1 == cq) { return Close query }
elseif ($1 == fl) { return Flash mIRC }
elseif (es-* iswm $1) { return Echo msg. }
elseif (bn-* iswm $1) { return Show balloon }
elseif (wu-* iswm $1) { return Warn user }
elseif ($regex(cp2,$1,/^b-(\d+)-.+$/)) { return Ban user $iif($regml(cp2,1),$nbr($calc($v1 /60) $+ m)) }
elseif (k-* iswm $1) { return Kick user }
elseif (kl-* iswm $1) { return Kill user }
elseif ($regex(cp1,$1,/^i-.+-(\d+)-.+$/)) { return Ignore user $iif($regml(cp1,1),$nbr($calc($v1 /60) $+ m)) }
elseif (cc-* iswm $1) { return Custom command }
elseif (cm-* iswm $1) { return Change channel modes }
elseif (s-* iswm $1) { return Play sound }
elseif ($1 == us) { return Unban self }
elseif ($1 == is) { return Ignore spam }
}
dialog cp.actionadd {
title "Add action"
size -1 -1 301 272
option pixels
icon script\pics\nntray.ico
tab "Warnings", 1, 4 6 292 236
check "&Beep (if sounds are enabled)", 7, 14 34 162 18, tab 1
check "&Flash mIRC (if minimized)", 6, 14 50 142 18, tab 1
check "&Show echo message to self:", 24, 14 66 158 18, tab 1
edit "<nick> triggered your <type> protection in <chan>! Taking countermeasures...", 15, 30 84 256 22, disable tab 1 autohs limit 200
check "S&how balloon tip (if enabled), message:", 8, 14 108 214 18, tab 1
edit "<nick> triggered your <type> protection in <chan>! Taking countermeasures...", 9, 30 126 256 22, disable tab 1 autohs limit 200
check "W&arn user, message:", 22, 14 152 128 18, tab 1
edit "Don't <flood> in <chan>! Taking countermeasures...", 23, 30 170 256 22, disable tab 1 autohs limit 200
text "Send as", 3, 32 196 44 16, disable tab 1
radio "¬ice", 2, 82 194 54 18, disable tab 1
radio "&private message", 4, 82 212 104 18, disable tab 1
tab "Control", 13
check "&Ban user", 35, 14 34 68 18, tab 13
check "&Unban after", 32, 32 50 84 18, disable tab 13
combo 51, 124 48 56 134, disable tab 13 size edit limit 3 drop
text "minutes", 34, 192 52 42 16, disable tab 13
text "Ban mask:", 21, 50 76 54 16, disable tab 13
combo 36, 124 72 162 170, disable tab 13 size drop
check "&Deop/devoice user", 29, 14 98 116 18, tab 13
check "&Kick user, reason:", 25, 14 114 110 18, tab 13
edit "Don't <flood>!", 26, 30 132 256 22, disable tab 13 autohs limit 200
check "K&ill user (IRCop only), reason:", 55, 14 158 168 18, tab 13
edit "Don't <flood>!", 56, 30 176 256 22, disable tab 13 autohs limit 200
tab "Ignore", 14
check "&Ignore", 38, 14 34 56 18, tab 14
check "&Complete", 54, 32 50 68 18, disable tab 14
check "&Private", 39, 32 66 60 18, disable tab 14
check "&DCC", 43, 122 66 48 18, disable tab 14
check "C&hannel", 40, 32 82 64 18, disable tab 14
check "I&nvite", 44, 122 82 54 18, disable tab 14
check "N&otice", 41, 32 98 54 18, disable tab 14
check "Co&des", 45, 122 98 54 18, disable tab 14
check "C&TCP", 42, 32 114 52 18, disable tab 14
check "&Remove after", 46, 32 130 88 18, disable tab 14
combo 33, 124 128 56 134, disable tab 14 size edit limit 3 drop
text "minutes", 48, 192 132 42 16, disable tab 14
text "Ignore mask:", 49, 50 156 66 16, disable tab 14
combo 50, 124 152 162 170, disable tab 14 size drop
tab "Misc.", 5
check "&Blacklist user", 16, 14 34 86 18, tab 5
check "&Custom command:", 30, 14 50 110 18, tab 5
edit "", 31, 30 68 256 22, disable tab 5 autohs limit 200
check "&Set channel mode(s):", 27, 14 94 124 18, tab 5
edit "+", 28, 30 112 256 22, disable tab 5 autohs limit 50
check "&Play sound:", 47, 14 136 80 18, tab 5
edit "", 52, 30 154 220 22, disable tab 5 autohs limit 400
button "&...", 53, 252 154 34 22, disable tab 5
tab "Help", 37
text "Here is a list of identifiers you can use in your custom kick messages and warnings:", 11, 14 36 262 26, tab 37
list 10, 12 80 114 150, tab 37 sort size vsbar
text "Description:", 17, 136 66 60 14, tab 37
text "No item selected.", 18, 136 80 148 148, tab 37
text "Identifiers:", 12, 14 66 56 14, tab 37
button "&Ok", 19, 133 244 80 24
button "&Cancel", 20, 217 244 80 24, cancel
}
on *:dialog:cp.actionadd:*:*:{
if ($devent == init) {
didtok $dname 33,51 44 2,5,10,30,60,120,300
did -c $dname 2,33,51 3
var %i = 0
while (%i <= 9) {
did -a $dname 36,50 $+([,%i,]) $mask(nick!ident@some.host.com,%i)
inc %i
}
did -c $dname 36 %ban.mask
did -c $dname 50 %ignore.mask
didtok $dname 10 44 <action>,<chan>,<type>,<flood>,<next>,<nick>,<occasion>,<secs>,<times>
var %i = 1,%t = $numtok(%cprot.editaction,43)
while (%i <= %t) {
tokenize 45 $gettok(%cprot.editaction,%i,43)
if ($1 == bl) { did -c $dname 16 }
elseif ($1 == do) { did -c $dname 29 }
elseif ($1 == bp) { did -c $dname 7 }
elseif ($1 == fl) { did -c $dname 6 }
elseif ($1 == es) {
did -c $dname 24
did -e $dname 15
if ($2 != d) { did -ra $dname 15 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == bn) {
did -c $dname 8
did -e $dname 9
if ($2 != d) { did -ra $dname 9 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == wu) {
did -c $dname 22
did -e $dname 23,2,3,4
if (!$2) {
did -u $dname 2
did -c $dname 4
}
if ($3 != d) { did -ra $dname 23 $decode($readini(script\txt\paction.ini,cpaction,$3),m) }
}
elseif ($1 == b) {
did -c $dname 35
did -e $dname 32,34,21,36
if ($2) {
did -c $dname 32
did -e $dname 51
if ($didwm(51,$calc($2 /60))) { did -c $dname 51 $v1 }
else { did -ac $dname 51 $calc($2 /60) }
}
did -c $dname 36 $calc($3 +1)
}
elseif ($1 == k) {
did -c $dname 25
did -e $dname 26
if ($2 != d) { did -ra $dname 26 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == kl) {
did -c $dname 55
did -e $dname 56
if ($2 != d) { did -ra $dname 56 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == i) {
did -c $dname 38
did -e $dname 54,48,46,49,50
if ($2 == a) { did -c $dname 54 }
else {
did -e $dname 39,40,41,42,43,44,45
if (p isin $2) { did -c $dname 39 }
if (c isin $2) { did -c $dname 40 }
if (n isin $2) { did -c $dname 41 }
if (t isin $2) { did -c $dname 42 }
if (d isin $2) { did -c $dname 43 }
if (i isin $2) { did -c $dname 44 }
if (k isin $2) { did -c $dname 45 }
}
if ($3) {
did -c $dname 46
did -e $dname 33
if ($didwm(33,$calc($3 /60))) { did -c $dname 33 $v1 }
else { did -ac $dname 33 $calc($3 /60) }
}
did -c $dname 50 $calc($4 +1)
}
elseif ($1 == cc) {
did -c $dname 30
did -e $dname 31
if ($2 != d) { did -ra $dname 31 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == cm) {
did -c $dname 27
did -e $dname 28
if ($2 != d) { did -ra $dname 28 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
elseif ($1 == s) {
did -c $dname 47
did -e $dname 52,53
if ($2 != d) { did -ra $dname 52 $decode($readini(script\txt\paction.ini,cpaction,$2),m) }
}
inc %i
}
}
elseif ($devent == sclick) {
if ($did == 10) {
var %s = $did($did).seltext
if (%s == <chan>) { did -ra $dname 18 <chan> is replaced with the channel the protection is triggered in. }
elseif (%s == <flood>) { did -ra $dname 18 <flood> is replaced with the action the user shouldn't have taken (e.g: "use too many control codes"). }
elseif (%s == <type>) { did -ra $dname 18 <type> is replaced with the type of protection that triggered. }
elseif (%s == <nick>) { did -ra $dname 18 <nick> is replaced with the nick of the person who triggered the protection. }
elseif (%s == <times>) { did -ra $dname 18 <times> is replaced with the amount of times the nickname needed to flood/repeat/etc. until the protection triggered. }
elseif (%s == <secs>) { did -ra $dname 18 <secs> is replaced with the amount of seconds the nickname needed to perform the flood to trigger the protection. }
elseif (%s == <occasion>) { did -ra $dname 18 <occasion> is replaced with the occasion number the nickname is flooding. }
elseif (%s == <action>) { did -ra $dname 18 <action> is replaced with the type of reaction the protection triggers. }
elseif (%s == <next>) { did -ra $dname 18 <next> is replaced with the type of reaction the protection triggers when the user is flooding again. }
}
elseif ($did == 24) { did $iif($did($did).state,-e,-b) $dname 15 }
elseif ($did == 8) { did $iif($did($did).state,-e,-b) $dname 9 }
elseif ($did == 22) { did $iif($did($did).state,-e,-b) $dname 23,2,3,4 }
elseif ($did == 35) {
did $iif($did($did).state,-e,-b) $dname 32,34,21,36
if ($did($did).state) && ($did(32).state) { did -e $dname 51 }
else { did -b $dname 51 }
}
elseif ($did == 32) { did $iif($did($did).state,-e,-b) $dname 51 }
elseif ($did == 25) { did $iif($did($did).state,-e,-b) $dname 26 }
elseif ($did == 55) { did $iif($did($did).state,-e,-b) $dname 56 }
elseif ($did == 38) {
did $iif($did($did).state,-e,-b) $dname 54,48,46,49,50
if (!$did(54).state) || (!$did($did).state) { did $iif($did($did).state,-e,-b) $dname 39,40,41,42,43,44,45 }
if ($did($did).state) && ($did(46).state) { did -e $dname 33 }
else { did -b $dname 33 }
}
elseif ($did == 54) { did $iif($did($did).state,-b,-e) $dname 39,40,41,42,43,44,45 }
elseif ($did == 46) { did $iif($did($did).state,-e,-b) $dname 33 }
elseif ($did == 30) { did $iif($did($did).state,-e,-b) $dname 31 }
elseif ($did == 27) { did $iif($did($did).state,-e,-b) $dname 28 }
elseif ($did == 47) { did $iif($did($did).state,-e,-b) $dname 52,53 }
elseif ($did == 53) { did -ra $dname 52 $relpath($$sfile(*.wav;*.mid;*.mp3;*.ogg;*.wma,Choose a sound file to play!)) }
elseif ($did == 19) {
var %r,%t = $cell(settings,115,1),%d = $+(cprot.,%t,.edit),%f = script\txt\paction.ini,%u
if ($did(7).state) { %r = bp }
if ($did(6).state) { %r = %r fl }
if ($did(24).state) {
if ($did(15)) {
var %u = $trnum,%r = %r es- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r es-d }
}
if ($did(8).state) {
if ($did(9)) {
var %u = $trnum,%r = %r bn- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r bn-d }
}
if ($did(22).state) {
var %z = $did(2).state
if ($did(23)) {
var %u = $trnum,%r = %r $+(wu-,%z,-,%u)
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r $+(wu-,%z,-d) }
}
if ($did(35).state) { %r = %r $+(b-,$iif($did(32).state,$iif($int($did(51)) isnum,$calc($v1 *60),0),0),-,$calc($did(36).sel -1)) }
if ($did(29).state) { %r = %r do }
if ($did(25).state) {
if ($did(26)) {
var %u = $trnum,%r = %r k- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r k-d }
}
if ($did(55).state) {
if ($did(56)) {
var %u = $trnum,%r = %r kl- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r kl-d }
}
if ($did(38).state) {
var %h
if ($did(54).state) { %h = a }
else {
if ($did(39).state) { %h = p }
if ($did(40).state) { %h = %h $+ c }
if ($did(41).state) { %h = %h $+ n }
if ($did(42).state) { %h = %h $+ t }
if ($did(43).state) { %h = %h $+ d }
if ($did(44).state) { %h = %h $+ i }
if ($did(45).state) { %h = %h $+ k }
if (!%h) { %h = a }
}
%r = %r $+(i-,%h,-,$iif($did(46).state,$iif($did(33) isnum,$calc($v1 *60),0),0),-,$calc($did(50).sel -1))
}
if ($did(16).state) { %r = %r bl }
if ($did(30).state) {
if ($did(31)) {
var %u = $trnum,%r = %r cc- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r cc-d }
}
if ($did(27).state) {
if ($did(28)) {
var %u = $trnum,%r = %r cm- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r cm-d }
}
if ($did(47).state) {
if ($did(52)) {
var %u = $trnum,%r = %r s- $+ %u
writeini -n %f cpaction %u $encode($v1,m)
}
else { %r = %r s-d }
}
did -i %d 7 1 page select
did -i %d 7 1 cb root $wd($did(%d,7,1),4-5)
var %i = $numtok(%r,32),%wa,%o = $did(%d,7).lines
while ($did(%d,7).lines > 1) { did -d %d 7 2 }
if (%i > 5) { var %wa = 1,%r = $wd(%r,1-5),%i = 5 }
while (%i) {
did -a %d 7 + 1 1 0 0 0 $+($prot.traction(1: $+ $wd(%r,%i)), ,$wd(%r,%i))
dec %i
}
did -i %d 7 1 sort
dialog -c $dname
if (%wa) { errdialog you have chosen more than 5 actions so only the first 5 have been added! }
}
}
}
alias cprot.dchk {
hadd -mu $+ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .secs cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.t-,$trnum) 1
if ($hfind(cprot,$+($1,.,$chan,.,$cid,.,$fulladdress,.t-*),0,w) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .times) { cprot.dotrig $1 }
}
alias cprot.dotrig {
if ($hget(cprot)) { hdel -w cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.t-*) }
hinc -mu3600 cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.p)
var %j,%o = $hget(cprot,$+($1,.,$chan,.,$cid,.,$fulladdress,.p)),%r = %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .action
if (%o >= $numtok(%r,32)) { hdel cprot $+($1,.,$chan,.,$cid,.,$fulladdress,.p) }
var %x = 1,%c = $gettok($wd(%r,%o),2-,58)
set %cprot.msgrep <chan>, $+ $chan $+ ,<type>, $+ $1 $+ ,<flood>, $+ $cprot.repflood($1) $+ ,<nick>, $+ $nick $+ ,<times>, $+ [ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .times ] $+ ,<secs>, $+ [ %cprot. [ $+ [ %cprot.curchan ] $+ ] . [ $+ [ $1 ] $+ ] .secs ] $+ ,<occasion>, $+ %o $+ ,<action>, $+ $prot.traction(1: $+ %c) $+ ,<next>, $+ $iif($wd(%r,$calc(%o +1)),$prot.traction($v1),n/a)
while ($gettok(%c,%x,43)) {
var %t = $v1,%d
if (%t == bp) { beep }
elseif (%t == fl) { flash }
elseif (%t == do) { mode $chan -ov $nick $nick }
elseif (%t == bl) { prot.blackadd $iif($address($nick,%ban.mask),$v1,$nick $+ !*@*) Don't $cprot.repflood($1) $+ ! }
elseif ($regex(cpt,%t,/^k-([0-9A-Z]+|d)$/)) { kick $chan $nick $iif($regml(cpt,1) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) $+ !) $kc }
elseif ($regex(cpt,%t,/^kl-([0-9A-Z]+|d)$/)) { kill $nick $iif($regml(cpt,1) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) $+ !) }
elseif ($regex(cpt,%t,/^es-([0-9A-Z]+|d)$/)) {
if ($regml(cpt,1) != d) { thmecho -a $cprot.getmsg($v1) }
else { thmecho -a $thmhl($nick) triggered your $thmhl($1) protection in $thmhl($chan) $+ . }
}
elseif ($regex(cpt,%t,/^bn-([0-9A-Z]+|d)$/)) {
npop $1 protection in $+($chan,,$iif($regml(cpt,1) != d,$cprot.getmsg($v1),$nick triggered your $1 protection in $chan $+ .))
%j = 1
}
elseif ($regex(cpt,%t,/^wu-(1|0)-([0-9A-Z]+|d)$/)) { $iif($regml(cpt,1),.notice,.msg) $nick $iif($regml(cpt,2) != d,$cprot.getmsg($v1),Don't $cprot.repflood($1) in $chan $+ !) }
elseif ($regex(cpt,%t,/^b-(\d+)-([0-9])$/)) { ban $iif($regml(cpt,1),-u $+ $v1) $chan $nick $regml(cpt,2) }
elseif ($regex(cpt,%t,/^i-([pcntdik]+|a)-(\d+)-([0-9])$/)) { .ignore $+(-,$iif($regml(cpt,1) != a,$v1),$iif($regml(cpt,2),u $+ $v1)) $nick $regml(cpt,3) }
elseif ($regex(cpt,%t,/^cc-([0-9A-Z]+|d)$/)) {
if ($regml(cpt,1) != d) { $cprot.getmsg($v1) }
else { thmerror -a No command for the $thmhl($1) protection in $thmhl($chan) specified! }
}
elseif ($regex(cpt,%t,/^cm-([0-9A-Z]+|d)$/)) {
if ($regml(cpt,1) != d) { mode $chan $cprot.getmsg($v1) }
else { thmerror -a No channel mode change for the $thmhl($1) protection in $thmhl($chan) specified! }
}
elseif ($regex(cpt,%t,/^s-([0-9A-Z]+|d)$/)) {
var %s = $cprot.getmsg($regml(cpt,1))
if ($regml(cpt,1) != d) && ($isfile(%s)) { splay %s }
else { thmerror -a No sound for the $thmhl($1) protection in $thmhl($chan) specified! }
}
inc %x
}
if ($balloon.trig(c)) && (!%j) { npop Channel protection $+($iif($scid(0) > 1,$nbr($curconserv)),,$nick) triggered your $1 protection in $chan $+ ! Taking countermeasures... }
unset %cprot.msgrep
}
alias prot.blackadd {
if ($1 !iswm $address($me,5)) {
hadd black $1-
hsave -ob black script\tables\black.tbl
if ($dialog(black)) {
did -a black 5 0 + 0 0 0 $1 $+ + 0 0 0 $2
did -e black 17
}
scon -at1 bkacs
}
}
alias cprot.repflood { return $replacex($1-,advertising,advertise,badword,use bad words,caps,write in caps,codes,use too many control codes,ctcpflood,ctcp flood,join-/partflood,join-/partflood,mass-deop,mass-deop,noticeflood,notice flood,repeating,repeat yourself,textflood,text flood) }
alias cprot.getmsg { return $replacex($decode($readini(script\txt\paction.ini,cpaction,$1),m), [ %cprot.msgrep ] ) }
alias cprot.chkst {
if (!$ccontrol($2)) || (!$prot.exclps($address($1,5))) { return 0 }
if (%cprot. [ $+ [ $2 ] $+ ] .usepreset) || (%cprot.presetonly) { set %cprot.curchan Preset }
else { set %cprot.curchan $2 }
if (($1 isop $2) || ($1 ishop $2)) { if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .punishops) { return 1 } }
elseif ($1 isvoice $2) { if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .punishvoiced) { return 1 } }
else { return 1 }
}
alias cprot.chktxtevent {
if ($cprot.chkst($nick,$chan)) {
var %t = $strip($1-)
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .advertising) {
var %s = %cprot. [ $+ [ %cprot.curchan ] $+ ] .advertising.strict
if ($regex(%t,/#[^\s]+|http://[^\s]+\.[^\s]+|www\.[^\s]+\.[^\s]+/)) {
if (%s == 1) { cprot.dchk advertising }
elseif ($regex(%t,/j[o0][i1]n|amsg|need|visit|brauch|besuch|komm|verlos|live|check|support|free|p[o0]rn|pr[o0]n|sex|pussy|idle|pl(?:s|z|ease)|perform/i)) {
if (%s == 2) { cprot.dchk advertising }
elseif ($1- != %t) { cprot.dchk advertising }
}
}
}
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating) {
var %b = $+(repeating.,$md5(%t),.,$chan,.,$cid,.,$fulladdress,.t-)
hadd -mu $+ %cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating.secs cprot $+(%b,$trnum) 1
if ($hfind(cprot,%b $+ *,0,w) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] .repeating.times) {
cprot.dotrig repeating
hdel -w cprot %b $+ *
}
}
var %bwl = %cprot. [ $+ [ %cprot.curchan ] $+ ] .badword.words
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .badword) && (%bwl) && ($regex(bwprot,%t,%bwl)) { cprot.dchk badword }
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .caps) && ($len(%t) > 4) && ($calc($regex(%t,/[A-ZÄÖÜ]/g) / $len(%t)) >= %cprot. [ $+ [ %cprot.curchan ] $+ ] .caps.percent) { cprot.dchk caps }
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .textflood) { cprot.dchk textflood }
if (%cprot. [ $+ [ %cprot.curchan ] $+ ] .codes) && ($regex($1-,%cprot. [ $+ [ %cprot.curchan ] $+ ] .codes.trig) >= [ %cprot. [ $+ [ %cprot.curchan ] $+ ] .codes.mincodes ] ) { cprot.dchk codes }
}
}
dialog contentfilter.add {
title "Add content filter"
size -1 -1 258 118
option pixels
icon script\pics\nntray.ico
text "Please enter a new wildcard or regular expression that you do not want to be displayed.", 6, 6 4 248 30
edit "", 1, 4 36 250 22, autohs limit 100
check "Regular expression", 2, 6 60 122 18
box "", 3, -24 76 360 88
button "&Ok", 5, 90 90 80 24
button "&Cancel", 4, 174 90 80 24, cancel
}
on *:dialog:contentfilter.add:*:*:{
if ($devent == init) {
if (%contentfilter.edit) {
var %t = $did(settings,150).seltext
set %contentfilter.edit $gettok(%t,1,160)
if ($cr isin %t) {
did -a $dname 1 $gettok(%t,3,13)
did -c $dname 2
}
else { did -a $dname 1 %t }
}
}
elseif ($devent == sclick) {
if ($did == 5) {
if ($did(1) != $null) {
var %sz = $did(1) $iif($did(2).state,(Regular expression))
if (%contentfilter.edit == %sz) { dialog -x $dname }
elseif (!$contentfilter.isentry(%sz)) {
if ($did(2).state) {
var %n = $contentfilter.nextvar,%s = $did(1) $+((Regular expression),$str($chr(160),200),$cr,%n,$cr,$did(1))
if (%contentfilter.edit) { did -oc settings 150 $did(settings,150).sel %s }
else { did -a settings 150 %s }
did -e settings 153
contentfilter.savelist
dialog -c $dname
}
else {
if (%contentfilter.edit) { did -oc settings 150 $did(settings,150).sel $did(1) }
else { did -a settings 150 $did(1) }
did -e settings 153
contentfilter.savelist
dialog -c $dname
}
}
else { errdialog the same entry is already in the filter list! }
}
else { errdialog you did not supply a filter! }
}
}
}
alias contentfilter.isentry {
var %i = $did(settings,150).lines
while (%i) {
if ($gettok($did(settings,150,%i),1,160) == $1-) { return 1 }
dec %i
}
}
alias contentfilter.edit {
set %contentfilter.edit 1
noop $dialog(contentfilter.add,contentfilter.add,-4)
unset %contentfilter.edit
}
alias contentfilter.savelist {
unset %contentfilter %contentfilter.regex.*
var %i = $did(settings,150).lines,%r
while (%i) {
var %c = $did(settings,150,%i)
if ($chr(13) !isin %c) { %r = $addtok(%r,%c,44) }
else { set %contentfilter.regex. [ $+ [ $gettok(%c,2,13) ] ] $gettok(%c,3,13) }
dec %i
}
set %contentfilter $mkregex(%r)
}
alias contentfilter.nextvar {
var %i = 1
while (%contentfilter.regex. [ $+ [ %i ] ]) { inc %i }
return %i
}
alias contentfilter {
if (($prop == query) && (%contentfilter.queries)) || (($prop == chan) && (%contentfilter.chans)) {
if (%contentfilter) && ($regex($1-,%contentfilter)) { return 1 }
var %i = $var(%contentfilter.regex.*,0)
while (%i) {
if ($regex($1-, [ [ $var(%contentfilter.regex.*,%i) ] ] )) { return 1 }
dec %i
}
}
}
alias dccrelay { nndlg -m dccrelay dccrelay }
dialog dccrelay {
title "DCC Relay [/dccrelay]"
size -1 -1 310 184
option pixels
icon script\pics\nntray.ico
text "Destination nick", 1, 6 8 80 14
combo 2, 132 4 174 300, sort size edit drop
text "Server", 3, 6 32 38 14
combo 4, 132 28 174 200, sort size drop
text "Status", 9, 6 56 40 14
edit "", 10, 70 52 236 90, read multi return vsbar
check "&Enable", 5, 6 160 60 18
box "", 8, -6 142 320 8
button "&Help", 6, 142 156 80 24
button "&Close", 7, 226 156 80 24, ok
}
alias dccrelay.addserv { did -a dccrelay 4 $curconserv $nbr($cid) }
on *:dialog:dccrelay:*:*:{
if ($devent == init) {
scon -at1 dccrelay.addserv
if ($did(4).lines) {
did -c $dname 4 1
set %dccrel.cid $mid($wd($did(4,1),-1),2,-1)
loaddccrn
}
}
elseif ($devent == sclick) {
if ($did == 5) {
sdt dccrel.en
if ($did($did).state) { dccrelay.ts }
else { dccrelay.status Relaying of DCCs stopped. }
}
elseif ($did == 6) { idialog This feature is used to relay DCC sends you are receiving to other users. If you know FXP, you probably already know how this works.After you press the "Enable" checkbox, all DCCs you receive will be relayed.Note that you have to keep the DCC relay dialog open for it to work!Once the DCC has started you can close the dialog again. }
elseif ($did == 4) {
set %dccrel.cid $mid($wd($did($did).seltext,-1),2,-1)
loaddccrn
dccrelay.ts
}
elseif ($did == 2) {
set %dccrel.nick $did($did)
dccrelay.ts
}
}
elseif ($devent == edit) {
set %dccrel.nick $did($did)
.timerdccrel.nref -io 1 1 dccrelay.ts
}
elseif ($devent == close) { unset %dccrel.* }
}
alias dccrelay.status { if ($dialog(dccrelay)) { did -a $v1 10 $iif($did(dccrelay,10),$crlf) $+ —› $1- } }
alias dccrelay.ts {
if (%dccrel.en) {
if (%dccrel.nick) && (%dccrel.cid) { dccrelay.status Relaying all DCCs to %dccrel.nick on $iif($scid(%dccrel.cid).network,$v1,$scid(%dccrel.cid).server) $+ ! }
else { dccrelay.status You have to select a nickname and network! }
}
}
alias loaddccrn {
did -r dccrelay 2
scid $mid($wd($did(4).seltext,-1),2,-1)
_hmake dccrn
var %i = $chan(0)
while (%i) {
var %n = $nick($chan(%i),0)
while (%n) {
if (!$hget(dccrn,$nick($chan(%i),%n))) { did -a dccrelay 2 $nick($chan(%i),%n) }
hadd dccrn $nick($chan(%i),%n) 1
dec %n
}
dec %i
}
hfree dccrn
}
ctcp *:DCC:*:{
if ($dialog(dccrelay)) && (%dccrel.en) && (%dccrel.nick) && (%dccrel.cid) {
if ($2 == send) && ($scid(%dccrel.cid).status == connected) {
dccrelay.status Sending $3 $nbr($bytes($6,3).suf) to %dccrel.nick via $nick
set %dccrel.user $nick $cid
scid %dccrel.cid
!.msg %dccrel.nick DCC SEND $3- $+
scid -r
haltdef
}
elseif ($2 == resume) {
if ($nick == %dccrel.nick) && ($scid($wd(%dccrel.user,2)).status == connected) {
dccrelay.status Requesting resume...
scid $wd(%dccrel.user,2)
!.msg $wd(%dccrel.user,1) DCC RESUME $3- $+
scid -r
haltdef
}
}
elseif ($2 == accept) && ($scid(%dccrel.cid).status == connected) {
if ($nick == $wd(%dccrel.user,1)) {
dccrelay.status Accepting file...
scid %dccrel.cid
!.msg %dccrel.nick DCC ACCEPT $3- $+
scid -r
haltdef
}
}
}
}
alias dcchist { nndlg -mh dcchist }
dialog dcchist {
title "DCC history [/dcchist]"
size -1 -1 461 297
option pixels
icon script\pics\nntray.ico
tab "Files received", 1002, 4 2 452 264
list 2, 9 28 442 228, tab 1002 size
tab "Files sent", 1003
list 3, 9 28 442 228, tab 1003 size
tab "Incomplete gets", 1012
list 12, 9 28 442 228, tab 1012 size
tab "Incomplete sends", 1013
list 13, 9 28 442 228, tab 1013 size
button "C&lose", 1, 377 269 80 24, ok
menu "&File", 8
item "&Close", 10, 8
menu "&Edit history", 9
item "&Refresh", 11, 9
item break, 14, 9
item "R&emove selected", 15, 9
item "&Clear lists", 16, 9
menu "&Information", 17
item "&Post selected in active", 18, 17
item "&Display DCC history info", 4, 17
}
on *:dialog:dcchist:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 2,3,12,13 ListView report showsel rowselect infotip > script\dlls\views.mdx
did -i $dname 2,3,12,13 1 headerdims 140:1 80:2 80:3 130:4 70:5 60:6 120:7
did -i $dname 2 1 headertext + 0 Filename + 0 Filesize + 0 From + 0 Time received + 0 Speed received + 0 Get duration + 0 User's IP address
did -i $dname 3 1 headertext + 0 Filename + 0 Filesize + 0 To + 0 Time sent + 0 Speed sent + 0 Send duration + 0 User's IP address
did -i $dname 12 1 headertext + 0 Filename + 0 Received (%) + 0 From + 0 Time of error + 0 Speed received + 0 Get duration + 0 User's IP address
did -i $dname 13 1 headertext + 0 Filename + 0 Sent (%) + 0 To + 0 Time of error + 0 Speed sent + 0 Send duration + 0 User's IP address
did -b $dname 15,18
dcchist.ref
}
elseif ($devent == sclick) {
if ($istok(1002 1003 1012 1013,$did,32)) { did $iif($did($calc($dialog($dname).tab -1000)).sel && !$nomsg,-e,-b) $dname 15,18 }
elseif ($istok(2 3 12 13,$did,32)) {
did $iif(!$did($did).sel || $cell($did,1) == No entries.,-b,-e) $dname 15
did $iif(!$did($did).sel || $nomsg || $cell($did,1) == No entries.,-b,-e) $dname 18
if (rclick recent * iswm $did($did,1)) {
popdll.new popup
popdll.add popup + 0 0 Refresh $cr dcchist.ref
popdll.add popup
popdll.add popup $iif(!$did($did).sel || $cell($did,1) == No entries.,+d,+) 0 0 Remove selected $cr dcchist.remsel
popdll.add popup $iif($did($did).lines == 1,+d,+) 0 0 Clear lists $cr dcchist.clear
popdll.add popup
popdll.add popup $iif(!$did($did).sel || $nomsg || $cell($did,1) == No entries.,+d,+) 0 0 Post in active $cr dcchist.say $active
popdll.disp popup
}
else { sortmdx $dname $did }
}
}
elseif ($devent == menu) {
if ($did == 10) { dialog -c $dname }
elseif ($did == 11) { dcchist.ref }
elseif ($did == 15) { dcchist.remsel }
elseif ($did == 16) { dcchist.clear }
elseif ($did == 18) { dcchist.say $active }
elseif ($did == 4) { idialog DCC history entries: $dcchist.entries }
}
elseif ($devent == dclick) && ($did == 2) { open $getdir $+ $cell($did,1) }
}
alias dcchist.entries { return $calc($lines(script\txt\dcchist-g.txt) + $lines(script\txt\dcchist-ig.txt) + $lines(script\txt\dcchist-s.txt) + $lines(script\txt\dcchist-is.txt)) }
alias dcchist.clear {
if ($ydialog(Are you sure you want to clear the DCC history?)) {
write -c script\txt\dcchist-g.txt
write -c script\txt\dcchist-ig.txt
write -c script\txt\dcchist-s.txt
write -c script\txt\dcchist-is.txt
dcchist.ref
}
}
alias dcchist.ref {
did -r dcchist 2,3,12,13
var %i = 4,%f = g s ig is,%x = 2 3 12 13
while (%i) {
var %v = $wd(%x,%i),%z = $+(script\txt\dcchist-,$wd(%f,%i),.txt)
if (!$lines(%z)) { did -a dcchist %v 1 + 0 0 0 No entries. }
else { loadbuf -o dcchist %v %z }
dec %i
}
}
alias dcchist.say {
var %p = $calc($dialog(dcchist).tab -1000),%n = $1
tokenize 9 $did(dcchist,%p).seltext
msg %n $sbr(DCC) $wd($1,6-) $nbr($wd($2,5-)) $replace(%p,12,incompletely received from,13,incompletely sent to,2,received from,3,sent to) $wd($3,5-) on $wd($4,5-) at $wd($5,5-) $nbr($wd($6,5-) transfer time)
}
alias dcchist.remsel {
var %d = $calc($dialog(dcchist).tab -1000)
while ($did(dcchist,%d).sel) { did -d dcchist %d $v1 }
savebuf -o 2- $+ $did(dcchist,%d).lines dcchist %d $+(script\txt\dcchist-,$replace(%d,12,ig,13,is,2,g,3,s),.txt)
dcchist.ref
}
on *:filercvd:*:{ write -il1 script\txt\dcchist-g.txt 1 + 0 0 0 $+($get(-1).file, + 0 0 0 $bytes($get(-1).size,3).suf $iif($get(-1).resumed,$nbr(resumed at $bytes($v1,3).suf)), + 0 0 0 $get(-1), + 0 0 0 $time(dd.mm.yyyy $+ $chr(44) HH:nn:ss), + 0 0 0 $bytes($get(-1).cps,3).suf,/s + 0 0 0 $sduration($get(-1).secs), +) 0 0 0 $get(-1).ip }
on *:filesent:*:{ write -il1 script\txt\dcchist-s.txt 1 + 0 0 0 $+($send(-1).file, + 0 0 0 $bytes($send(-1).size,3).suf $iif($send(-1).resumed,$nbr(resumed at $bytes($v1,3).suf)), + 0 0 0 $send(-1), + 0 0 0 $time(dd.mm.yyyy $+ $chr(44) HH:nn:ss), + 0 0 0 $bytes($send(-1).cps,3).suf,/s + 0 0 0 $sduration($send(-1).secs), +) 0 0 0 $send(-1).ip }
on *:getfail:*:{ write -il1 script\txt\dcchist-ig.txt 1 + 0 0 0 $+($get(-1).file, + 0 0 0 $bytes($get(-1).rcvd,3).suf,/,$bytes($get(-1).size,3).suf $nbr($get(-1).pc $+ %) $iif($get(-1).resumed,$nbr(resumed at $bytes($v1,3).suf)), + 0 0 0 $get(-1), + 0 0 0 $time(dd.mm.yyyy $+ $chr(44) HH:nn:ss), + 0 0 0 $bytes($get(-1).cps,3).suf,/s + 0 0 0 $sduration($get(-1).secs), +) 0 0 0 $get(-1).ip }
on *:sendfail:*:{ write -il1 script\txt\dcchist-is.txt 1 + 0 0 0 $+($send(-1).file, + 0 0 0 $bytes($send(-1).sent,3).suf,/,$bytes($send(-1).size,3).suf $nbr($send(-1).pc $+ %) $iif($send(-1).resumed,$nbr(resumed at $bytes($v1,3).suf)), + 0 0 0 $send(-1), + 0 0 0 $time(dd.mm.yyyy $+ $chr(44) HH:nn:ss), + 0 0 0 $bytes($send(-1).cps,3).suf,/s + 0 0 0 $sduration($send(-1).secs), +) 0 0 0 $send(-1).ip }
alias kbhist { nndlg -m kbhist }
dialog kbhist {
title "Kick/ban history [/kbhist]"
size -1 -1 461 297
option pixels
icon script\pics\nntray.ico
tab "Kicks", 1002, 4 2 452 264
list 2, 10 28 441 228, tab 1002 size
tab "Bans", 1008
list 8, 10 28 441 228, tab 1008 size
button "C&lose", 1, 377 269 80 24, ok
menu "&File", 5
item "&Close", 10, 5
menu "&Edit history", 9
item "&Refresh", 11, 9
item break, 12, 9
item "R&emove selected", 13, 9
item "&Clear lists", 7, 9
menu "&Information", 3
item "&Post selected in active", 6, 3
item "&Display kick/ban history info", 4, 3
}
on *:dialog:kbhist:*:*:{
if ($devent == init) {
mdx SetControlMDX $dname 2,8 ListView report showsel rowselect > script\dlls\views.mdx
did -i $dname 2,8 1 headerdims 110:1 80:2 80:3 140:4
did -i $dname 2 1 headertext + 0 Date + 0 Channel + 0 Nick + 0 Reason
did -i $dname 8 1 headertext + 0 Date + 0 Channel + 0 Affected users + 0 Mask
did -b $dname 13,6
kbhist.refresh
}
elseif ($devent == sclick) {
if ($istok(1002 1008,$did,32)) { did $iif($did($calc($dialog($dname).tab -1000)).sel && !$nomsg,-e,-b) $dname 13,6 }
elseif ($istok(2 8,$did,32)) {
did $iif(!$did($did).sel || $cell($did,1) == No entries.,-b,-e) $dname 13
did $iif(!$did($did).sel || $nomsg || $cell($did,1) == No entries.,-b,-e) $dname 6
if (rclick * iswm $did($did,1)) {
popdll.new popup
popdll.add popup + 0 0 Refresh $cr kbhist.refresh
popdll.add popup
popdll.add popup $iif(!$did($did).sel || $cell($did,1) == No entries.,+d,+) 0 0 Remove selected $cr kbhist.remsel
popdll.add popup $iif($did($did).lines == 1,+d,+) 0 0 Clear lists $cr kbhist.clear
popdll.add popup
popdll.add popup $iif(!$did($did).sel || $nomsg || $cell($did,1) == No entries.,+d,+) 0 0 Post in active $cr kbhist.say $active
popdll.disp popup
}
else { sortmdx }
}
}
elseif ($devent == menu) {
if ($did == 7) { kbhist.clear }
elseif ($did == 11) { kbhist.refresh }
elseif ($did == 4) { idialog Kick/ban history entries: $kbhist.entries }
elseif ($did == 6) { kbhist.say $active }
elseif ($did == 13) { kbhist.remsel }
elseif ($did == 10) { dialog -c $dname }
}
}
alias kbhist.say {
var %p = $calc($dialog(kbhist).tab -1000),%n = $1
tokenize 9 $did(kbhist,%p).seltext
msg %n $sbr($replace(%p,2,Kicked,8,Banned)) $iif($wd($3,5-),$v1,no one) in $wd($2,5-) on $wd($1,6-) $nbr($replace(%p,2,reason:,8,mask:) $wd($4,5-))
}
alias kbhist.clear {
if ($ydialog(Do you really want to clear the kick/ban history?)) {
write -c script\txt\kickhist.txt
write -c script\txt\banhist.txt
kbhist.refresh
}
}
alias kbhist.refresh {
if ($lines(script\txt\kickhist.txt)) { loadbuf -ro kbhist 2 script\txt\kickhist.txt }
else { did -ra kbhist 2 1 + 0 0 0 No entries. }
if ($lines(script\txt\banhist.txt)) { loadbuf -ro kbhist 8 script\txt\banhist.txt }
else { did -ra kbhist 8 1 + 0 0 0 No entries. }
did $iif($did(kbhist,4),-e,-b) kbhist 3
}
alias kbhist.entries { return $calc($lines(script\txt\kickhist.txt) + $lines(script\txt\banhist.txt)) }
alias kbhist.remsel {
var %d = $calc($dialog(kbhist).tab -1000)
while ($did(kbhist,%d).sel) { did -d kbhist %d $v1 }
savebuf -o 2- $+ $did(kbhist,%d).lines kbhist %d $+(script\txt\,$replace(%d,2,kick,8,ban),hist.txt)
kbhist.refresh
}
on *:ban:#:{
if ($nick == $me) {
var %i = $ialchan($banmask,$chan,0),%r
while (%i) {
%r = %r $ialchan($banmask,$chan,%i).nick
if ($len(%r) > 500) {
%r = %r $+ ...
break
}
dec %i
}
write -il1 script\txt\banhist.txt 1 + 0 0 0 $+($asctime(dd.mm.yy $+ $chr(44) HH:nn:ss), + 0 0 0 $chan, + 0 0 0 $replace(%r,$chr(32),$chr(44) $+ $chr(32)), + 0 0 0 $banmask)
}
}
on *:kick:#:{ if ($nick == $me) { write -il1 script\txt\kickhist.txt 1 + 0 0 0 $+($asctime(dd.mm.yy $+ $chr(44) HH:nn:ss), + 0 0 0 $chan, + 0 0 0 $knick, + 0 0 0 $strip($1-)) } }
on *:active:*:{
if ($dialog(dcchist)) {
var %d = $calc($dialog($v1).tab -1000)
did $iif(!$did(dcchist,%d).sel || $nomsg || $cell(dcchist,%d,1) == No entries.,-b,-e) dcchist 18
}
if ($dialog(kbhist)) {
var %d = $calc($dialog($v1).tab -1000)
did $iif(!$did(kbhist,%d).sel || $nomsg || $cell(kbhist,%d,1) == No entries.,-b,-e) kbhist 6
}
}
alias eddialog {
var %t = eddialog. $+ $trnum
set %geninp.text $replace($1,,$crlf)
set %geninp.ed $2
return $dialog(%t,%t,-4)
}
dialog eddialog.* {
title "Input needed"
size -1 -1 306 146
option pixels
icon script\pics\nntray.ico
edit "", 3, 2 92 301 22, result autohs
button "&Ok", 4, 136 118 80 24, ok
button "&Cancel", 5, 222 118 80 24
edit "", 2, 40 4 262 84, read multi return vsbar
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
}
alias dddialog {
var %t = dddialog. $+ $trnum
set %geninp.text $replace($1,,$crlf)
set %geninp.filter %t $2
set %geninp.ed $3
return $dialog(%t,%t,-4)
}
alias dddialog.df {
var %t = $1-
tokenize 32 %geninp.filter
if (%t != $null) { did -a $1 3 %t }
}
dialog dddialog.* {
title "Input needed"
size -1 -1 306 146
option pixels
icon script\pics\nntray.ico
combo 3, 2 92 301 170, result sort size edit drop
button "&Ok", 4, 136 118 80 24, ok
button "&Cancel", 5, 222 118 80 24
edit "", 2, 40 4 262 84, read multi return vsbar
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
}
on *:dialog:dddialog.*:*:*:{
if ($devent == init) {
mdx SetBorderStyle $dname 2
tokenize 32 %geninp.filter
filter -k $iif($isfile($3-),$mkfullfn($3-),$3-) $2
if (@* iswm $3-) { close -@ $3- }
did -a $dname 2 %geninp.text
if (%geninp.ed != $null) {
did -a $dname 3 %geninp.ed
did -c $dname 3 1 1 $calc($len($did(3)) +1)
}
unset %geninp.*
}
elseif ($devent == sclick) {
if ($did == 5) { dialog -x $dname }
elseif ($did == 4) {
if ($did(3) == $null) {
errdialog you did not enter a value!
halt
}
}
}
}
alias epdialog {
var %t = epdialog. $+ $trnum
set %geninp.text $replace($1,,$crlf)
set %geninp.ed $2
return $dialog(%t,%t,-4)
}
dialog epdialog.* {
title "Password input needed"
size -1 -1 306 146
option pixels
icon script\pics\nntray.ico
edit "", 3, 2 92 301 22, result pass autohs
edit "", 101, 2 92 301 22, hide autohs
button "&Ok", 4, 136 118 80 24, ok
button "&Cancel", 5, 222 118 80 24
edit "", 2, 40 4 262 84, read multi return vsbar
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
check "Show input", 100, 8 119 72 22
}
on *:dialog:e?dialog.*:*:*:{
if ($devent == init) {
mdx SetBorderStyle $dname 2
did -a $dname 2 %geninp.text
if (%geninp.ed != $null) {
did -a $dname 3 %geninp.ed
did -c $dname 3 1 1 $calc($len($did(3)) +1)
}
unset %geninp.*
}
elseif ($devent == sclick) {
if ($did == 5) { dialog -x $dname }
elseif ($did == 4) {
if ($did(3) == $null) {
errdialog you did not enter a value!
halt
}
}
elseif ($did == 100) {
did -vf $dname $iif($did($did).state,101,3)
did -h $dname $iif($did($did).state,3,101)
}
}
elseif ($devent == edit) && (epdialog.* iswm $dname) {
if ($did == 3) { did -ra $dname 101 $did($did) }
elseif ($did == 101) { did -ra $dname 3 $did($did) }
}
}
alias idialog {
var %t = idialog. $+ $trnum
set %geninp.text $replace($1-,,$crlf)
return $dialog(%t,%t,-4)
}
dialog idialog.* {
title "Info"
size -1 -1 305 121
option pixels
icon script\pics\nntray.ico
button "&Ok", 4, 221 93 80 24, ok
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
edit "", 2, 40 4 262 84, read multi return vsbar
}
on *:dialog:idialog.*:*:*:{
if ($devent == init) {
mdx SetBorderStyle $dname 2
did -ra $dname 2 %geninp.text
unset %geninp.text
}
}
alias errdialog {
var %t = errdialog. $+ $trnum
set %geninp.text Error: $replace($1-,,$crlf)
return $dialog(%t,%t,-4)
}
dialog errdialog.* {
title "Error!"
size -1 -1 305 121
option pixels
icon script\pics\nntray.ico
button "&Ok", 4, 221 93 80 24, ok
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
edit "", 2, 40 4 262 84, read multi return vsbar
}
on *:dialog:errdialog.*:*:*:{
if ($devent == init) {
mdx SetBorderStyle $dname 2
did -ra $dname 2 %geninp.text
unset %geninp.text
}
}
alias ydialog {
var %t = ydialog. $+ $trnum
set %geninp.text $replace($1-,,$crlf)
return $dialog(%t,%t,-4)
}
dialog ydialog.* {
title "Yes/No?"
size -1 -1 305 121
option pixels
icon script\pics\nntray.ico
button "&Yes", 3, 135 93 80 24, ok
button "&No", 4, 221 93 80 24, cancel
edit "", 2, 40 4 262 84, read multi return vsbar
text "1", 5, -10 -10 2 2, result
icon 1, 4 4 32 32, script\pics\nn.ico, 0, noborder
}
on *:dialog:ydialog.*:*:*:{
if ($devent == init) {
mdx SetBorderStyle $dname 2
did -a $dname 2 %geninp.text
unset %geninp.text
}
}