All pastes #349843 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-11 02:25 UTC
rendered paste body
dialog Channel_protector { 
  title "Protect Your Channel V0.1 - By Steiner" 
  size -1 -1 159 154 
  option dbu 
  tab "General", 1, 0 -3 362 242 
  box "Updating", 5, 104 57 54 52, tab 1 
  text "Current Version: Version 0.1", 6, 106 68 50 20, tab 1 center 
  button "Check For Updates", 7, 106 92 50 12, tab 1 
  box "Current Status", 8, 104 15 54 42, tab 1 
  radio "Off", 9, 106 26 19 14, group tab 1 
  radio "On", 10, 106 36 20 14, tab 1 
  box "Toggling On/Off", 11, 3 15 98 94, tab 1 
  text "Toggling on/off allowed?", 12, 8 25 86 10, tab 1 
  radio "No", 13, 8 37 50 10, group tab 1 
  radio "Yes", 14, 8 47 50 10, tab 1 
  check "By Me", 15, 15 57 50 10, disable tab 1 
  check "By Voices", 16, 15 87 50 10, disable tab 1 
  check "By Ops", 17, 15 67 50 10, disable tab 1 
  check "By Regulars", 18, 15 97 50 10, disable tab 1 
  check "By HalfOps", 19, 15 77 50 10, disable tab 1 
  box "Flood Control", 20, 3 110 102 42, tab 1 
  text "Turn Flood Control On For", 4, 7 118 66 7, tab 1 
  check "Actions", 22, 7 135 37 7, tab 1 
  check "Text", 23, 7 127 37 7, tab 1 
  check "Join/Parts", 24, 7 143 39 7, tab 1 
  button "Flood Settings", 21, 53 129 45 12, tab 1 
  button "Apply Settings", 75, 107 113 50 17, tab 1 
  button "Close", 76, 107 132 50 17, tab 1 cancel 
  tab "Flooding", 2 
  box "Text", 25, 2 15 154 36, tab 2 
  text "Lines Allowed", 26, 7 25 37 8, tab 2 
  text "Per Seconds", 27, 7 36 37 8, tab 2 
  edit "", 28, 53 24 23 10, tab 2 
  edit "", 29, 53 35 23 10, tab 2 
  box "Actions", 30, 2 50 154 35, tab 2 
  box "Join/Part", 31, 2 85 154 36, tab 2 
  text "Lines Allowed", 36, 7 60 37 8, tab 2 
  text "Per Seconds", 38, 7 70 37 8, tab 2 
  edit "", 41, 53 70 23 10, tab 2 
  edit "", 42, 53 59 23 10, tab 2 
  button "Apply Settings", 33, 93 135 44 12, tab 2 
  text "Lines Allowed", 35, 7 95 37 8, tab 2 
  text "Per Seconds", 37, 7 105 37 8, tab 2 
  edit "", 40, 53 94 23 10, tab 2 
  edit "", 39, 53 104 23 10, tab 2 
  button "Close", 59, 19 135 44 12, tab 2 
  tab "Badwords", 3 
  box "Adding A Badword", 43, 2 15 71 38, tab 3 
  text "Badword", 44, 5 26 25 8, tab 3 
  edit "", 45, 30 25 40 10, tab 3 autohs 
  button "Add Badword", 46, 18 38 37 12, tab 3 
  box "Status", 47, 75 15 36 38, tab 3 
  radio "Enable", 49, 79 25 27 12, tab 3 
  radio "Disable", 50, 79 38 29 11, tab 3 
  box "List Of Current Badwords", 48, 2 54 154 99, tab 3 
  list 51, 5 61 147 77, tab 3 size vsbar 
  button "Show", 52, 24 139 39 12, tab 3 
  button "Delete Selected", 53, 95 139 42 12, tab 3 
  button "Apply Settings", 32, 114 18 39 12, tab 3 
  button "Close", 34, 114 40 39 12, tab 3 
  tab "Misellaneous", 54 
  box "Actions", 60, 51 12 56 36, tab 54 
  text "Allow Actions", 61, 56 19 42 8, tab 54 
  radio "Yes", 62, 54 27 50 7, group tab 54 
  radio "No", 63, 54 37 50 7, tab 54 
  box "What To Do When Someone Doesn't Follow Rules?", 64, 3 49 153 69, tab 54 
  combo 65, 7 61 60 28, tab 54 size drop 
  radio "Kick", 66, 8 93 50 10, group tab 54 
  radio "Ban", 67, 8 103 50 10, tab 54 
  edit "", 70, 76 70 50 10, tab 54 autohs 
  button "Apply Settings", 71, 92 132 41 12, tab 54 
  text "Message", 72, 76 60 25 8, tab 54 
  text "Unban After ... Seconds", 73, 76 85 65 8, hide tab 54 
  edit "", 74, 76 98 20 10, hide tab 54 
  button "Close", 77, 26 132 41 12, tab 54 
} 
menu * { 
  Protect Your Channel:/getit 
} 
alias /getit { 
  /dialog -ms Channel_protector Channel_protector 
} 
on *:dialog:Channel_protector:init:0:{ 
  /did -a Channel_protector 65 Any Action 
  /did -a Channel_protector 65 Text Flood 
  /did -a Channel_protector 65 Join Flood 
  /did -a Channel_protector 65 Badword 
  /did -a Channel_protector 65 Action Flood 
  /did -c Channel_protector $iif($readini(ChanProt.ini,Status,General) == On,10,9) 
  /did -c Channel_protector $iif($readini(ChanProt.ini,Status,Badwords) == On,49,50) 
  /did -c Channel_protector $iif($readini(ChanProt.ini,Status,Toggling) == On,14,13) 
  /did -c Channel_protector $iif($readini(ChanProt.ini,Status,Actions) == On,63,62) 
  if ($did(14).state == 1) did -e Channel_protector 15-19 
  if ($readini(ChanProt.ini,Toggling,Me) == 1) did -c Channel_Protector 15 
  if ($readini(ChanProt.ini,Toggling,Ops) == 1) did -c Channel_Protector 17 
  if ($readini(ChanProt.ini,Toggling,Halfops) == 1) did -c Channel_Protector 19 
  if ($readini(ChanProt.ini,Toggling,Voices) == 1) did -c Channel_Protector 16 
  if ($readini(ChanProt.ini,Toggling,Regulars) == 1) did -c Channel_Protector 18 
  if ($readini(ChanProt.ini,Flood,Text) == 1) did -c Channel_Protector 23 
  if ($readini(ChanProt.ini,Flood,Actions) == 1) did -c Channel_Protector 22 
  if ($readini(ChanProt.ini,Flood,Join/Part) == 1) did -c Channel_Protector 24 
  did -a Channel_Protector 28 $readini(ChanProt.ini,Text-Flood,Lines) 
  did -a Channel_Protector 29 $readini(ChanProt.ini,Text-Flood,Seconds) 
  did -a Channel_Protector 42 $readini(ChanProt.ini,Action-Flood,Lines) 
  did -a Channel_Protector 41 $readini(ChanProt.ini,Action-Flood,Seconds) 
  did -a Channel_Protector 40 $readini(ChanProt.ini,Join/Part-Flood,Lines) 
  did -a Channel_Protector 39 $readini(ChanProt.ini,Join/Part-Flood,Seconds) 
} 
on *:dialog:Channel_protector:sclick:14:{ 
  did -e Channel_protector 15-19 
} 
on *:dialog:Channel_protector:sclick:13:{ 
  did -ub Channel_protector 15-19 
} 
on *:dialog:Channel_protector:sclick:52:{ 
  did -r Channel_Protector 51 
  var %x 1 
  while ($ini(ChanProt.ini,badwords,%x)) { 
    did -a Channel_protector 51 $ini(ChanProt.ini,badwords,%x) 
    /inc %x 
  } 
} 
on *:dialog:Channel_Protector:sclick:46:{ 
  writeini ChanProt.ini badwords $did(45) Badword 
  echo -as $did(45) added as badword! 
  did -r Channel_Protector 45 
} 
on *:dialog:Channel_Protector:sclick:53:{ 
  remini ChanProt.ini Badwords $did(51).seltext Badword 
  echo -as $did(51).seltext deleted as badword! 
  did -d Channel_Protector 51 $did(51).sel 
} 
on *:dialog:Channel_Protector:sclick:76,59,34,77:{ 
  dialog -x Channel_Protector 
} 
on *:dialog:Channel_Protector:sclick:75,33,32,71:{ 
  writeini ChanProt.ini Status Toggling $iif($replace($did(14).state,1,On) == On,$v2,Off) 
  writeini ChanProt.ini Status General $iif($replace($did(10).state,1,On) == On,$v2,Off) 
  writeini ChanProt.ini Status Badwords $iif($replace($did(49).state,1,On) == On,$v2,Off) 
  writeini ChanProt.ini Status Actions $iif($replace($did(63).state,1,On) == On,$v2,Off) 
  writeini ChanProt.ini Toggling Me $did(15).state 
  writeini ChanProt.ini Toggling Ops $did(17).state 
  writeini ChanProt.ini Toggling Halfops $did(19).state 
  writeini ChanProt.ini Toggling Voices $did(16).state 
  writeini ChanProt.ini Toggling Regulars $did(18).state 
  writeini ChanProt.ini Flood Text $did(23).state 
  writeini ChanProt.ini Flood Actions $did(22).state 
  writeini ChanProt.ini Flood Join/Part $did(24).state 
  writeini ChanProt.ini Text-Flood Lines $did(28) 
  writeini ChanProt.ini Text-Flood Seconds $did(29) 
  writeini ChanProt.ini Action-Flood Lines $did(42) 
  writeini ChanProt.ini Action-Flood Seconds $did(41) 
  writeini ChanProt.ini Join/Part-Flood Lines $did(40) 
  writeini ChanProt.ini Join/Part-Flood Seconds $did(39) 
  if ($did(66).state == 1) set %qsdf $replace($did(65),$chr(32),$chr(95)) /Kick $did(70) 
  if ($did(67).state == 1) set %qsdf $replace($did(65),$chr(32),$chr(95)) /Ban -ku $+ $did(74) $did(70) 
  if (!$did(65)) halt 
  if ($did(65)) writeini ChanProt.ini Punishment %qsdf 
  unset %qsdf 
} 
on *:dialog:Channel_Protector:sclick:21:{ 
  did -f Channel_Protector 2 
} 
on *:dialog:Channel_Protector:sclick:66-69:{ 
  if ($did == 67) did -v Channel_Protector 73-74 
  if ($did !== 67) did -h Channel_Protector 73-74 
} 
on *:dialog:Channel_Protector:sclick:65:{ 
  did -r Channel_Protector 70 
  did -a Channel_Protector 70 $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),2,32),$gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),3-,32),$gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),2-,32)) 
  did -u Channel_Protector $iif($gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),1,32) == /kick,67,66) 
  did -c Channel_Protector $iif($gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),1,32) == /ban,67,66) 
  if ($gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),1,32) == /ban) { 
    did -v Channel_Protector 73-74 
    did -r Channel_Protector 74 
    did -a Channel_Protector 74 $remove($gettok($readini(ChanProt.ini,Punishment,$replace($did(65),$chr(32),$chr(95))),2,32),-ku) 
  } 
  else { 
    did -h Channel_Protector 73-74 
  } 
} 
on *:dialog:Channel_Protector:sclick:7:{ 
  /dialog -m Updating Updating 
  set %currentversion $did(6) 
} 
dialog Updating { 
  title "Updating Your Channel Protector" 
  size -1 -1 139 100 
  option dbu 
  button "Check For Updates", 1, 11 83 53 12 
  button "Close", 2, 88 83 37 12, cancel 
  box "Update Progress", 4, 7 4 122 72 
  list 3, 12 13 111 59, size 
} 
on *:dialog:Updating:sclick:1:{ 
  did -r Updating 3 
  did -ab Updating 1 Please Wait... 
  if ($sock(Updating)) .sockclose Updating 
  sockopen Updating updatecp.110mb.com 80 
} 
on *:SOCKOPEN:Updating: { 
  sockwrite -nt $sockname GET /Update.htm HTTP/1.1 
  sockwrite -nt $sockname Host: updatecp.110mb.com 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:Updating: { 
  if ($sockerr) { 
    notice %nick Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message. 
    halt 
  } 
  else { 
    var %sockreader 
    sockread %sockreader 
    if (%update) { 
      unset %update 
      did -a Updating 3 %sockreader 
      did -ae Updating 1 Check For Updates 
    } 
    if (*Most Recent Version* iswm %sockreader) { 
      set %update %sockreader 
      did -a Updating 3 %currentversion 
      did -a Updating 3 %sockreader 
    } 
  } 
} 
on *:dialog:Updating:close:*:{ 
  unset %currentversion 
} 
on *:text:!cp *:#:{ 
  if (($iif($readini(Chanprot.ini,Toggling,Me) == 1, $address($nick,2),$v2) == $address($me,2)) || ($iif($readini(Chanprot.ini,Toggling,Ops) == 1,$nick,$v2) isop $chan) || ($iif($readini(Chanprot.ini,Toggling,Halfops) == 1,$nick,$v2) ishop $chan) || ($iif($readini(Chanprot.ini,Toggling,Voices) == 1,$nick,$v2) isvoice $chan)) || ($iif($readini(Chanprot.ini,Toggling,Regulars) == 1,$nick,$v2) isreg $chan) { 
    if ($2 == on) { 
      writeini ChanProt.ini Status General On 
      msg $chan $chr(3) $+ 4Channel Protector $chr(3) $+ 12is now $chr(3) $+ 4on 
    } 
    if ($2 == off) { 
      writeini ChanProt.ini Status General off 
      msg $chan $chr(3) $+ 4Channel Protector $chr(3) $+ 12is now $chr(3) $+ 4off 
    } 
  } 
} 
on *:action:*:#:{ 
  if (($readini(ChanProt.ini,Status,Badwords) == on) && ($readini(ChanProt.ini,Status,General) == On)) { 
    var %x 1 
    while ($ini(ChanProt.ini,badwords,%x)) { 
      if ($ini(ChanProt.ini,badwords,%x) isin $1-) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Badword),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Badword),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Badword),2,32),$gettok($readini(ChanProt.ini,Punishment,Badword),3-,32),$gettok($readini(ChanProt.ini,Punishment,Badword),2-,32)) 
        halt 
      } 
      /inc %x 
    } 
  } 
  if (($readini(ChanProt.ini,Status,Actions) == On) && ($readini(ChanProt.ini,Status,General) == On)) { 
    $iif($gettok($readini(ChanProt.ini,Punishment,Any_Action),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Any_Action),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Any_Action),2,32),$gettok($readini(ChanProt.ini,Punishment,Any_Action),3-,32),$gettok($readini(ChanProt.ini,Punishment,Any_Action),2-,32)) 
  } 
  if (($readini(ChanProt.ini,Flood,Actions) == 1) && ($readini(ChanProt.ini,Status,General) == On)) { 
    if (%actionflood. [ $+ [ $nick ] ]) { 
      inc %actionflood. [ $+ [ $nick ] ] 
      if (%actionflood. [ $+ [ $nick ] ] >= $calc($readini(ChanProt.ini,Action-Flood,Lines) +1)) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Action_Flood),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Action_Flood),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Action_Flood),2,32),$gettok($readini(ChanProt.ini,Punishment,Action_Flood),3-,32),$gettok($readini(ChanProt.ini,Punishment,Action_Flood),2-,32)) 
        unset %actionflood. [ $+ [ $nick ] ] 
      } 
    } 
    else { 
      /set $+(-u,$readini(ChanProt.ini,Action-Flood,Seconds)) %actionflood. [ $+ [ $nick ] ] 1 
    } 
  } 
} 
on *:text:*:#:{ 
  if (($readini(ChanProt.ini,Status,Badwords) == on) && ($readini(ChanProt.ini,Status,General) == On)) { 
    var %x 1 
    while ($ini(ChanProt.ini,badwords,%x)) { 
      if ($ini(ChanProt.ini,badwords,%x) isin $1-) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Badword),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Badword),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Badword),2,32),$gettok($readini(ChanProt.ini,Punishment,Badword),3-,32),$gettok($readini(ChanProt.ini,Punishment,Badword),2-,32)) 
        halt 
      } 
      /inc %x 
    } 
  } 
  if (($readini(ChanProt.ini,Flood,Text) == 1) && ($readini(ChanProt.ini,Status,General) == On)) { 
    if (%Textflood. [ $+ [ $nick ] ]) { 
      inc %Textflood. [ $+ [ $nick ] ] 
      if (%Textflood. [ $+ [ $nick ] ] >= $calc($readini(ChanProt.ini,Text-Flood,Lines) +1)) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Text_Flood),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Text_Flood),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Text_Flood),2,32),$gettok($readini(ChanProt.ini,Punishment,Text_Flood),3-,32),$gettok($readini(ChanProt.ini,Punishment,Text_Flood),2-,32)) 
        unset %Textflood. [ $+ [ $nick ] ] 
      } 
    } 
    else { 
      /set $+(-u,$readini(ChanProt.ini,Text-Flood,Seconds)) %Textflood. [ $+ [ $nick ] ] 1 
    } 
  } 
} 
on *:join:#:{ 
  if (($readini(ChanProt.ini,Flood,Join/Part) == 1) && ($readini(ChanProt.ini,Status,General) == On)) { 
    if (%joinflood. [ $+ [ $nick ] ]) { 
      inc %joinflood. [ $+ [ $nick ] ] 
      if (%joinflood. [ $+ [ $nick ] ] >= $calc($readini(ChanProt.ini,Join/Part-Flood,Lines) +1)) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Join_Flood),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Join_Flood),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Join_Flood),2,32),$gettok($readini(ChanProt.ini,Punishment,Join_Flood),3-,32),$gettok($readini(ChanProt.ini,Punishment,Join_Flood),2-,32)) 
      } 
    } 
    else { 
      /set $+(-u,$readini(ChanProt.ini,Join/Part-Flood,Seconds)) %joinflood. [ $+ [ $nick ] ] 1 
    } 
  } 
} 
on *:Part:#:{ 
  if (($readini(ChanProt.ini,Flood,Join/Part) == 1) && ($readini(ChanProt.ini,Status,General) == On)) { 
    if (%joinflood. [ $+ [ $nick ] ]) { 
      inc %joinflood. [ $+ [ $nick ] ] 
      if (%joinflood. [ $+ [ $nick ] ] >= $calc($readini(ChanProt.ini,Join/Part-Flood,Lines) +1)) { 
        $iif($gettok($readini(ChanProt.ini,Punishment,Join_Flood),1,32) == /ban,$gettok($readini(ChanProt.ini,Punishment,Join_Flood),1-2,32),$v1) $chan $nick $iif(*-k* iswm $gettok($readini(ChanProt.ini,Punishment,Join_Flood),2,32),$gettok($readini(ChanProt.ini,Punishment,Join_Flood),3-,32),$gettok($readini(ChanProt.ini,Punishment,Join_Flood),2-,32)) 
      } 
    } 
    else { 
      /set $+(-u,$readini(ChanProt.ini,Join/Part-Flood,Seconds)) %joinflood. [ $+ [ $nick ] ] 1 
    } 
  } 
}