aIRC — File Browser

aIRCv0.8.69 / aIRCv0.8.69 / script / protaction.mrc

protaction.mrc — 21.09 KB — Download this file

;/**********************************************************************
; *
; * aIRC
; * Protection Actions
; *
; **********************************************************************/

;;
;
; /_protaction <1=channel|0=personal> <1=dcc|0=anything else> <1=botnet0=user> <prot code> [#channel]
;
;
alias _protaction.opendialog {
  var %d = _protaction,%i,%ids,%mask
  _dialog -m %d %d
  dialog -t %d Protection - $iif($1, [ $iif($5 != $null,Channel [ $5 ] ,Channel) ] ,Personal) $right($4,-2) $iif($3,[botnet])
  did -o %d 500 1 $1
  did -o %d 500 2 $2
  did -o %d 500 3 $3
  if ($5 != $null) { did -o %d 500 4 $5 $+ , $+ $4 }
  else { did -o %d 500 4 $4 }
  did -r %d 1,401,402,403,404,405,406,407,408,409,410,411,412,413
  did -o %d 155,156 1 Ignore $iif($3,everybody)
  %ids = 59,102,109,117,159
  did -r %d %ids
  did -ac %d %ids NICK
  %i = 0
  while (%i <= 19) {
    %mask = $_mask(nick!~user@pc123.domain.com,%i)
    if ($gettok(%mask,1,33) == nick) { did -a %d 109,159 [[ $+ %i $+ ]] %mask }
    else { did -a %d %ids [[ $+ %i $+ ]] %mask }
    inc %i
  }
  _protaction.loadfile $did(%d,500,4) $_protactinifile
  if ($did(%d,1).lines == 0) { _protaction.new }
  did -c %d 1 1
  _protaction.refresh
  did $iif($1 && $5,-v,-h) %d 480
}
dialog _protaction {
  size -1 -1 235 190
  option dbu
  title ""

  list 1,5 20 40 100,size
  button "add",2,5 125 19 12
  button "del",3,26 125 19 12
  button "up",4,5 140 19 12
  button "down",5,26 140 19 12
  button "default",6,5 155 40 12

  tab "Warnings",10,50 2 180 160
  tab "Control",11
  tab "Ignore",12
  tab "Misc",13
  tab "Channel",14
  tab "Custom",15

  ; warnings

  ; 401
  box "Warn Yourself",50,60 20 160 35,tab 10
  check "Warn Yourself",51,65 30 100 8,tab 10
  edit "",52,65 40 150 10,tab 10 autohs

  ; 402
  box "Warn offender(s)",55,60 60 160 45,tab 10
  check "Warn offender(s)",56,65 70 100 8,tab 10
  radio "/notice",57,65 80 30 8,tab 10 group
  radio "/msg",58,95 80 22 8,tab 10
  combo 59,120 78 94 900,tab 10 drop
  edit "",60,65 90 150 10,tab 10 autohs

  ; 403
  box "Warn channel",65,60 110 160 45,tab 10
  check "Warn channel",66,65 120 100 8,tab 10
  radio "/notice",67,65 130 30 8,tab 10 group
  radio "/msg",68,100 130 30 8,tab 10
  check "Only Ops",69,150 130 40 8,tab 10
  edit "",70,65 140 150 10,tab 10 autohs

  ; control

  ; 404
  box "Deop",100,60 20 160 25,tab 11
  check "Deop",101,65 30 30 8,tab 11
  combo 102,120 28 94 900,tab 11 drop

  ; 405
  box "Ban",105,60 50 160 45,tab 11
  check "Ban",106,65 60 30 8,tab 11
  check "seconds",107,65 70 30 8,tab 11
  edit "",108,97 68 20 10,tab 11 autohs
  combo 109,120 68 94 900,tab 11 drop
  edit "",110,65 80 150 10,tab 11 autohs

  ; 406
  box "Kick",115,60 100 160 37,tab 11
  check "Kick",116,65 110 30 8,tab 11
  combo 117,120 110 94 900,tab 11 drop
  edit "",118,65 122 150 10,tab 11 autohs

  ; ignore

  ; 407
  box "Ignore",155,60 20 160 85,tab 12
  check "Ignore",156,65 30 100 8,tab 12
  check "seconds",157,65 40 30 8,tab 12
  edit "",158,97 38 20 10,tab 12 autohs
  combo 159,120 38 94 900,tab 12 drop
  check "Private",170,65 55 50 8,tab 12
  check "Channel",171,120 55 50 8,tab 12
  check "Notice",172,65 65 50 8,tab 12
  check "CTCP",173,120 65 50 8,tab 12
  check "Invite",174,65 75 50 8,tab 12
  check "Control Codes",175,120 75 50 8,tab 12
  edit "",176,65 90 150 10,tab 12 autohs

  ; misc

  ; 408
  box "Change Nick",200,60 20 160 45,tab 13
  check "Change Nick",201,65 30 100 8,tab 13
  check "seconds:",202,65 40 30 8,tab 13
  edit "",203,100 38 20 10,tab 13 autohs
  radio "Random Nick",205,65 52 30 8,tab 13
  radio "Other:",206,100 52 30 8,tab 13
  edit "",207,134 50 80 10,tab 13 autohs

  ; 409
  box "Sound",210,60 70 160 37,tab 13
  check "Play Sound",211,65 80 40 8,tab 13
  button "",212,65 90 140 12,tab 13 autohs
  button "!",213,206 90 9 12,tab 13

  ; 410
  box "Flash mIRC",220,60 110 160 35,tab 13
  check "Flash mIRC",221,65 120 40 8,tab 13
  edit "",222,65 130 150 10,tab 13 autohs

  ; channel

  ; 411
  box "Modes",230,60 20 160 45,tab 14
  check "Change Modes",231,65 30 100 8,tab 14
  check "seconds",232,65 40 30 8,tab 14
  edit "",233,97 38 20 10,tab 14 autohs
  edit "",234,65 50 150 10,tab 14 autohs

  ; 412
  box "Topic",235,60 70 160 45,tab 14
  check "Change Topic",236,65 80 100 8,tab 14
  check "seconds",237,65 90 30 8,tab 14
  edit "",238,97 88 20 10,tab 14 autohs
  edit "",239,65 100 150 10,tab 14 autohs

  ; custom

  ; 413
  box "Custom",250,60 20 160 140,tab 15
  check "Custom command:",251,65 30 100 8,tab 15
  edit "",252,65 40 150 10,tab 15 autohs
  text "You can use:",253,65 55 150 80,tab 15

  list 401,999 999 999 999,hide
  list 402,999 999 999 999,hide
  list 403,999 999 999 999,hide
  list 404,999 999 999 999,hide
  list 405,999 999 999 999,hide
  list 406,999 999 999 999,hide
  list 407,999 999 999 999,hide
  list 408,999 999 999 999,hide
  list 409,999 999 999 999,hide
  list 410,999 999 999 999,hide
  list 411,999 999 999 999,hide
  list 412,999 999 999 999,hide
  list 413,999 999 999 999,hide

  check "Use default global settings",480,10 178 100 8

  button "&Ok",490,130 172 30 15,ok
  button "&Cancel",491,165 172 30 15,cancel
  button "&Help",492,200 172 30 15

  list 500,1000 1000 1000 1000,hide
}

alias -l _protaction.remsection {
  var %file = $_protactinifile,%win = @__protactionremsection
  _openwins %win
  filter -fwx $"(%file) %win $1 $+ .*
  savebuf %win $"(%file)
  close -@ %win
}
alias -l _protaction.default {
  var %d = _protaction
  did -r %d 1,401,402,403,404,405,406,407,408,409,410,411,412,413
  _protaction.loadfile $1 $_protactdefaultinifile
  if ($did(%d,1).sel == $null) { _protaction.new }
  did -c %d 1 1
  _protaction.refresh
}
alias -l _protaction.loadfile {
  var %d = _protaction,%b = $1,%file = $2-,%win1 = @__protactionloadfile1,%win2 = @__protactionloadfile2,%t,%i,%z,%ud = 1
  if ($_not($isfile(%file))) { return }
  _openwins %win1 %win2
  if ($chr(44) isin %b) {
    %z = $read -ns $+ %b $+ .1.isaction $_usrdir(protact.ini)
    if (%z) { %ud = 0 }
    else { %b = $gettok(%b,2,44) }
  }
  filter -fw $"(%file) %win1 %b $+ .*
  while (1) {
    inc %i
    %t = %b $+ . $+ %i $+ .isaction *
    clear %win2
    if ($fline(%win1,%t,0)) {
      filter -ww %win1 %win2 %b $+ . $+ %i $+ .*
      _protaction.loadfile2 %win2
    }
    else { break }
  }
  if ($chr(44) isin $1) && (%ud) { did -c %d 480 }
  else { did -u %d 480 }
  if ($chr(44) isin $did(%d,500,4)) && ($did(%d,480).state) { did -b %d 1,2,3,4,5,6,51,52,56,57,58,59,60,66,67,68,69,70,100,101,102,105,106,107,108,109,110,115,116,117,118,155,156,157,158,159,170,171,172,173,174,175,176,200,201,202,203,205,206,207,211,212,213,221,222,231,232,233,234,236,237,238,239,251,252,253 }
  else { did -e %d 1,2,3,4,5,6,51,52,56,57,58,59,60,66,67,68,69,70,100,101,102,105,106,107,108,109,110,115,116,117,118,155,156,157,158,159,170,171,172,173,174,175,176,200,201,202,203,205,206,207,211,212,213,221,222,231,232,233,234,236,237,238,239,251,252,253 }
  close -@ %win1 %win2
}
alias -l _protaction.loadfile2 {
  var %d = _protaction,%i = 1,%win = $1,%t,%num
  _protaction.new
  %num = $did(%d,1).lines
  while (%i <= $line(%win,0)) {
    tokenize 32 $line(%win,%i)
    %t = $gettok($1,3,46)
    if (%t == warnyou) { did -o %d 401 %num $2- }
    elseif (%t == warn) { did -o %d 402 %num $2- }
    elseif (%t == warnchan) { did -o %d 403 %num $2- }
    elseif (%t == deop) { did -o %d 404 %num $2- }
    elseif (%t == ban) { did -o %d 405 %num $2- }
    elseif (%t == kick) { did -o %d 406 %num $2- }
    elseif (%t == ignore) { did -o %d 407 %num $2- }
    elseif (%t == nick) { did -o %d 408 %num $2- }
    elseif (%t == sound) { did -o %d 409 %num $2- }
    elseif (%t == flash) { did -o %d 410 %num $2- }
    elseif (%t == modes) { did -o %d 411 %num $2- }
    elseif (%t == topic) { did -o %d 412 %num $2- }
    elseif (%t == custom) { did -o %d 413 %num $2- }
    inc %i
  }
}
alias -l _protaction.savefile {
  var %d = _protaction,%file = $_protactinifile,%type,%win = @__protactionsavefile,%i = 1
  if ($dialog(%d) == $null) { return }
  _protaction.savebuf *
  %type = $did(%d,500,4)
  if ($chr(44) isin %type) && ($did(%d,480).state) {
    _protaction.remsection %type
    return
  }
  _openwins %win
  filter -fwx $"(%file) %win %type $+ .*
  while (%i <= $did(%d,1).lines) {
    aline %win %type $+ . $+ %i $+ .isaction 1
    aline %win %type $+ . $+ %i $+ .warnyou $did(%d,401,%i)
    aline %win %type $+ . $+ %i $+ .warn $did(%d,402,%i)
    aline %win %type $+ . $+ %i $+ .warnchan $did(%d,403,%i)
    aline %win %type $+ . $+ %i $+ .deop $did(%d,404,%i)
    aline %win %type $+ . $+ %i $+ .ban $did(%d,405,%i)
    aline %win %type $+ . $+ %i $+ .kick $did(%d,406,%i)
    aline %win %type $+ . $+ %i $+ .ignore $did(%d,407,%i)
    aline %win %type $+ . $+ %i $+ .nick $did(%d,408,%i)
    aline %win %type $+ . $+ %i $+ .sound $did(%d,409,%i)
    aline %win %type $+ . $+ %i $+ .flash $did(%d,410,%i)
    aline %win %type $+ . $+ %i $+ .modes $did(%d,411,%i)
    aline %win %type $+ . $+ %i $+ .topic $did(%d,412,%i)
    aline %win %type $+ . $+ %i $+ .custom $did(%d,413,%i)
    inc %i
  }
  savebuf %win $"(%file)
  close -@ %win
}
alias -l _protaction.refresh-EB {
  var %d = _protaction
  if ($chr(44) isin $did(%d,500,4)) && ($did(%d,480).state) { return }
  if ($_not($did(%d,500,1))) { did -b %d 66,67,68,69,70,231,232,233,234,236,237,238,239 }
  else { did -e %d 66 }
  did $iif($did(%d,51).state,-e,-b) %d 52
  did $iif($did(%d,56).state,-e,-b) %d 57,58,59,60
  did $iif($did(%d,66).state,-e,-b) %d 67,68,69,70
  if ($did(%d,500,3)) { did -b %d 56,57,58,59,60 }
  if ($did(%d,500,2)) { did -b %d 57,58,59,67,68 }
  did $iif($did(%d,101).state,-e,-b) %d 102
  did $iif($did(%d,106).state,-e,-b) %d 107,108,109,110
  did $iif($did(%d,106).state && $did(%d,107).state,-e,-b) %d 108
  did $iif($did(%d,116).state,-e,-b) %d 117,118
  if ($did(%d,500,2)) || ($did(%d,500,3)) { did -b %d 100,101,102,105,106,107,108,109,110,115,116,117,118 }
  did $iif($did(%d,156).state,-e,-b) %d 157,158,159,170,171,172,173,174,175,176
  did $iif($did(%d,156).state && $did(%d,157).state,-e,-b) %d 158
  if ($did(%d,500,2)) { did -b %d 155,156,157,158,159,170,171,172,173,174,175,176 }
  if ($did(%d,500,3)) { did -bh %d 159 }
  did $iif($did(%d,201).state,-e,-b) %d 202,203,205,206,207
  did $iif($did(%d,201).state && $did(%d,202).state,-e,-b) %d 203
  did $iif($did(%d,201).state && $did(%d,206).state,-e,-b) %d 207
  if ($did(%d,500,2)) { did -b %d 200,201,202,203,205,206,207 }
  did $iif($did(%d,211).state,-e,-b) %d 212,213
  did $iif($did(%d,231).state,-e,-b) %d 232,234
  did $iif($did(%d,231).state && $did(%d,232).state,-e,-b) %d 233
  did $iif($did(%d,236).state,-e,-b) %d 237,239
  did $iif($did(%d,236).state && $did(%d,237).state,-e,-b) %d 238
  did $iif($did(%d,221).state,-e,-b) %d 222
  did $iif($did(%d,251).state,-e,-b) %d 252,253
  did -o %d 67 1 $iif($did(%d,69).state,/onotice,/notice)
  did -o %d 68 1 $iif($did(%d,69).state,/omsg,/msg)
}
ON *:DIALOG:_protaction:*:*:{
  if ($devent == init) {
    _mdx.init $_icofile(pprot.ico)
    _dummy $_lang.loaddialog($dname,$dname,00086969,main.lang,$scriptdir)
    return
  }
  elseif ($devent == edit) { _protaction.savebuf $did }
  elseif ($devent == sclick) {
    _protaction.savebuf $did
    if ($did == 1) { _protaction.refresh }
    elseif ($did == 2) {
      _protaction.new
      _protaction.refresh
    }
    elseif ($did == 3) {
      if ($did(1).sel) {
        var %did = 413,%sel = $did(1).sel
        did -d $dname 1 %sel
        while (%did >= 401) {
          did -d $dname %did %sel
          dec %did
        }
        _protaction.sortactions %sel
        _protaction.refresh
      }
    }
    elseif ($did == 4) {
      if ($did(1).sel > 1) {
        var %did = 413,%sel = $did(1).sel,%t
        while (%did >= 401) {
          %t = $did($dname,%did,%sel)
          did -d $dname %did %sel
          did -i $dname %did $calc(%sel - 1) %t
          dec %did
        }
        _protaction.sortactions $calc(%sel - 1)
        _protaction.refresh
      }
    }
    elseif ($did == 5) {
      if ($did(1).sel < $did(1).lines) {
        var %did = 413,%sel = $did(1).sel,%t
        while (%did >= 401) {
          %t = $did($dname,%did,%sel)
          did -d $dname %did %sel
          did -i $dname %did $calc(%sel + 1) %t
          dec %did
        }
        _protaction.sortactions $calc(%sel + 1)
        _protaction.refresh
      }
    }
    elseif ($did == 6) { _protaction.default $did(500,4) }
    elseif ($did == 212) {
      if ($did(212) != $null) { did -r $dname 212 }
      else { _protaction.devent.selectsoundfile }
    }
    elseif ($did == 213) {
      if (*.wav iswm $did(212)) && ($isfile($did(212))) { .splay $did(212) }
    }
    elseif ($did == 480) {
      if ($chr(44) isin $did(500,4)) && ($did(480).state) { did -b $dname 1,2,3,4,5,6,51,52,56,57,58,59,60,66,67,68,69,70,100,101,102,105,106,107,108,109,110,115,116,117,118,155,156,157,158,159,170,171,172,173,174,175,176,200,201,202,203,205,206,207,211,212,213,221,222,231,232,233,234,236,237,238,239,251,252,253 }
      else { did -e $dname 1,2,3,4,5,6,51,52,56,57,58,59,60,66,67,68,69,70,100,101,102,105,106,107,108,109,110,115,116,117,118,155,156,157,158,159,170,171,172,173,174,175,176,200,201,202,203,205,206,207,211,212,213,221,222,231,232,233,234,236,237,238,239,251,252,253 }
    }
    elseif ($did == 490) {
      _protaction.savefile
      if ($dialog(cprot)) { dialog -v cprot }
      elseif ($dialog(pprot)) { dialog -v pprot }
      _unloadprotactionmrc
    }
    elseif ($did == 491) {
      if ($dialog(cprot)) { dialog -v cprot }
      elseif ($dialog(pprot)) { dialog -v pprot }
      _unloadprotactionmrc
    }
  }
  _protaction.refresh-EB
}
alias -l _protaction.devent.selectsoundfile {
  var %d = _protaction,%file
  if ($dialog(%d) == $null) { return }
  %file = $$dir="Select sound file:" *.wav
  if ($dialog(%d) == $null) || ($_not($isfile(%file))) { return }
  did -o %d 212 1 %file
  _protaction.savebuf 212
}
alias -l _protaction.sortactions {
  var %d = _protaction,%i = 1,%n
  if ($dialog(%d) == $null) { return }
  %n = $did(%d,1).lines
  while (%i <= %n) {
    did -o %d 1 %i %i
    inc %i
  }
  if ($1 <= %n) || ($calc($1 - 1) <= %n) { did -c %d 1 $ifmatch }
}
alias -l _protaction.savebuf {
  var %d = _protaction,%l
  if ($dialog(%d) == $null) { return }
  %l = $did(%d,1).sel
  if (%l == $null) { return }
  if ($1 == *) || ($istok(51 52,$1,32)) { did -o %d 401 %l $did(%d,51).state $did(%d,52) }
  if ($1 == *) || ($istok(56 57 58  59 60,$1,32)) { did -o %d 402 %l $did(%d,56).state $did(%d,57).state $did(%d,58).state $__protaction.savebuf.getmask(%d,59) $did(%d,60) }
  if ($1 == *) || ($istok(66 67 68 69 70,$1,32)) { did -o %d 403 %l $did(%d,66).state $did(%d,67).state $did(%d,68).state $did(%d,69).state $did(%d,70) }
  if ($1 == *) || ($istok(101 102,$1,32)) { did -o %d 404 %l $did(%d,101).state $__protaction.savebuf.getmask(%d,102) }
  if ($1 == *) || ($istok(106 107 108 109 110,$1,32)) { did -o %d 405 %l $did(%d,106).state $did(%d,107).state $iif($gettok($did(%d,108),1,32),$gettok($did(%d,108),1,32),$null) $__protaction.savebuf.getmask(%d,109) $did(%d,110) }
  if ($1 == *) || ($istok(116 117 118,$1,32)) { did -o %d 406 %l $did(%d,116).state $__protaction.savebuf.getmask(%d,117) $did(%d,118) }
  if ($1 == *) || ($istok(156 157 158 159 170 171 172 173 174 175 176,$1,32)) { did -o %d 407 %l $did(%d,156).state $did(%d,157).state $iif($gettok($did(%d,158),1,32),$gettok($did(%d,158),1,32),$null) $__protaction.savebuf.getmask(%d,159) $did(%d,170).state $did(%d,171).state $did(%d,172).state $did(%d,173).state $did(%d,174).state $did(%d,175).state $did(%d,176) }
  if ($1 == *) || ($istok(201 202 203 205 206 207,$1,32)) { did -o %d 408 %l $did(%d,201).state $did(%d,202).state $iif($gettok($did(%d,203),1,32),$gettok($did(%d,203),1,32),$null) $did(%d,205).state $did(%d,206).state $did(%d,207) }
  if ($1 == *) || ($istok(211 212,$1,32)) { did -o %d 409 %l $did(%d,211).state $did(%d,212) }
  if ($1 == *) || ($istok(221 222,$1,32)) { did -o %d 410 %l $did(%d,221).state $did(%d,222) }
  if ($1 == *) || ($istok(231 232 233 234,$1,32)) { did -o %d 411 %l $did(%d,231).state $did(%d,232).state $iif($gettok($did(%d,233),1,32),$gettok($did(%d,233),1,32),$null) $did(%d,234) }
  if ($1 == *) || ($istok(236 237 238 239,$1,32)) { did -o %d 412 %l $did(%d,236).state $did(%d,237).state $iif($gettok($did(%d,238),1,32),$gettok($did(%d,238),1,32),$null) $did(%d,239) }
  if ($1 == *) || ($istok(251 252,$1,32)) { did -o %d 413 %l $did(%d,251).state $did(%d,252) }
}
alias -l __protaction.savebuf.getmask {
  if ($did($1,$2).sel) { return $remove($gettok($did($1,$2,$did($1,$2).sel),1,32),[,]) }
  return NICK
}
alias -l _protaction.refresh {
  var %d = _protaction,%i,%n,%l
  if ($dialog(%d) == $null) { return }
  if ($did(%d,1).sel == $null) {
    if ($did(%d,1).lines) { did -c %d 1 1 }
    else { _protaction.new }
  }
  %l = $did(%d,1).sel
  did -u %d 51,56,57,58,66,67,68,69,101,106,107,116,156,157,170,171,172,173,174,175,201,202,205,206,211,221,231,232,236,237,251
  did -r %d 52,60,70,108,110,118,158,176,203,207,212,222,233,234,238,239,252
  tokenize 32 $did(%d,401,%l)
  if ($1) { did -c %d 51 }
  if ($2- != $null) { did -o %d 52 1 $2- }
  tokenize 32 $did(%d,402,%l)
  if ($1) { did -c %d 56 }
  if ($2) { did -c %d 57 }
  if ($3) { did -c %d 58 }
  __protaction.refresh.listmasks %d 59 $4
  if ($5- != $null) { did -o %d 60 1 $5- }
  tokenize 32 $did(%d,403,%l)
  if ($1) { did -c %d 66 }
  if ($2) { did -c %d 67 }
  if ($3) { did -c %d 68 }
  if ($4) { did -c %d 69 }
  if ($5- != $null) { did -o %d 70 1 $5- }
  tokenize 32 $did(%d,404,%l)
  if ($1) { did -c %d 101 }
  __protaction.refresh.listmasks %d 102 $2
  tokenize 32 $did(%d,405,%l)
  if ($1) { did -c %d 106 }
  if ($2) { did -c %d 107 }
  if ($3 != $null) { did -o %d 108 1 $3 }
  __protaction.refresh.listmasks %d 109 $4
  if ($5- != $null) { did -o %d 110 1 $5- }
  tokenize 32 $did(%d,406,%l)
  if ($1) { did -c %d 116 }
  __protaction.refresh.listmasks %d 117 $2
  if ($3- != $null) { did -o %d 118 1 $3- }
  tokenize 32 $did(%d,407,%l)
  if ($1) { did -c %d 156 }
  if ($2) { did -c %d 157 }
  if ($3 != $null) { did -o %d 158 1 $3 }
  __protaction.refresh.listmasks %d 159 $4
  if ($5) { did -c %d 170 }
  if ($6) { did -c %d 171 }
  if ($7) { did -c %d 172 }
  if ($8) { did -c %d 173 }
  if ($9) { did -c %d 174 }
  if ($10) { did -c %d 175 }
  if ($11- != $null) { did -o %d 176 1 $11- }
  tokenize 32 $did(%d,408,%l)
  if ($1) { did -c %d 201 }
  if ($2) { did -c %d 202 }
  if ($3) { did -o %d 203 1 $3 }
  if ($4) { did -c %d 205 }
  if ($5) { did -c %d 206 }
  if ($6- != $null) { did -o %d 207 1 $6- }
  tokenize 32 $did(%d,409,%l)
  if ($1) { did -c %d 211 }
  if ($2- != $null) { did -o %d 212 1 $2- }
  tokenize 32 $did(%d,410,%l)
  if ($1) { did -c %d 221 }
  if ($2- != $null) { did -o %d 222 1 $2- }
  tokenize 32 $did(%d,411,%l)
  if ($1) { did -c %d 231 }
  if ($2) { did -c %d 232 }
  if ($3) { did -o %d 233 1 $3 }
  if ($4- != $null) { did -o %d 234 1 $4- }
  tokenize 32 $did(%d,412,%l)
  if ($1) { did -c %d 236 }
  if ($2) { did -c %d 237 }
  if ($3) { did -o %d 238 1 $3 }
  if ($4- != $null) { did -o %d 239 1 $4- }
  tokenize 32 $did(%d,413,%l)
  if ($1) { did -c %d 251 }
  if ($2- != $null) { did -o %d 252 1 $2- }
  _protaction.refresh-EB
  _protaction.savebuf *
}
alias -l __protaction.refresh.listmasks {
  if ($3 isnum 0-19) {
    var %t = [[ $+ $3 $+ ]] *
    did -c $1 $2 $didwm($1,$2,%t,1)
  }
  else { did -c $1 $2 1 }
}
alias -l _protaction.new {
  var %d = _protaction,%old = 0,%new
  if ($dialog(%d) == $null) { return }
  if ($did(%d,1).sel == $null) {
    if ($did(%d,1).lines) {
      %old = 1
      %new = $ifmatch + 1
    }
    else { %new = 1 }
  }
  else {
    %old = $did(%d,1).sel
    %new = $did(%d,1).lines + 1
  }
  did -ac %d 1 %new
  if (%old) {
    did -o %d 401 %new $did(%d,401,%old)
    did -o %d 402 %new $did(%d,402,%old)
    did -o %d 403 %new $did(%d,403,%old)
    did -o %d 404 %new $did(%d,404,%old)
    did -o %d 405 %new $did(%d,405,%old)
    did -o %d 406 %new $did(%d,406,%old)
    did -o %d 407 %new $did(%d,407,%old)
    did -o %d 408 %new $did(%d,408,%old)
    did -o %d 409 %new $did(%d,409,%old)
    did -o %d 410 %new $did(%d,410,%old)
    did -o %d 411 %new $did(%d,411,%old)
    did -o %d 412 %new $did(%d,412,%old)
    did -o %d 413 %new $did(%d,413,%old)
  }
  else {
    did -o %d 401 %new 0 $null
    did -o %d 402 %new 0 1 0 11 $null
    did -o %d 403 %new 0 1 0 $null
    did -o %d 404 %new 0 11
    did -o %d 405 %new 0 0 30 $calc(%_masknorm + 1) $null
    did -o %d 406 %new 0 11 $null
    did -o %d 407 %new 0 0 30 $calc(%_masknorm + 1) 0 0 0 0 0 0 $null
    did -o %d 408 %new 0 1 30 0 1 <ME>_
    did -o %d 409 %new 0 $null
    did -o %d 410 %new 0 $null
    did -o %d 411 %new 0 0 30 $null
    did -o %d 412 %new 0 0 30 $null
    did -o %d 413 %new 0 $null
  }
}

;;;;;
;;;;;

alias -l _unloadprotactionmrc { _quickunload _protaction $script }