Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. menu channel,status,menubar,query {
  2. $iif(o !isincs $usermode,$style(2)) Spamfilter Dialog:spamfilterdialog
  3. }
  4. alias -l spamfilterdialog { dialog $iif($dialog(spam_dia),-v,-m spam_dia) spam_dia }
  5. dialog spam_dia {
  6. title "Spamfilter Dialog By Danneh.."
  7. size -1 -1 266 309
  8. option dbu
  9. list 1, 2 2 262 119, size extsel hsbar vsbar
  10. button "Refresh", 2, 149 123 37 12
  11. button "Rem Sel", 3, 79 123 37 12
  12. button "Rem All", 4, 3 123 37 12
  13. text "Total Spamfilters:", 5, 194 125 42 8
  14. text "", 6, 239 125 12 8
  15. box "Type:", 7, 2 137 262 50
  16. check "c = Channel Msg", 8, 11 145 50 10
  17. check "p = Private Msg", 9, 109 145 50 10
  18. check "n = Private Notice", 10, 200 145 54 10
  19. check "N = Channel Notice", 11, 11 158 57 10
  20. check "P = Part Msg", 12, 109 158 50 10
  21. check "q = Quit Msg", 13, 200 158 50 10
  22. check "d = DCC", 14, 109 171 50 10
  23. box "Action:", 15, 2 190 262 50
  24. check "Kill", 16, 11 199 50 10
  25. check "Shun", 17, 11 212 50 10
  26. check "Kline", 18, 109 199 50 10
  27. check "Gline", 19, 109 212 50 10
  28. check "Zline", 20, 200 199 50 10
  29. check "GZline", 21, 200 212 50 10
  30. check "TempShun (Only shun's current session)", 22, 11 225 106 10
  31. box "Options:", 23, 2 243 262 50
  32. text "Regex (Text to catch on):", 24, 6 252 63 8
  33. edit "", 25, 71 251 189 10
  34. text "Reason (Please use _ and not spaces):", 26, 6 265 94 8
  35. edit "", 27, 103 264 157 10
  36. text "TKL Time (The - is for BLOCK and KILL):", 28, 6 278 94 8
  37. combo 29, 103 277 157 50, size drop
  38. button "Ok", 30, 114 295 37 12, ok
  39. button "Cancel", 31, 168 295 37 12, cancel
  40. button "Add Filter", 32, 60 295 37 12
  41. check "Block", 33, 200 225 50 10
  42. menu "File", 34
  43. menu "Options", 35, 34
  44. item "Clear Spamfilter", 36, 35
  45. item "Exit", 37, 34
  46. }
  47. on *:DIALOG:spam_dia:init:*: {
  48. didtok $dname 29 124 -|15m|30m|45m|1h|3h|5h|1d|3d|5d|30d|60d
  49. var %a = G
  50. Spamfilterlist
  51. .timerspamlist 1 5 loadbuf -o spam_dia 1 spamlist.txt
  52. }
  53. on *:dialog:spam_dia:menu:35,36: {
  54. if ($did == 35) {
  55. did -r $dname 1,6,25,27
  56. did -u $dname 8-14,16-22
  57. }
  58. if (did == 36) {
  59. dialog -x $dname
  60. }
  61. }
  62. on *:DIALOG:spam_dia:sclick:2-4,8-14,16-22,32: {
  63. if ($did == 2) {
  64. did -r $dname 1,6
  65. write -c spamlist.txt
  66. Spamfilterlist
  67. .timerspamlist 1 5 loadbuf -o spam_dia 1 spamlist.txt
  68. .timerhsbar 1 6 did -z spam_dia 1
  69. }
  70. if ($did == 3) {
  71. if ($did($dname,1,0).sel == 1) {
  72. spamfilter del $gettok($did(spam_dia,1).seltext,2,32) $gettok($did(spam_dia,1).seltext,3,32) $gettok($did(spam_dia,1).seltext,6,32) $gettok($did(spam_dia,1).seltext,7,32) $gettok($did(spam_dia,1).seltext,9-,32)
  73. }
  74. else {
  75. var %a = 1
  76. while (%a <= $did(spam_dia,1,0).sel) {
  77. spamfilter del $gettok($did(spam_dia,1,$did(spam_dia,1,%a).sel).text,2,32) $gettok($did(spam_dia,1,$did(spam_dia,1,%a).sel).text,3,32) $gettok($did(spam_dia,1,$did(spam_dia,1,%a).sel).text,6,32) $gettok($did(spam_dia,1,$did(spam_dia,1,%a).sel).text,7,32) $gettok($did(spam_dia,1,$did(spam_dia,1,%a).sel).text,9-,32)
  78. inc %a
  79. }
  80. }
  81. }
  82. if ($did == 4) {
  83. var %a = 1
  84. while (%a <= $did($dname,1).lines) {
  85. spamfilter del $gettok($did($dname,1,%a),2,32) $gettok($did($dname,1,%a),3,32) $gettok($did($dname,1,%a),6,32) $gettok($did($dname,1,%a),7,32) $gettok($did($dname,1,%a),9-,32)
  86. inc %a
  87. }
  88. }
  89. if ($did == 32) {
  90. if ($did(25) == $null) || ($did(27) == $null) || ($did(29) == $null) { noop $input(Please fill in ALL required fields.,o) | HALT }
  91. else {
  92. if ($did(8).state == 1) { set -u10 %type %type $+ c }
  93. if ($did(9).state == 1) { set -u10 %type %type $+ p }
  94. if ($did(10).state == 1) { set -u10 %type %type $+ n }
  95. if ($did(11).state == 1) { set -u10 %type %type $+ N }
  96. if ($did(12).state == 1) { set -u10 %type %type $+ P }
  97. if ($did(13).state == 1) { set -u10 %type %type $+ q }
  98. if ($did(14).state == 1) { set -u10 %type %type $+ d }
  99. if ($did(33).state == 1) { set -u10 %action block }
  100. if ($did(16).state == 1) { set -u10 %action kill }
  101. if ($did(17).state == 1) { set -u10 %action shun }
  102. if ($did(18).state == 1) { set -u10 %action kline }
  103. if ($did(19).state == 1) { set -u10 %action gline }
  104. if ($did(20).state == 1) { set -u10 %action zline }
  105. if ($did(21).state == 1) { set -u10 %action gzline }
  106. if ($did(22).state == 1) { set -u10 %action tempshun }
  107. spamfilter add %type %action $did(29).text $did(27).text $did(25).text
  108. noop $input(Desired spamfilter has been added.,o)
  109. }
  110. }
  111. }
  112. on *:dialog:spam_dia:close:*:{
  113. write -c spamlist.txt
  114. }
  115. alias Spamfilterlist {
  116. .enable #spamlist
  117. .stats f
  118. }
  119.  
  120. #spamlist off
  121. raw 229:*:{
  122. write spamlist.txt $2-
  123. haltdef
  124. did -ra spam_dia 6 $lines(spamlist.txt)
  125. }
  126. raw 219:*:{
  127. .disable #spamlist
  128. haltdef
  129. }
  130. #spamlist end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement