All pastes #677349 Raw Edit

Something

public text v1 · immutable
#677349 ·published 2007-08-31 22:54 UTC
rendered paste body
on *:load:{ 
  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 
  echo -a  X-Files Secure Query Loaded Succesfully | echo -a  Please Type : /secure.query  In Channel To Begin Dialog. 
} 
;[read write data/setting.ini] 
alias _vr { 
  if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini } 
  return $readini data\setting.ini $$1 $$2 
} 
alias _vw { 
  if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini } 
  writeini data\setting.ini $$1 $$2 $$3- 
} 
alias _vrem { 
  if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini } 
  remini data\setting.ini $$1 $$2 
} 
menu query, { 
  .- 
  Secure Query 
  .Change :secure.query 
  .Add User:.auser -a securequery $address($1,3) | .msg $1 [Automated Msg] You Have Free Access To Message Me. | $ae •• User Added » ( $address($1,3) ) | if ($dialog(querycon) != $null) { did -r querycon 45 | s.levels } 
  .On  $sqo: _vw querycon switch on 
  .Off $sqf: _vw querycon switch off 
} 
menu status,channel { 
  .- 
  Secure Query 
  .Change :secure.query 
  .On $sqo: _vw querycon switch on 
  .Off $sqf: _vw querycon switch off 
} 
alias -l sqo { 
  if ($_vr(querycon,switch) == on) { return [x] } 
  else { return  } 
} 
alias -l sqf { 
  if ($_vr(querycon,switch) == off) { return [x] } 
  else { return } 
} 
alias secure.query { 
  if ($version < 5.91) { echo -a This addon will not work properly with mIRC $version $+ , please upgrade to latest mIRC www.mirc.com | beep | halt } 
  if ($dialog(querycon) == $null) { dialog -m querycon querycon } 
} 
alias secure.query.nick { 
  if ($version < 5.91) { echo -a This addon will not work properly with mIRC $version $+ , please upgrade to latest mIRC www.mirc.com | beep | halt } 
  dialog -m $_vr(querycon,query.nick) querycon1 
  _vrem querycon lastmsg 
} 
dialog querycon1 { 
  title "Secure Query " 
  size -1 -1 220 94 
  option dbu 
  box "", 33, 7 14 210 42 
  button "Accept", 28, 33 67 25 10, default ok 
  button "Ignore", 26, 61 67 25 10 
  button "Decline", 27, 89 67 25 10 
  edit "", 1, 32 20 181 11, read autohs 
  edit "", 30, 32 31 181 10, read autohs 
  edit "", 29, 32 41 181 10, read autohs 
  check "Enable Secure Query", 31, 10 6 70 7 
  button "Setup", 2, 119 67 21 10 
  button "Add Access", 3, 146 67 37 10 
  box "", 4, 31 61 160 18 
  text "Nick ", 5, 9 20 17 10 
  text "Address", 6, 9 31 22 9 
  text "Message", 7, 9 42 24 10 
} 
dialog querycon { 
  title "Secure Query By X-Files" 
  size -1 -1 185 128 
  option dbu 
  button "Ok", 12, 75 108 25 10, default ok 
  tab "Config", 2, 2 2 179 120 
  edit "", 3, 4 44 159 10, tab 2 autohs 
  text "Standby Message", 13, 4 34 49 9, tab 2 
  edit "", 4, 4 64 159 10, tab 2 autohs 
  check "On ", 15, 11 85 32 10, tab 2 
  button "Choose The Sound ", 16, 31 85 53 11, tab 2 
  box "Audible Alert On Query Request", 17, 8 76 85 25, tab 2 
  edit "", 208, 109 84 15 9, tab 2 
  button "-", 206, 100 86 6 5, tab 2 
  text "Seconds ", 210, 135 84 25 8, tab 2 center 
  box "Auto-Close Dialog", 209, 95 76 70 31, tab 2 
  button "+", 207, 126 85 6 6, tab 2 
  text "Decline Message", 14, 1 55 51 9, tab 2 center 
  check "On ", 33, 12 21 66 10, tab 2 
  check "Notify User Has Access", 49, 92 21 66 10, tab 2 
  check "Enable Auto-Close", 50, 100 94 58 10, tab 2 
  box "", 51, 7 16 154 18, tab 2 
  tab "Log", 11 
  list 34, 7 21 42 50, tab 11 sort size hsbar 
  button "Erase", 35, 7 74 29 8, tab 11 
  button "Copy ", 39, 131 73 29 8, tab 11 
  check "Log", 43, 7 96 58 10, tab 11 
  edit "", 52, 86 85 74 10, tab 11 autohs 
  button "Add User", 53, 48 86 37 8, tab 11 
  edit "", 64, 54 22 106 50, tab 11 read multi vsbar 
  button "Erase All", 65, 7 84 29 8, tab 11 
  tab "Protection", 32 
  radio "Universal mask *!*@*", 211, 15 43 62 12, tab 32 
  radio "Host Mask Ignore", 212, 15 57 62 9, tab 32 
  box "Flood Private Kind ", 213, 11 35 70 34, tab 32 
  edit "", 214, 87 55 10 10, tab 32 
  check "On ", 219, 89 43 40 10, tab 32 
  box "Private Flood Kind ", 216, 85 35 77 34, tab 32 
  edit "", 217, 125 55 15 10, tab 32 
  text "Queries In", 215, 98 57 27 7, tab 32 center 
  text "Secs", 218, 141 56 18 8, tab 32 
  tab "Access", 40 
  list 41, 11 43 146 50, tab 40 sort size hsbar 
  button "Erase ", 42, 12 97 37 8, disable tab 40 
  text "User access", 44, 12 35 29 8, tab 40 
  edit "", 45, 30 20 106 10, tab 40 autohs 
  button "Add", 46, 139 21 30 8, disable tab 40 
  text " Address", 47, 7 21 23 8, tab 40 
  tab "About", 54 
  box "", 55, 16 24 151 78, tab 54 
  text "Author :", 56, 61 31 22 10, tab 54 center 
  link "www.geocities.com/script_xfiles", 59, 57 84 80 8, tab 54 
  text "X-Files", 60, 85 31 26 11, tab 54 center 
  text "Location:", 1, 60 47 27 10, tab 54 center 
  text "Lebanon", 5, 84 47 32 12, tab 54 center 
  text "Email :", 6, 58 62 25 8, tab 54 center 
  text "Boro111@hotmail.com", 7, 81 62 63 11, tab 54 center 
} 
on *:dialog:*:init:*:{ 
  if ($dialog(querycon) == $dname) { 
    if ($_vr(querycon,switch) == on) { did -c querycon 33 } 
    elseif ($_vr(querycon,switch) == $null) { _vw querycon switch on | did -c querycon 33 } 
    if ($_vr(querycon,ignore.host) == $null) { _vw querycon ignore.host on | _vw querycon ignore.uni off } 
    if ($_vr(querycon,decline) == $null) { _vw querycon decline Sorry, I have declined your query, please try a more convient time. } 
    if ($_vr(querycon,ignore.uni) == on) && ($_vr(querycon,ignore.host) == off) { did -c querycon 211 1 } 
    else  did -c querycon 212 1 
    did -o querycon 3 1 $_vr(querycon,standby) 
    did -o querycon 4 1 $_vr(querycon,decline) 
    if ($_vr(querycon,soundswitch) == on) { did -c querycon 15 } 
    if ($_vr(querycon,timer) == $null) { _vw querycon timer 240 } 
    did -o querycon 208 1 $_vr(querycon,timer) 
    if ($_vr(querycon,max.query) == $null) { _vw querycon max.query 5 | did -o querycon 214 1 $_vr(querycon,max.query) } 
    else  did -o querycon 214 1 $_vr(querycon,max.query) 
    if ($_vr(querycon,max.query.sec) == $null) {  _vw querycon max.query.sec 20 | did -o querycon 217 1 $_vr(querycon,max.query.sec) } 
    else did -o querycon 217 1 $_vr(querycon,max.query.sec) 
    if ($_vr(querycon,netflood) == on) did -c querycon 219 
    else did -b querycon 211,217,212,214 
    if ($_vr(querycon,log) == on) { did -c querycon 43 } 
    elseif ($_vr(querycon,log) == $null) { _vw querycon log on | did -c querycon 43 } 
    if ($_vr(querycon,notifyaccess) == on) { did -c querycon 49 } 
    elseif ($_vr(querycon,notifyaccess) == $null) { _vw querycon notifyaccess on | did -c querycon 49 } 
    if ($_vr(querycon,auto-close) == on) { did -c querycon 50 } 
    did -b querycon 46,42 
    nick.list 
    s.levels 
    did -z querycon 34 
  } 
  if ($dialog($dname) == $_vr(querycon,query.nick)) { 
    if ($_vr(querycon,auto-close) == on) { %qs.nick = $_vr(querycon,query.nick) | .timer 1 $sq_t close.qw } 
  } 
} 
on *:dialog:querycon:edit:*:{ 
  if ($did == 3) { 
    if ($did(querycon,3).text != $null) {    
      _vw querycon standby $did(querycon,3).text 
    } 
  } 
  if ($did == 4) { 
    if ($did(querycon,4).text != $null) {    
      _vw querycon decline $did(querycon,4).text 
    } 
  } 
  if ($did == 45) { 
    if ($did(querycon,45).text != $null) { did -e querycon 46 } 
    elseif ($did(querycon,45).text == $null) { did -b querycon 46 } 
  } 
  if ($did == 208) { 
    if ($did(querycon,208).text != $null) {    
      _vw querycon timer $did(querycon,208).text 
    } 
  } 
  if ($did == 214) { 
    if ($did(querycon,214).text != $null) {  
      _vw querycon max.query $did(querycon,214).text 
    }  
  } 
  if ($did == 217) { 
    if ($did(querycon,217).text != $null) {  
      _vw querycon max.query.sec $did(querycon,217).text 
    } 
  } 
} 

on *:dialog:*:sclick:*:{ 
  if (Query request $dname == $dialog($dname).title) { 
    if ($did == 2) { secure.query }    
    if ($did == 3) { 
      auser -a securequery $did(30,$did(30)) $did(1,$did(1)) | did -b $did(1,$did(1)) 3 
      if ($_vr(querycon,notifyaccess) == on) { .msg $did(1,$did(1)) [automated msg] You have free access to message me. } 
    }    
    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)) } 
    if ($did == 28) {  
      .ignore -r $did(30,$did(30)) | 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 
      .msg  $did(1,$did(1)) [automated msg] Query request accepted. 
      dialog -x $did(1,$did(1)) 
    } 
    if ($did == 26) { .ignore -p $did(30,$did(30)) | dialog -x $did(1,$did(1)) } 
    if ($did == 31) { 
      if ($_vr(querycon,switch) != on) { _vw querycon switch on } 
      else { _vw querycon switch off  } 
    } 
  } 
  if ($dialog(querycon) ==  $dname) { 
    if ($did == 15) { 
      if ($_vr(querycon,soundswitch) != on) {  _vw querycon soundswitch on | did -c querycon 15 } 
      else { _vw querycon soundswitch off | did -u querycon 15 } 
    } 
    if ($did == 16) { setquerysound } 
    if ($did == 206) { if (%timer > 0) { dec %timer 1 | did -o querycon 208 1 %timer | _vw querycon timer %timer } } 
    if ($did == 207) { inc %timer 1 | did -o querycon 208 1 %timer | _vw querycon timer %timer } 

    if ($did == 39) { clipboard < $+ $did(34,$did(34).sel) $+ > $sr($did(34,$did(34).sel),msg) } 
    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))) } 
    if ($did == 33) { 
      if ($_vr(querycon,switch) != on) { _vw querycon switch on } 
      else { _vw querycon switch off } 
    } 
    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 } 
    if ($did == 41) { did -e querycon 42,46 | did -o querycon 45 1 $did(41,$did(41).sel)) } 
    if ($did == 42) { ruser $did(41,$did(41).sel) | s.levels } 
    if ($did == 43) { 
      if ($_vr(querycon,log) != on) { _vw querycon log on | did -c querycon 43 } 
      else { _vw querycon log off } 
    }  
    if ($did == 50) { 
      if ($_vr(querycon,auto-close) != on) { _vw querycon auto-close on | did -c querycon 50 } 
      else { _vw querycon auto-close off } 
    } 
    if ($did == 53) { 
      if ($did(querycon,52).text != $null) {    
        .auser -a  securequery $did(querycon,52).text | did -r querycon 52 
      } 
    } 
    if ($did == 49) { 
      if ($_vr(querycon,notifyaccess) != on) { _vw querycon notifyaccess on | did -c querycon 49 } 
      else { _vw querycon notifyaccess off } 
    } 
    if ($did == 46) { 
      if ($did(querycon,45).text != $null) {    
        .auser -a  securequery $did(querycon,45).text | did -r querycon 45 | s.levels 
      } 
    } 
    if ($did == 65) { .remove securequery\names.txt | .remove securequery\logs.ini | did -r querycon 64,34,52 }    
    if ($did == 211) { 
      if ($_vr(querycon,ignore.uni) == off) { _vw querycon ignore.uni on | _vw querycon ignore.host off | did -c querycon 211 | did -u querycon 212 } 
      else { _vw querycon ignore.uni off | _vw querycon ignore.host on | did -u querycon 211 | did -c querycon 212 } 
    } 
    if ($did == 212) { 
      if ($_vr(querycon,ignore.host) == off) { _vw querycon ignore.host on | _vw querycon ignore.uni off | did -c querycon 212 | did -u querycon 211 } 
      else { _vw querycon ignore.host off | _vw querycon ignore.uni on | did -u querycon 212 | did -c querycon 211 } 
    } 
    if ($did == 219) { 
      if ($_vr(querycon,netflood) == off) { _vw querycon netflood on | did -c querycon 219 | did -e querycon 211,217,212,214 } 
      else { _vw querycon netflood off | did -u querycon 219 | did -b querycon 211,217,212,214 } 
    } 
  } 
} 
alias -l sr { 
  if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c securequery\logs.ini } 
  return $readini securequery\logs.ini $$1 $$2 
} 
alias -l sw { 
  if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c securequery\logs.ini } 
  writeini securequery\logs.ini $$1 $$2 $$3- 
} 
alias -l srem { 
  if ($exists(securequery\logs.ini) == $false) { mkdir securequery | write -c  securequery\logs.ini } 
  remini securequery\logs.ini $$1 $$2 
} 
on ^*:open:?: { 
  if ($_vr(querycon,switch) == $null) { _vw querycon switch on } 
  if ($finddir($mircdir\,securequery*,1) == $null) { mkdir securequery } 
  if ($_vr(querycon,netflood) != on) { 
    inc %upflood15 1  
    if (%upflood15 > $_vr(querycon,max.query)) { 
      if ($_vr(querycon,ignore.uni) == on) { .ignore -pu $+ $_vr(querycon,max.query.sec) *!*@* } 
      else { .ignore -pu $+ $_vr(querycon,max.query.sec) $wildsite } 
      echo -a [ ALERT ] $nick is Query Flooding. User ( $+ $wildsite $+ ) now ignored for $_vr(querycon,max.query.sec) secs. 
    } 
    .timer 1 60 unset %upflood15      
  } 
  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. } 
  if ($level($address($nick,3)) == securequery) { goto end } 
  if ($_vr(querycon,switch) == on) { 
    if ($_vr(querycon,soundswitch) == on) { if ($_vr(querycon,sound) != $null) { splay $_vr(querycon,sound) } } 
    echo -a $+ $colour(notice) $+ Query with $nick ( $+ $wildsite  $+ ) 
    echo -a $+ $colour(notice) $+ Waiting for acknowledgement... 
    if ($_vr(querycon,log) == on) { 
      if ($read(securequery\names.txt, s, $nick) == $nick) { write -ds $+ $nick securequery\names.txt } 
      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 
    } 
    .ignore -pu180 $wildsite  
    .msg $nick [automated msg] $_vr(querycon,standby) 
    _vw  querycon query.nick $nick 
    if ($dialog($nick) == $null) { secure.query.nick } 
    dialog -t $_vr(querycon,query.nick) Query request $nick 
    did -o $nick 1 1 $_vr(querycon,query.nick) 
    did -o $nick 30 1 $wildsite 
    did -o $nick 29 1 $strip($1-,burc) 
    if ($_vr(querycon,switch) == on) { did -c $nick 31 } 
    haltdef 
    :end 
  }  
} 
alias -l secure.dir { 
  mkdir  " $+ $mircdirsecurequery $+ \ $+ " 
  return securequery $+ \ 
} 
alias -l sq_t { 
  return $_vr(querycon,timer) 
} 

alias -l nick.list { 
  if ($dialog(querycon) != $null) { 
    did -r querycon 64,34,52 
    var %fst = $lines(securequery\names.txt)    
    var %f = 1 
    while (%f <= %fst) { did -a querycon 34 $read(securequery\names.txt,%f) | inc %f 1 } 
  } 
} 
alias -l s.levels { 
  did -r querycon 41 
  var %s.l = $ulist(*,securequery,0) 
  if (%s.l == 0) { did -b querycon 42 | return } 
  else  did -e querycon 42 
  var %s.w = 0 
  :loop 
  inc %s.w 
  if (%s.w <= %s.l) { did -a querycon 41  $ulist(*,securequery,%s.w) | goto loop } 
  else return 
} 
alias -l close.qw { if ($dialog(%qs.nick) != $null) dialog -x %qs.nick } 
alias -l setquerysound { 
  _vw querycon sound $$dir="Choose a wav:" $mircdir*.wav;*mp3;*.mid 
}