Advertisement
SaNCaK

mIRC Secure Query

Feb 3rd, 2014
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 15.78 KB | None | 0 0
  1. on *:LOAD: {
  2.   echo -a _____________________________________________________
  3.   echo -a 4,1[15,1 SaNCaK 4,1] 0,1 Loading Add-On... 
  4.   echo -a 4,1[15,1 SaNCaK 4,1] 0,1 Add-on: 09 Secure Query  15Add-On 
  5.   echo -a 4,1[15,1 SaNCaK 4,1] 0,1 You are running mIRC $version on $os  $+ .
  6.   echo -a 4,1[15,1 SaNCaK 4,1] 0,1 Coder: 15SaNCaK 0,1 E-Mail: 15SaNCaK@SaNCaK.gen.tr 
  7.   echo -a 4,1[15,1 SaNCaK 4,1] 0,1 Copyright © 200915 http://www.sancak.gen.tr
  8.   echo -a ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  9. }
  10.  
  11. ;[read write data/setting.ini]
  12. alias _vr {
  13.   if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  14.   return $readini data\setting.ini $$1 $$2
  15. }
  16. alias _vw {
  17.   if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  18.   writeini data\setting.ini $$1 $$2 $$3-
  19. }
  20. alias _vrem {
  21.   if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  22.   remini data\setting.ini $$1 $$2
  23. }
  24. menu query,menubar {
  25.   secure query
  26.   .config:secure.query
  27.   .add access:.auser -a securequery $address($1,3) | $ae •12• user added » (12 $address($1,3) ) | if ($dialog(querycon) != $null) { did -r querycon 45 | s.levels }
  28.   .on $sqo: _vw querycon switch on
  29.   .off $sqf: _vw querycon switch off
  30. }
  31. menu status {
  32.   secure query
  33.   .config:secure.query
  34.   .on $sqo: _vw querycon switch on
  35.   .off $sqf: _vw querycon switch off
  36. }
  37. alias -l sqo {
  38.   if ($_vr(querycon,switch) == on) { return [x] }
  39.   else { return  }
  40. }
  41. alias -l sqf {
  42.   if ($_vr(querycon,switch) == off) { return [x] }
  43.   else { return }
  44. }
  45. alias secure.query {
  46.   if ($version < 5.91) { echo -a 4This addon will not work properly with mIRC $version $+ , please upgrade to latest mIRC www.mirc.com | beep | halt }
  47.   if ($dialog(querycon) == $null) { dialog -m querycon querycon }
  48. }
  49. alias secure.query.nick {
  50.   if ($version < 5.91) { echo -a 4This addon will not work properly with mIRC $version $+ , please upgrade to latest mIRC www.mirc.com | beep | halt }
  51.   dialog -m $_vr(querycon,query.nick) querycon1
  52.   _vrem querycon lastmsg
  53. }
  54. dialog querycon1 {
  55.   title "secure query"
  56.   size -1 -1 160 81
  57.   option dbu
  58.   box "", 33, 7 14 146 42
  59.   button "accept", 28, 9 62 25 10, disable default ok
  60.   button "ignore", 26, 36 62 25 10, disable
  61.   button "decline", 27, 63 62 25 10, disable
  62.   edit "", 1, 32 21 119 10, read autohs
  63.   edit "", 30, 32 31 119 10, read autohs
  64.   edit "", 29, 32 41 119 10, read autohs
  65.   check "enable secure query", 31, 10 6 70 7
  66.   button "setup", 2, 92 63 21 8
  67.   button "add access", 3, 114 63 37 8, disable
  68.   box "", 4, 7 57 146 18
  69.   text "nick", 5, 9 22 10 8
  70.   text "address", 6, 9 32 19 8
  71.   text "message", 7, 9 42 21 8
  72.   text "", 8, 130 5 27 8, right
  73.   text "", 9, 76 5 53 8, right
  74. }
  75. dialog querycon {
  76.   title "Secure Query"
  77.   size -1 -1 167 119
  78.   option dbu notheme
  79.   button "ok", 12, 70 104 25 10, default flat ok
  80.   tab "config", 2, 2 1 163 115
  81.   edit "", 3, 4 43 159 10, tab 2 autohs
  82.   text "standby message", 13, 4 35 44 7, tab 2
  83.   edit "", 4, 4 60 159 10, tab 2 autohs
  84.   check "enable", 15, 11 83 32 10, tab 2 flat
  85.   button "select sound", 16, 45 83 37 10, tab 2 flat
  86.   box "audible alert on query request", 17, 8 75 80 22, tab 2
  87.   edit "", 208, 107 79 17 9, tab 2
  88.   button "-", 206, 99 81 6 6, tab 2 flat
  89.   text "seconds", 210, 135 80 20 7, tab 2
  90.   box "auto-close dialog", 209, 95 71 63 30, tab 2
  91.   button "+", 207, 126 81 6 6, tab 2 flat
  92.   text "decline message", 14, 4 53 44 7, tab 2
  93.   check "enable secure query", 33, 11 20 66 10, tab 2 flat
  94.   check "notify user has access", 49, 92 20 66 10, tab 2 flat
  95.   check "enable auto-close", 50, 99 89 58 10, tab 2
  96.   box "", 51, 7 15 154 18, tab 2
  97.   tab "log", 11
  98.   list 34, 7 20 42 50, tab 11 sort size hsbar
  99.   button "remove", 35, 7 73 29 8, tab 11 flat
  100.   button "copy", 39, 131 72 29 8, tab 11 flat
  101.   check "log query requests", 43, 7 95 58 10, tab 11 flat
  102.   edit "", 52, 86 84 74 10, tab 11 autohs
  103.   button "add access", 53, 48 85 37 8, tab 11 flat
  104.   edit "", 64, 54 21 106 50, tab 11 read multi vsbar
  105.   button "remove all", 65, 7 83 29 8, tab 11 flat
  106.   tab "protection", 32
  107.   radio "universal mask *!*@*", 211, 15 42 62 12, tab 32 flat
  108.   radio "host mask ignore", 212, 15 56 62 9, tab 32 flat
  109.   box "query flood ignore type", 213, 11 34 70 34, tab 32
  110.   edit "", 214, 87 54 10 10, tab 32
  111.   check "enable", 219, 89 42 40 10, tab 32 flat
  112.   box "query flood protection", 216, 85 34 70 34, tab 32
  113.   edit "", 217, 125 54 15 10, tab 32
  114.   text "queries in", 215, 99 56 24 7, tab 32
  115.   text "secs", 218, 141 55 17 7, tab 32
  116.   tab "access", 40
  117.   list 41, 11 42 146 50, tab 40 sort size hsbar
  118.   button "remove", 42, 12 96 37 8, disable tab 40 flat
  119.   text "user access", 44, 12 34 29 8, tab 40
  120.   edit "", 45, 26 19 106 10, tab 40 autohs
  121.   button "add", 46, 134 20 29 8, disable tab 40 flat
  122.   text "address", 47, 6 20 19 8, tab 40
  123. }
  124.  
  125. on *:dialog:*:init:*:{
  126.   if ($dialog(querycon) == $dname) {
  127.     if ($_vr(querycon,switch) == on) { did -c querycon 33 }
  128.     elseif ($_vr(querycon,switch) == $null) { _vw querycon switch on | did -c querycon 33 }
  129.     if ($_vr(querycon,ignore.host) == $null) { _vw querycon ignore.host on | _vw querycon ignore.uni off }
  130.     if ($_vr(querycon,decline) == $null) { _vw querycon decline Sorry, I have declined your query, please try a more convient time. }
  131.     if ($_vr(querycon,ignore.uni) == on) && ($_vr(querycon,ignore.host) == off) { did -c querycon 211 1 }
  132.     else  did -c querycon 212 1
  133.     did -o querycon 3 1 $_vr(querycon,standby)
  134.     did -o querycon 4 1 $_vr(querycon,decline)
  135.     if ($_vr(querycon,soundswitch) == on) { did -c querycon 15 }
  136.     if ($_vr(querycon,timer) == $null) { _vw querycon timer 240 }
  137.     did -o querycon 208 1 $_vr(querycon,timer)
  138.     if ($_vr(querycon,max.query) == $null) { _vw querycon max.query 5 | did -o querycon 214 1 $_vr(querycon,max.query) }
  139.     else  did -o querycon 214 1 $_vr(querycon,max.query)
  140.     if ($_vr(querycon,max.query.sec) == $null) {  _vw querycon max.query.sec 20 | did -o querycon 217 1 $_vr(querycon,max.query.sec) }
  141.     else did -o querycon 217 1 $_vr(querycon,max.query.sec)
  142.     if ($_vr(querycon,netflood) == on) did -c querycon 219
  143.     else did -b querycon 211,217,212,214
  144.     if ($_vr(querycon,log) == on) { did -c querycon 43 }
  145.     elseif ($_vr(querycon,log) == $null) { _vw querycon log on | did -c querycon 43 }
  146.     if ($_vr(querycon,notifyaccess) == on) { did -c querycon 49 }
  147.     elseif ($_vr(querycon,notifyaccess) == $null) { _vw querycon notifyaccess on | did -c querycon 49 }
  148.     if ($_vr(querycon,auto-close) == on) { did -c querycon 50 }
  149.     did -b querycon 46,42
  150.     nick.list
  151.     s.levels
  152.     did -z querycon 34
  153.   }
  154.   if ($dialog($dname) == $_vr(querycon,query.nick)) {
  155.     if ($_vr(querycon,auto-close) == on) { %qs.nick = $_vr(querycon,query.nick) | .timer 1 $sq_t close.qw }
  156.   }
  157. }
  158. on *:dialog:querycon:edit:*:{
  159.   if ($did == 3) {
  160.     if ($did(querycon,3).text != $null) {    
  161.       _vw querycon standby $did(querycon,3).text
  162.     }
  163.   }
  164.   if ($did == 4) {
  165.     if ($did(querycon,4).text != $null) {    
  166.       _vw querycon decline $did(querycon,4).text
  167.     }
  168.   }
  169.   if ($did == 45) {
  170.     if ($did(querycon,45).text != $null) { did -e querycon 46 }
  171.     elseif ($did(querycon,45).text == $null) { did -b querycon 46 }
  172.   }
  173.   if ($did == 208) {
  174.     if ($did(querycon,208).text != $null) {    
  175.       _vw querycon timer $did(querycon,208).text
  176.     }
  177.   }
  178.   if ($did == 214) {
  179.     if ($did(querycon,214).text != $null) {  
  180.       _vw querycon max.query $did(querycon,214).text
  181.     }  
  182.   }
  183.   if ($did == 217) {
  184.     if ($did(querycon,217).text != $null) {  
  185.       _vw querycon max.query.sec $did(querycon,217).text
  186.     }
  187.   }
  188. }
  189.  
  190. on *:dialog:*:sclick:*:{
  191.   if (Query request $dname == $dialog($dname).title) {
  192.     if ($did == 2) { secure.query }  
  193.     if ($did == 3) {
  194.       auser -a securequery $address($did(1,$did(1)),3) $did(1,$did(1)) | did -b $did(1,$did(1)) 3
  195.       if ($_vr(querycon,notifyaccess) == on) { if ($server != $null) { .msg $did(1,$did(1)) [automated msg] You have free access to message me. } }
  196.     }  
  197.     if ($did == 27) { .ignore -pu180 $did(30,$did(30)) | .msg $did(1,$did(1)) [automated msg] $_vr(querycon,decline) |  dialog -x $did(1,$did(1)) }
  198.     if ($did == 28) {  
  199.       .ignore -r $address($did(1,$did(1)),2) | query $did(1,$did(1)) | .timer -m 1 1 echo $did(1,$did(1)) < $+ $did(1,$did(1)) $+ > $did(29,$did(29)) |  _vrem querycon lastmsg
  200.       if ($server != $null) { .msg $did(1,$did(1)) [automated msg] Query request accepted. }
  201.       dialog -x $did(1,$did(1))
  202.     }
  203.     if ($did == 26) { .ignore -p $address($did(1,$did(1)),3) | dialog -x $did(1,$did(1)) }
  204.     if ($did == 31) {
  205.       if ($_vr(querycon,switch) != on) { _vw querycon switch on }
  206.       else { _vw querycon switch off  }
  207.     }
  208.   }
  209.   if ($dialog(querycon) ==  $dname) {
  210.     if ($did == 15) {
  211.       if ($_vr(querycon,soundswitch) != on) {  _vw querycon soundswitch on | did -c querycon 15 }
  212.       else { _vw querycon soundswitch off | did -u querycon 15 }
  213.     }
  214.     if ($did == 16) { setquerysound }
  215.     if ($did == 206) { if (%timer > 0) { dec %timer 1 | did -o querycon 208 1 %timer | _vw querycon timer %timer } }
  216.     if ($did == 207) { inc %timer 1 | did -o querycon 208 1 %timer | _vw querycon timer %timer }
  217.  
  218.     if ($did == 39) { clipboard < $+ $did(34,$did(34).sel) $+ > $sr($did(34,$did(34).sel),msg) }
  219.     if ($did == 34) { did -r querycon 64 | did -a querycon 64 $chr(91) $+ $sr($did(34,$did(34).sel),date) $+ $chr(93) | did -a querycon 64 $crlf $sr($did(34,$did(34).sel),msg) | did -o querycon 52 1 $_vr(securequery,$did(34,$did(34).sel))) }
  220.     if ($did == 33) {
  221.       if ($_vr(querycon,switch) != on) { _vw querycon switch on }
  222.       else { _vw querycon switch off }
  223.     }
  224.     if ($did == 35) { write -ds $+ $did(34,$did(34).sel) securequery\names.txt | _vrem securequery $did(34,$did(34).sel)) | .timer -m 1 1 nick.list }
  225.     if ($did == 41) { did -e querycon 42,46 | did -o querycon 45 1 $did(41,$did(41).sel)) }
  226.     if ($did == 42) { ruser $did(41,$did(41).sel) | s.levels }
  227.     if ($did == 43) {
  228.       if ($_vr(querycon,log) != on) { _vw querycon log on | did -c querycon 43 }
  229.       else { _vw querycon log off }
  230.     }  
  231.     if ($did == 50) {
  232.       if ($_vr(querycon,auto-close) != on) { _vw querycon auto-close on | did -c querycon 50 }
  233.       else { _vw querycon auto-close off }
  234.     }
  235.     if ($did == 53) {
  236.       if ($did(querycon,52).text != $null) {    
  237.         .auser -a  securequery $did(querycon,52).text | did -r querycon 52
  238.       }
  239.     }
  240.     if ($did == 49) {
  241.       if ($_vr(querycon,notifyaccess) != on) { _vw querycon notifyaccess on | did -c querycon 49 }
  242.       else { _vw querycon notifyaccess off }
  243.     }
  244.     if ($did == 46) {
  245.       if ($did(querycon,45).text != $null) {    
  246.         .auser -a  securequery $did(querycon,45).text | did -r querycon 45 | s.levels
  247.       }
  248.     }
  249.     if ($did == 65) { .remove securequery\names.txt | .remove securequery\logs.ini | did -r querycon 64,34,52 }    
  250.     if ($did == 211) {
  251.       if ($_vr(querycon,ignore.uni) == off) { _vw querycon ignore.uni on | _vw querycon ignore.host off | did -c querycon 211 | did -u querycon 212 }
  252.       else { _vw querycon ignore.uni off | _vw querycon ignore.host on | did -u querycon 211 | did -c querycon 212 }
  253.     }
  254.     if ($did == 212) {
  255.       if ($_vr(querycon,ignore.host) == off) { _vw querycon ignore.host on | _vw querycon ignore.uni off | did -c querycon 212 | did -u querycon 211 }
  256.       else { _vw querycon ignore.host off | _vw querycon ignore.uni on | did -u querycon 212 | did -c querycon 211 }
  257.     }
  258.     if ($did == 219) {
  259.       if ($_vr(querycon,netflood) == off) { _vw querycon netflood on | did -c querycon 219 | did -e querycon 211,217,212,214 }
  260.       else { _vw querycon netflood off | did -u querycon 219 | did -b querycon 211,217,212,214 }
  261.     }
  262.   }
  263. }
  264. alias -l sr {
  265.   if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c securequery\logs.ini }
  266.   return $readini securequery\logs.ini $$1 $$2
  267. }
  268. alias -l sw {
  269.   if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c securequery\logs.ini }
  270.   writeini securequery\logs.ini $$1 $$2 $$3-
  271. }
  272. alias -l srem {
  273.   if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c  securequery\logs.ini }
  274.   remini securequery\logs.ini $$1 $$2
  275. }
  276. on ^*:open:?: {
  277.   if ($_vr(querycon,switch) == $null) { _vw querycon switch on }
  278.   if ($finddir($mircdir\,securequery*,1) == $null) { mkdir securequery }
  279.   if ($_vr(querycon,netflood) != on) {
  280.     inc %upflood15 1  
  281.     if (%upflood15 > $_vr(querycon,max.query)) {
  282.       if ($_vr(querycon,ignore.uni) == on) { .ignore -pu $+ $_vr(querycon,max.query.sec) *!*@* }
  283.       else { .ignore -pu $+ $_vr(querycon,max.query.sec) $wildsite }
  284.       echo -a 4[ ALERT ] $nick is Query Flooding. User ( $+ $wildsite $+ ) now ignored for $_vr(querycon,max.query.sec) secs.
  285.     }
  286.     .timer 1 60 unset %upflood15    
  287.   }
  288.   if ($_vr(querycon,standby) == $null) { _vw querycon standby Please standby for acknowledgement. I am using a secure query event. You will be notified if accepted. Until then your msgs will be ignored. }
  289.   if ($level($address($nick,3)) == securequery) { goto end }
  290.   if ($network == WonderNet) && ($nick == Global) { goto end }
  291.   if ($network == WonderNet) && ($nick == Nickserv) { goto end }
  292.   if ($network == WonderNet) && ($nick == Chanserv) { goto end }
  293.   if ($network == WonderNet) && ($nick == Memoserv) { goto end }
  294.   if ($_vr(querycon,switch) == on) {
  295.     if ($_vr(querycon,soundswitch) == on) { if ($_vr(querycon,sound) != $null) { splay $_vr(querycon,sound) } }
  296.     echo -a  $+ $colour(notice) $+ Query with $nick
  297.     echo -a  $+ $colour(notice) $+ Waiting for acknowledgement...
  298.     if ($_vr(querycon,log) == on) {
  299.       if ($read(securequery\names.txt, w, $nick) == $nick) { write -ds $+ $nick securequery\names.txt }
  300.       sw $nick date $asctime(h:nn:sstt m/d) | sw $nick msg $strip($1-,burc) | write securequery/names.txt $nick | _vw securequery $nick $wildsite | nick.list
  301.     }
  302.     .msg $nick [automated msg] $_vr(querycon,standby)
  303.     _vw  querycon query.nick $nick
  304.     if ($dialog($nick) == $null) { secure.query.nick }
  305.     dialog -t $_vr(querycon,query.nick) Query request $nick
  306.     did -o $nick 1 1 $_vr(querycon,query.nick)
  307.     .ignore -pu120 $wildsite    
  308.     whosqial $nick  
  309.     did -o $nick 9 1 ( $+ $network $+ )  
  310.     did -o $nick 30 1 updating...
  311.     did -o $nick 29 1 $strip($1-,burc)
  312.     did -o $nick 8 1 $asctime(hh:nntt)
  313.  
  314.     if ($_vr(querycon,switch) == on) { did -c $nick 31 }
  315.     haltdef
  316.     :end
  317.   }  
  318. }
  319. #sqialud off
  320. raw 352:*: {
  321.   if ($dialog($6) != $null) { did -o $6 30 1 *!* $+ $3 $+ @ $+ $4  | did -e $6 26,28,3,27 | .timer 1 5 .disable #sqialud | haltdef }
  322.   else { if ($dialog($6) != $null) { did -e $6 26,28,3,27 | .timer 1 5 .disable #sqialud | halt } }
  323.   halt
  324. }
  325. raw 315:*: {
  326.   halt
  327. }
  328. #sqialud end
  329. alias -l whosqial { .enable #sqialud | .who $$1 }
  330. alias -l secure.dir {
  331.   mkdir  " $+ $mircdirsecurequery $+ \ $+ "
  332.   return securequery $+ \
  333. }
  334. alias -l sq_t {
  335.   return $_vr(querycon,timer)
  336. }
  337.  
  338. alias -l nick.list {
  339.   if ($dialog(querycon) != $null) {
  340.     did -r querycon 64,34,52
  341.     var %fst = $lines(securequery\names.txt)  
  342.     var %f = 1
  343.     while (%f <= %fst) { did -a querycon 34 $read(securequery\names.txt,%f) | inc %f 1 }
  344.   }
  345. }
  346. alias -l s.levels {
  347.   did -r querycon 41
  348.   var %s.l = $ulist(*,securequery,0)
  349.   if (%s.l == 0) { did -b querycon 42 | return }
  350.   else  did -e querycon 42
  351.   var %s.w = 0
  352.   :loop
  353.   inc %s.w
  354.   if (%s.w <= %s.l) { did -a querycon 41  $ulist(*,securequery,%s.w) | goto loop }
  355.   else return
  356. }
  357. alias -l close.qw { if ($dialog(%qs.nick) != $null) dialog -x %qs.nick }
  358. alias -l setquerysound {
  359.   _vw querycon sound $$dir="Choose a wav:" $mircdir*.wav;*mp3;*.mid
  360. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement