Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.28 KB | None | 0 0
  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 off
  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. alias close.query {
  101. if ($query($$1)) {
  102. close -m $1
  103. notice $1 $ewrap(The query window with you has been closed after 5 minutes of inactivity.)
  104. }
  105. }
  106. on *:CLOSE:?:{
  107. if ($timer($+(close.query.,$nick))) .timer $+ $($+(close.query.,$nick),2) off
  108. }
  109. on *:OPEN:?:{
  110. if ($nick == -psyBNC || $nick == -sBNC || $nick == acethebunny|bot) {
  111. goto end
  112. }
  113. elseif ($hget(qcaccept,$address($nick,3))) {
  114. .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
  115. $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
  116. goto end
  117. }
  118. elseif ($away) {
  119. notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
  120. goto end
  121. }
  122. elseif ($dialog(qc)) {
  123. .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
  124. echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
  125. close -m $nick
  126. .ignore -pu15 $nick
  127. }
  128. else {
  129. set %qc.nick $nick
  130. set %qc.address $address($nick,3)
  131. window -h $nick
  132. .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
  133. dialog -mdo qc qc
  134. did -a qc 3 $asctime(hh:nn:ss)
  135. did -a qc 4 $nick
  136. did -a qc 6 $1-
  137. did -f qc 1
  138. }
  139. :end
  140. }
  141. CTCP *:VERSION:*:{
  142. if (!$($+(%,ctcp.qc.,$wildsite),2)) {
  143. .ctcpreply $nick VERSION Query Control Script v2.0.3 by Gary Hoalcraft (acethebunny@gmail.com)
  144. set -eu15 $+(%,ctcp.qc.,$wildsite) on
  145. }
  146. }
  147. #qc end
  148.  
  149. alias dur {
  150. return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
  151. }
  152. alias ewrap {
  153. var %msg
  154. var %tok = 1
  155. var %word
  156. while ($gettok($1-,%tok,32) != $null) {
  157. %word = $gettok($1-,%tok,32)
  158. %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
  159. inc %tok
  160. }
  161. return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
  162. }
  163.  
  164.  
  165. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  166. ; ;
  167. ; End Of File ;
  168. ; ;
  169. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement