daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 399 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  2. ; Query Control Script                              ;
  3. ; Created & Coded by SyntaxError                    ;
  4. ; Version 2.0.3 last updated December 6rd, 2007     ;
  5. ; /server -m irc.SwiftIRC.net -j #acethebunny       ;
  6. ; © 2007 Gary Hoalcraft III (acethebunny@gmail.com) ;
  7. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  8.  
  9. menu Status,Channel,MenuBar,Query {
  10.   $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
  11.     var %status = $iif($group(#qc) == on,Disable,Enable)
  12.     $+(.,%status) #qc
  13.     echo -a 4» Query Control has been $+(%status,d)
  14.   }
  15. }
  16. menu Query {
  17.   $iif($hget(qcaccept,$address($active,3)),$style(1),$style(0)) Query Auto-Accept $+([,$active,]): {
  18.     var %status = $iif($hget(qcaccept,$address($active,3)) = 1,Del,Add)
  19.     $+(h,%status) qcaccept $address($active,3) 1
  20.     echo -a 4» $active has been $iif(%status = del,deleted from,added to) Auto-Accept.
  21.   }
  22. }
  23. dialog qc {
  24.   title "Query Control"
  25.   size -1 -1 130 47
  26.   option dbu
  27.  
  28.   text "From:", 1, 4 7 25 10, right
  29.   text "Time:", 2, 82 7 15 10, left
  30.   text "", 3, 97 7 28 10, read
  31.   edit "", 4, 30 6 50 10, read
  32.   text "Message:", 5, 4 19 25 10, right
  33.   edit "", 6, 30 18 95 10, read
  34.   box "", 7, 1 1 127 29
  35.  
  36.   button "Auto-Accept", 15, 4 32 37 10, ok
  37.   button "Accept", 8, 42 32 20 10, ok
  38.   button "Decline", 9, 63 32 20 10, ok
  39.   button "Ignore", 10, 84 32 20 10, ok
  40.   box "", 11, 1 27 106 18
  41.  
  42.   link "e-mail", 12, 110 31 15 8
  43.   text "v2.0.3", 13, 110 37 18 8
  44.   box "", 14, 107 27 21 18
  45.  
  46. }
  47. on *:DIALOG:qc:sclick:8:{
  48.   window -w %qc.nick
  49.   .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
  50.   dialog -x qc
  51.   window -a %qc.nick
  52.   unset %qc.*
  53. }
  54. on *:DIALOG:qc:sclick:15:{
  55.   window -w %qc.nick
  56.   .msg %qc.nick $ewrap(Query Accepted. You have been added to the Auto-Accept list. $+([,%qc.address,]) )
  57.   dialog -x qc
  58.   hadd -m qcaccept %qc.address 1
  59.   window -a %qc.nick
  60.   unset %qc.*
  61. }
  62. on *:DIALOG:qc:sclick:9:{
  63.   .msg %qc.nick $ewrap(Private Message Declined. Sorry.)
  64.   window -c %qc.nick
  65.   unset %qc.*
  66.   dialog -x qc
  67. }
  68. on *:DIALOG:qc:sclick:10:{
  69.   .msg %qc.nick $ewrap(Private Message Declined. You have been ignored.)
  70.   window -c %qc.nick
  71.   .ignore -pu1200 %qc.nick 2
  72.   unset %qc.*
  73.   dialog -x qc
  74. }
  75. on *:DIALOG:qc:sclick:12:{
  76.   url -na mailto:acethebunny@gmail.com
  77. }
  78. #qc on
  79. on *:START:{
  80.   echo $color(info) -st 6» Script: Query Control script by SyntaxError is loaded and running.
  81.   hmake qcaccept 100
  82.   if ($exists(qcaccept.hsh)) {
  83.     .hload -s qcaccept qcaccept.hsh
  84.     echo $color(info) -st 6» Script: hash table for Query Control loaded
  85.   }
  86. }
  87. on *:EXIT:{
  88.   hsave -s qcaccept qcaccept.hsh
  89. }
  90. on *:INPUT:?:{
  91.   if ($active != -psyBNC && $active != -sBNC && !$away) {
  92.     .timerclose.query. $+ $active 1 300 close.query $active
  93.   }
  94. }
  95. on *:TEXT:*:?:{
  96.   if ($nick != -psyBNC && $active != -sBNC && !$away) {
  97.     .timerclose.query. $+ $nick 1 300 close.query $nick
  98.   }
  99. }
  100. on *:OPEN:?:{
  101.   if ($nick == -psyBNC || $nick == -sBNC || $nick == acethebunny|bot) {
  102.     goto end
  103.   }
  104.   elseif ($hget(qcaccept,$address($nick,3))) {
  105.     .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
  106.       $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
  107.     goto end
  108.   }
  109.   elseif ($away) {
  110.     notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
  111.     goto end
  112.   }
  113.   elseif ($dialog(qc)) {
  114.     .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
  115.     echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
  116.     close -m $nick
  117.     .ignore -pu15 $nick
  118.   }
  119.   else {
  120.     set %qc.nick $nick
  121.     set %qc.address $address($nick,3)
  122.     window -h $nick
  123.     .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
  124.     dialog -mdo qc qc
  125.     did -a qc 3 $asctime(hh:nn:ss)    
  126.     did -a qc 4 $nick
  127.     did -a qc 6 $1-
  128.     did -f qc 1
  129.   }
  130.   :end
  131. }
  132. CTCP *:VERSION:*:{
  133.   if (!$($+(%,ctcp.qc.,$wildsite),2)) {
  134.     .ctcpreply $nick VERSION Query Control Script v2.0.3 by Gary Hoalcraft (acethebunny@gmail.com)
  135.     set -eu15 $+(%,ctcp.qc.,$wildsite) on
  136.   }
  137. }
  138. #qc end
  139.  
  140. alias dur {
  141.   return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
  142. }
  143. alias ewrap {
  144.   var %msg
  145.   var %tok = 1
  146.   var %word
  147.   while ($gettok($1-,%tok,32) != $null) {
  148.     %word = $gettok($1-,%tok,32)
  149.     %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
  150.     inc %tok
  151.   }
  152.   return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
  153. }
  154.  
  155.  
  156. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  157. ;                                                   ;
  158. ;                    End Of File                    ;
  159. ;                                                   ;
  160. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top