Advertisement
SaNCaK

mIRC Swear Protection

Feb 1st, 2014 (edited)
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.52 KB | None | 0 0
  1. ;-------- - -
  2. ; Aliases
  3. ;-------- - -
  4.  
  5. alias -l cx.swear {
  6.   if ($isid) { return $readini $scriptdircx-swear.ini settings $1 }
  7.   else { .writeini $scriptdircx-swear.ini settings $1 $2- }
  8. }
  9. alias -l cx.hash {
  10.   if ($hget(cx.list,0) == $lines($scriptdircx-swear.txt)) return
  11.   if ($hget(cx.list)) hfree cx.list
  12.   hmake cx.list 1000
  13.   var %i = 0
  14.   while (%i < $lines($scriptdircx-swear.txt)) {
  15.     inc %i
  16.     var %cx.input = [ $read -l [ $+ [ %i ] ] $scriptdircx-swear.txt ]
  17.     hadd cx.list %i %cx.input
  18.   }
  19. }
  20. alias -l cx.swear.chk {
  21.   var %i = 0
  22.   while (%i < $hget(cx.list,0).item) {
  23.     inc %i
  24.     if ($hget(cx.list,%i) iswm $1-) { return $true }
  25.   }
  26.   return $false
  27. }
  28.  
  29. ;-------- - -
  30. ; Popups
  31. ;-------- - -
  32.  
  33. MENU menubar,channel {
  34.   -
  35.   Swear Protection:.dialog -m cx.swear cx.swear
  36.   -
  37. }
  38.  
  39. ;-------- - -
  40. ; Dialogs
  41. ;-------- - -
  42.  
  43. dialog cx.swear {
  44.   title ">> Swear Protection"
  45.   size -1 -1 124 84
  46.   option dbu notheme
  47.   button "done", 1, 50 74 24 9, flat cancel
  48.   box "Swear Protection Settings", 2, 0 28 124 44
  49.   button "del", 3, 100 55 16 10, flat
  50.   combo 4, 4 55 92 50, sort drop
  51.   button "add", 5, 100 40 16 10, flat
  52.   edit "", 6, 4 40 92 11, autohs
  53.   box "Adjust Console", 7, 0 0 124 24
  54.   radio "Disable", 8, 87 10 36 8, flat
  55.   radio "Enable", 9, 8 10 32 8, flat
  56. }
  57.  
  58. on *:DIALOG:cx.swear:*:*: {
  59.   if (($devent == INIT) && ($did == 0)) {
  60.     if ($cx.swear(toggle) == enable) {
  61.       did -c $dname 9 | did -u $dname 8 | did -e $dname 3,4,5,6
  62.       var %i = 0
  63.       while (%i < $lines($scriptdircx-swear.txt)) {
  64.         inc %i
  65.         .did -a $dname 4 [ $read -l [ $+ [ %i ] ] $scriptdircx-swear.txt ]
  66.       }
  67.     }
  68.     else { did -c $dname 8 | did -u $dname 9 | did -b $dname 3,4,5,6 }
  69.   }
  70.   if ($devent == SCLICK) {
  71.     if ($did == 3) { if ($did($dname,4).sel) { .write -dw [ $+ [ $did($dname,4).text ] ] $scriptdircx-swear.txt | did -d $dname 4 $did($dname,4).sel } }
  72.     if ($did == 5) { if ($did($dname,6).text) { did -a $dname 4 $ifmatch | .write $scriptdircx-swear.txt $ifmatch } }
  73.     if ($did == 8) { cx.swear toggle disable | did -c $dname 8 | did -u $dname 9 | did -b $dname 3,4,5,6 }
  74.     if ($did == 9) { cx.swear toggle enable | did -c $dname 9 | did -u $dname 8 | did -e $dname 3,4,5,6 }
  75.   }
  76. }
  77.  
  78. ;-------- - -
  79. ; Remote
  80. ;-------- - -
  81.  
  82. on *:TEXT:*:#: {
  83.   if ((($me isop $chan) && ($nick !isop $chan) && ($cx.swear(toggle) == enable))) {
  84.     cx.hash
  85.     if ($cx.swear.chk($strip($1-)) == $true) {
  86.       .raw MODE # +b $wildsite
  87.       .kick # $nick >>> Swear protection.
  88.     }
  89.   }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement