Advertisement
wollux

Secure Query v2.17 by Team NexGen/KnightFal

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