Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.42 KB | None | 0 0
  1. menu Status,Channel,MenuBar,Query {
  2. $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
  3. var %status = $iif($group(#qc) == on,Disable,Enable)
  4. $+(.,%status) #qc
  5. echo -a 4» Query Control has been $+(%status,d)
  6. }
  7. }
  8. menu Query {
  9. $iif($hget(qcaccept,$address($active,3)),$style(1),$style(0)) Query Auto-Accept $+([,$active,]): {
  10. var %status = $iif($hget(qcaccept,$address($active,3)) = 1,Del,Add)
  11. $+(h,%status) qcaccept $address($active,3) 1
  12. echo -a 4» $active has been $iif(%status = del,deleted from,added to) Auto-Accept.
  13. }
  14. }
  15. dialog qc {
  16. title "Query Control"
  17. size -1 -1 130 47
  18. option dbu
  19.  
  20. text "From:", 1, 4 7 25 10, right
  21. text "Time:", 2, 82 7 15 10, left
  22. text "", 3, 97 7 28 10, read
  23. edit "", 4, 30 6 50 10, read
  24. text "Message:", 5, 4 19 25 10, right
  25. edit "", 6, 30 18 95 10, read
  26. box "", 7, 1 1 127 29
  27.  
  28. button "Auto-Accept", 15, 4 32 37 10, ok
  29. button "Accept", 8, 42 32 20 10, ok
  30. button "Decline", 9, 63 32 20 10, ok
  31. button "Ignore", 10, 84 32 20 10, ok
  32. box "", 11, 1 27 106 18
  33.  
  34. link "e-mail", 12, 110 31 15 8
  35. text "v2.0.3", 13, 110 37 18 8
  36. box "", 14, 107 27 21 18
  37.  
  38. }
  39. on *:DIALOG:qc:sclick:8:{
  40. window -w %qc.nick
  41. .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
  42. dialog -x qc
  43. window -a %qc.nick
  44. unset %qc.*
  45. }
  46. on *:DIALOG:qc:sclick:15:{
  47. window -w %qc.nick
  48. .msg %qc.nick $ewrap(Query Accepted. You have been added to the Auto-Accept list. $+([,%qc.address,]) )
  49. dialog -x qc
  50. hadd -m qcaccept %qc.address 1
  51. window -a %qc.nick
  52. unset %qc.*
  53. }
  54. on *:DIALOG:qc:sclick:9:{
  55. .msg %qc.nick $ewrap(Sorry your message has been declined. Reason: Never had permission to PM me.)
  56. window -c %qc.nick
  57. unset %qc.*
  58. dialog -x qc
  59. }
  60. on *:DIALOG:qc:sclick:10:{
  61. .msg %qc.nick $ewrap(Unforunatly i do not wish to speak to you now. Welcome to my ignore.)
  62. window -c %qc.nick
  63. .ignore -pu1200 %qc.nick 2
  64. unset %qc.*
  65. dialog -x qc
  66. }
  67. on *:DIALOG:qc:sclick:12:{
  68. url -na mailto:Dwell7@live.com
  69. }
  70. #qc on
  71. on *:START:{
  72. echo $color(info) -st 6» Script: Query Control script by Abitare is loaded and running.
  73. hmake qcaccept 100
  74. if ($exists(qcaccept.hsh)) {
  75. .hload -s qcaccept qcaccept.hsh
  76. echo $color(info) -st 6» Script: hash table for Query Control loaded
  77. }
  78. }
  79. on *:EXIT:{
  80. hsave -s qcaccept qcaccept.hsh
  81. }
  82. on *:INPUT:?:{
  83. if ($active != -psyBNC && $active != -sBNC && !$away) {
  84. .timerclose.query. $+ $active 1 600 close.query $active
  85. }
  86. }
  87. on *:TEXT:*:?:{
  88. if ($nick != -psyBNC && $active != -sBNC && !$away) {
  89. .timerclose.query. $+ $nick 1 600 close.query $nick
  90. }
  91. }
  92. alias close.query {
  93. if ($nick == -sBNC) { HALT }
  94. if ($query($$1)) {
  95. close -m $1
  96. notice $1 $ewrap(The query window with you has been closed after 10 minutes of inactivity.)
  97. }
  98. }
  99. on *:CLOSE:?:{
  100. if ($timer($+(close.query.,$nick))) .timer $+ $($+(close.query.,$nick),2) off
  101. }
  102. on *:OPEN:?:{
  103. if ($nick == -psyBNC || $nick == -sBNC) {
  104. goto end
  105. }
  106. elseif ($hget(qcaccept,$address($nick,3))) {
  107. .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
  108. $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
  109. goto end
  110. }
  111. elseif ($away) {
  112. notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
  113. goto end
  114. }
  115. elseif ($dialog(qc)) {
  116. .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
  117. echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
  118. close -m $nick
  119. .ignore -pu15 $nick
  120. }
  121. else {
  122. set %qc.nick $nick
  123. set %qc.address $address($nick,3)
  124. window -h $nick
  125. .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
  126. dialog -mdo qc qc
  127. did -a qc 3 $asctime(hh:nn:ss)
  128. did -a qc 4 $nick
  129. did -a qc 6 $1-
  130. did -f qc 1
  131. }
  132. :end
  133. }
  134. CTCP *:VERSION:*:{
  135. if (!$($+(%,ctcp.qc.,$wildsite),2)) {
  136. .ctcpreply $nick VERSION Query Control Script v2.0.3 by Abitare (Dwell7@Live.com)
  137. set -eu15 $+(%,ctcp.qc.,$wildsite) on
  138. }
  139. }
  140. #qc end
  141.  
  142. alias dur {
  143. return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
  144. }
  145. alias ewrap {
  146. var %msg
  147. var %tok = 1
  148. var %word
  149. while ($gettok($1-,%tok,32) != $null) {
  150. %word = $gettok($1-,%tok,32)
  151. %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
  152. inc %tok
  153. }
  154. return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
  155. }
  156.  
  157. Submit a correction or amendment below (click here to make a fresh posting)
  158. After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
  159.  
  160. Syntax highlighting:NoneBashCC++HTMLJavaJavascriptLuaPerlPHPPythonRuby----------------------------NoneABAPActionScriptAdaApache Log FileAppleScriptASM (NASM based)ASPAutoItBashBlitz BasicBNFCC for MacsCAD DCLCAD LispC++C#ColdFusionCSSDDelphiDiffDOSEiffelFortranFreeBasicGeneroGame MakerGroovyHaskellHTMLIDLINIInno ScriptJavaJavascriptLatexLispLuaMatLabM68000 AssemblerMPASMmIRCMySQLNullSoft InstallerObjective COCamlOpenoffice.org BASICOracle 8PascalPerlPHPPL/SQLPythonQBasic/QuickBASICRailsRobotsRubySchemeSmalltalkSmartySQLTCLVisualBasicVB.NETVisualFoxProXMLZ80 Assembler
  161.  
  162. To highlight particular lines, prefix each line with @@
  163. menu Status,Channel,MenuBar,Query {
  164. $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
  165. var %status = $iif($group(#qc) == on,Disable,Enable)
  166. $+(.,%status) #qc
  167. echo -a 4» Query Control has been $+(%status,d)
  168. }
  169. }
  170. menu Query {
  171. $iif($hget(qcaccept,$address($active,3)),$style(1),$style(0)) Query Auto-Accept $+([,$active,]): {
  172. var %status = $iif($hget(qcaccept,$address($active,3)) = 1,Del,Add)
  173. $+(h,%status) qcaccept $address($active,3) 1
  174. echo -a 4» $active has been $iif(%status = del,deleted from,added to) Auto-Accept.
  175. }
  176. }
  177. dialog qc {
  178. title "Query Control"
  179. size -1 -1 130 47
  180. option dbu
  181.  
  182. text "From:", 1, 4 7 25 10, right
  183. text "Time:", 2, 82 7 15 10, left
  184. text "", 3, 97 7 28 10, read
  185. edit "", 4, 30 6 50 10, read
  186. text "Message:", 5, 4 19 25 10, right
  187. edit "", 6, 30 18 95 10, read
  188. box "", 7, 1 1 127 29
  189.  
  190. button "Auto-Accept", 15, 4 32 37 10, ok
  191. button "Accept", 8, 42 32 20 10, ok
  192. button "Decline", 9, 63 32 20 10, ok
  193. button "Ignore", 10, 84 32 20 10, ok
  194. box "", 11, 1 27 106 18
  195.  
  196. link "e-mail", 12, 110 31 15 8
  197. text "v2.0.3", 13, 110 37 18 8
  198. box "", 14, 107 27 21 18
  199.  
  200. }
  201. on *:DIALOG:qc:sclick:8:{
  202. window -w %qc.nick
  203. .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
  204. dialog -x qc
  205. window -a %qc.nick
  206. unset %qc.*
  207. }
  208. on *:DIALOG:qc:sclick:15:{
  209. window -w %qc.nick
  210. .msg %qc.nick $ewrap(Query Accepted. You have been added to the Auto-Accept list. $+([,%qc.address,]) )
  211. dialog -x qc
  212. hadd -m qcaccept %qc.address 1
  213. window -a %qc.nick
  214. unset %qc.*
  215. }
  216. on *:DIALOG:qc:sclick:9:{
  217. .msg %qc.nick $ewrap(Sorry your message has been declined. Reason: Never had permission to PM me.)
  218. window -c %qc.nick
  219. unset %qc.*
  220. dialog -x qc
  221. }
  222. on *:DIALOG:qc:sclick:10:{
  223. .msg %qc.nick $ewrap(Unforunatly i do not wish to speak to you now. Welcome to my ignore.)
  224. window -c %qc.nick
  225. .ignore -pu1200 %qc.nick 2
  226. unset %qc.*
  227. dialog -x qc
  228. }
  229. on *:DIALOG:qc:sclick:12:{
  230. url -na mailto:Dwell7@live.com
  231. }
  232. #qc on
  233. on *:START:{
  234. echo $color(info) -st 6» Script: Query Control script by Abitare is loaded and running.
  235. hmake qcaccept 100
  236. if ($exists(qcaccept.hsh)) {
  237. .hload -s qcaccept qcaccept.hsh
  238. echo $color(info) -st 6» Script: hash table for Query Control loaded
  239. }
  240. }
  241. on *:EXIT:{
  242. hsave -s qcaccept qcaccept.hsh
  243. }
  244. on *:INPUT:?:{
  245. if ($active != -psyBNC && $active != -sBNC && !$away) {
  246. .timerclose.query. $+ $active 1 600 close.query $active
  247. }
  248. }
  249. on *:TEXT:*:?:{
  250. if ($nick != -psyBNC && $active != -sBNC && !$away) {
  251. .timerclose.query. $+ $nick 1 600 close.query $nick
  252. }
  253. }
  254. alias close.query {
  255. if ($nick == -sBNC) { HALT }
  256. if ($query($$1)) {
  257. close -m $1
  258. notice $1 $ewrap(The query window with you has been closed after 10 minutes of inactivity.)
  259. }
  260. }
  261. on *:CLOSE:?:{
  262. if ($timer($+(close.query.,$nick))) .timer $+ $($+(close.query.,$nick),2) off
  263. }
  264. on *:OPEN:?:{
  265. if ($nick == -psyBNC || $nick == -sBNC) {
  266. goto end
  267. }
  268. elseif ($hget(qcaccept,$address($nick,3))) {
  269. .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
  270. $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
  271. goto end
  272. }
  273. elseif ($away) {
  274. notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
  275. goto end
  276. }
  277. elseif ($dialog(qc)) {
  278. .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
  279. echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
  280. close -m $nick
  281. .ignore -pu15 $nick
  282. }
  283. else {
  284. set %qc.nick $nick
  285. set %qc.address $address($nick,3)
  286. window -h $nick
  287. .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
  288. dialog -mdo qc qc
  289. did -a qc 3 $asctime(hh:nn:ss)
  290. did -a qc 4 $nick
  291. did -a qc 6 $1-
  292. did -f qc 1
  293. }
  294. :end
  295. }
  296. CTCP *:VERSION:*:{
  297. if (!$($+(%,ctcp.qc.,$wildsite),2)) {
  298. .ctcpreply $nick VERSION Query Control Script v2.0.3 by Abitare (Dwell7@Live.com)
  299. set -eu15 $+(%,ctcp.qc.,$wildsite) on
  300. }
  301. }
  302. #qc end
  303.  
  304. alias dur {
  305. return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
  306. }
  307. alias ewrap {
  308. var %msg
  309. var %tok = 1
  310. var %word
  311. while ($gettok($1-,%tok,32) != $null) {
  312. %word = $gettok($1-,%tok,32)
  313. %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
  314. inc %tok
  315. }
  316. return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
  317. } Your Name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement