login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > Overige > Mirc > Fluistercontrole

Fluistercontrole

Auteur: Kevin - 13 mei 2006 - 09:52 - Gekeurd door: Maarten - Hits: 4665 - Aantal punten: 4.50 (2 stemmen)





Het stopt privé oproepen en wacht een goedkeuring af.
Het is een onderdeel van DocScript, mijn eigen script voor mirc

Code:
  1. on *:load:{
  2. echo -a 4Fluistercontrole v2.0 NL | echo -a 4Klik rechts in een venster voor Fluistercontrole menu.
  3. _vw querycon switch on
  4. _vw querycon standby Je prive-oproep is tegengehouden, wacht op bevestiging (dit is een automatisch bericht).
  5. _vw querycon decline Je prive-oproep is geweigerd, probeer later nog eens (dit is een automatisch bericht).
  6. _vw querycon reject Je prive-oproep is genegeerd (dit is een automatisch bericht).
  7. _vw querycon soundswitch off
  8. _vw querycon timer 120
  9. _vw querycon version query...2.0
  10. }
  11.  
  12. menu menubar,query,status,channel {
  13. Fluistercontrole ( $+ $_vr(querycon,switch) $+ )
  14. .Switch ( $+ $_vr(querycon,switch) $+ )
  15. ..Aan: _vw querycon switch on | if ($dialog(querycon) != $null) { did -c querycon 30 }
  16. ..Uit: _vw querycon switch off | if ($dialog(querycon) != $null) { did -u querycon 30 }
  17. .Instellingen:dialog -m querycon.edit querycon.edit
  18. }
  19.  
  20. alias querycon.edit { if ($dialog(querycon.edit) == $null) { dialog -m querycon.edit querycon.edit } }
  21.  
  22. dialog querycon.edit {
  23. title "Fluistercontrole - [DocScript by docterdre]"
  24. option pixels
  25. size 200 300 290 265
  26. edit "", 3, 10 20 270 20,autohs, left
  27. edit "", 4, 10 55 270 20,autohs, left
  28. edit "", 9, 10 90 270 20,autohs, left
  29. button "Annuleren", 11, 80 235 60 20,cancel
  30. button "OK", 12, 150 235 50 20, ok default
  31. text "Standaard Bericht", 13, 5 5 249 15
  32. text "Weiger Bericht", 14, 5 40 249 15
  33. text "Negeer Bericht", 19, 5 75 249 15
  34. check "Aan", 15, 10 126 80 20
  35. button "Kies geluid", 16, 75 126 75 20
  36. box "Geluid bij aanvraag fluister", 17, 5 110 160 45
  37. button "-", 206, 190 125 15 15
  38. button "+", 207, 250 125 15 15
  39. edit "", 208, 210 125 35 19
  40. box "Auto-sluit venster", 209, 170 110 110 45
  41. text "seconden", 210, 207 140 249 15
  42. radio "Normale Mask *!*@*", 211, 10 175 125 25
  43. radio "Host Mask Negeren", 212, 10 195 125 18
  44. box "Fluister flood negeer type", 213, 5 160 140 60
  45. edit "", 214, 155 195 20 20
  46. text "fluisters in", 215, 178 198 80 15
  47. box "Fluister flood bescherming", 216, 150 160 140 60
  48. edit "", 217, 230 195 30 20
  49. text "secs", 218, 262 198 50 15
  50. check "Aan", 219, 158 175 80 20
  51. }
  52.  
  53. on *:dialog:querycon.edit:init:*:{
  54. if ($_vr(querycon,ignore.host) == $null) { _vw querycon ignore.host on | _vw querycon ignore.uni off }
  55. if ($_vr(querycon,ignore.uni) == on) && ($_vr(querycon,ignore.host) == off) { did -c querycon.edit 211 1 }
  56. else did -c querycon.edit 212 1
  57. did -o querycon.edit 3 1 $_vr(querycon,standby)
  58. did -o querycon.edit 4 1 $_vr(querycon,decline)
  59. did -o querycon.edit 9 1 $_vr(querycon,reject)
  60. if ($_vr(querycon,soundswitch) == on) did -c querycon.edit 15
  61. if ($_vr(querycon,timer) == $null) _vw querycon timer 120
  62. did -o querycon.edit 208 1 $_vr(querycon,timer)
  63. if ($_vr(querycon,max.query) == $null) { _vw querycon max.query 5 | did -o querycon.edit 214 1 $_vr(querycon,max.query) }
  64. else did -o querycon.edit 214 1 $_vr(querycon,max.query)
  65. if ($_vr(querycon,max.query.sec) == $null) { _vw querycon max.query.sec 20 | did -o querycon.edit 217 1 $_vr(querycon,max.query.sec) }
  66. else did -o querycon.edit 217 1 $_vr(querycon,max.query.sec)
  67. if ($_vr(querycon,netflood) == on) did -c querycon.edit 219
  68. else did -b querycon.edit 211,217,212,214
  69. }
  70.  
  71. on *:dialog:querycon.edit:sclick:*:{
  72. if ($did == 12) {
  73. if ($did(querycon.edit,3).text != $null) {
  74. _vw querycon standby $did(querycon.edit,3).text
  75. }
  76. else _vw querycon standby Je prive-oproep is tegengehouden, wacht op bevestiging (dit is een automatisch bericht).
  77. if ($did(querycon.edit,4).text != $null) {
  78. _vw querycon decline $did(querycon.edit,4).text
  79. }
  80. else _vw querycon decline Je prive-oproep is geweigerd, probeer later nog eens (dit is een automatisch bericht).
  81. if ($did(querycon.edit,9).text != $null) {
  82. _vw querycon reject $did(querycon.edit,9).text
  83. }
  84. else _vw querycon reject Je prive-oproep is genegeerd (dit is een automatisch bericht).
  85. dialog -x querycon.edit
  86. halt
  87. }
  88. if ($did == 15) {
  89. if ($_vr(querycon,soundswitch) == off) { _vw querycon soundswitch on | did -c querycon.edit 15 }
  90. else { _vw querycon soundswitch off | did -u querycon.edit 15 }
  91. }
  92. if ($did == 16) { .timer -m 1 1 setquerysound }
  93. if ($did == 206) { if (%timer > 0) { dec %timer 1 | did -o querycon.edit 208 1 %timer | _vw querycon timer %timer | halt } }
  94. if ($did == 207) { inc %timer 1 | did -o querycon.edit 208 1 %timer | _vw querycon timer %timer | halt }
  95. if ($did == 211) {
  96. if ($_vr(querycon,ignore.uni) == off) { _vw querycon ignore.uni on | _vw querycon ignore.host off | did -c querycon.edit 211 | did -u querycon.edit 212 }
  97. else { _vw querycon ignore.uni off | _vw querycon ignore.host on | did -u querycon.edit 211 | did -c querycon.edit 212 }
  98. }
  99. if ($did == 212) {
  100. if ($_vr(querycon,ignore.host) == off) { _vw querycon ignore.host on | _vw querycon ignore.uni off | did -c querycon.edit 212 | did -u querycon.edit 211 }
  101. else { _vw querycon ignore.host off | _vw querycon ignore.uni on | did -u querycon.edit 212 | did -c querycon.edit 211 }
  102. }
  103. if ($did == 219) {
  104. if ($_vr(querycon,netflood) == off) { _vw querycon netflood on | did -c querycon.edit 219 | did -e querycon.edit 211,217,212,214 }
  105. else { _vw querycon netflood off | did -u querycon.edit 219 | did -b querycon.edit 211,217,212,214 }
  106. }
  107. }
  108.  
  109. on *:dialog:querycon.edit:edit:*:{
  110. if ($did == 208) {
  111. if ($did(querycon.edit,208).text != $null) {
  112. _vw querycon timer $did(querycon.edit,208).text
  113. }
  114. }
  115. if ($did == 214) {
  116. if ($did(querycon.edit,214).text != $null) {
  117. _vw querycon max.query $did(querycon.edit,214).text
  118. }
  119. }
  120. if ($did == 217) {
  121. if ($did(querycon.edit,217).text != $null) {
  122. _vw querycon max.query.sec $did(querycon.edit,217).text
  123. }
  124. }
  125. }
  126.  
  127. alias querycon { if ($dialog(querycon) == $null) { dialog -m querycon querycon } }
  128.  
  129. dialog querycon {
  130. title "Fluistercontrole v2.0 NL"
  131. option pixels
  132. size 200 300 290 140
  133. edit "", 3, 10 20 270 20,autohs read
  134. edit "", 4, 10 40 270 20,autohs read
  135. edit "", 5, 10 60 270 20,autohs read
  136. edit "", 6, 10 80 270 20,autohs read
  137. check "Aan voor prive-oproepen", 30, 10 4 160 15
  138. button "Negeer", 10, 60 110 50 20
  139. button "Weiger", 11, 120 110 50 20, cancel
  140. button "Accepteren", 12, 180 110 70 20, ok default
  141. button "Menu", 13, 10 110 40 20
  142. }
  143.  
  144. alias _sq_t {
  145. return $_vr(querycon,timer)
  146. }
  147.  
  148. alias close.qw {
  149. .notice %nw 3 $+ $_vr(querycon,decline)
  150. $ae 3Geweigerd
  151. if ($dialog(querycon) != $null) dialog -x querycon
  152. .timer.queue -m 1 1 verwerkqueue
  153. }
  154.  
  155. on *:dialog:querycon:init:*:{
  156. .timerclose.qw 1 $_sq_t close.qw
  157. if ($_vr(querycon,decline) == $null) { _vw querycon decline Je prive-oproep is geweigerd, probeer later nog eens (dit is een automatisch bericht). }
  158. did -o querycon 5 1 $_vr(querycon,lastmsg)
  159. if ($_vr(querycon,switch) == on) { did -c querycon 30 }
  160. if ($dialog(querycon) == $null) _vw querycon timer 120
  161. }
  162.  
  163. on *:dialog:querycon:sclick:*:{
  164. if ($did == 12) {
  165. .timerclose.qw off
  166. .ignore -r $did(3,$did(3))
  167. query $did(3,$did(3))
  168. .timer -m 1 1 echo $window($did(3)) $+(<,$did(3,$did(3)),>) $_vr(querycon,lastmsg)
  169. _vrem querycon lastmsg
  170. _vw querycon.nicks %nw on
  171. $ae 3Geaccepteerd
  172. dialog -x querycon
  173. .timer.queue -m 1 1 verwerkqueue
  174. halt
  175. }
  176. if ($did == 30) {
  177. if ($_vr(querycon,switch) == off) { _vw querycon switch on | did -c querycon 30 }
  178. else { _vw querycon switch off | did -u querycon 30 }
  179. }
  180. if ($did == 10) {
  181. .timerclose.qw off
  182. .ignore -p $did(3,$did(3)) 3
  183. notice $did(3,$did(3)) 3 $+ $_vr(querycon,reject)
  184. $ae 3Genegeerd
  185. dialog -x querycon
  186. .timer.queue -m 1 1 verwerkqueue
  187. halt
  188. }
  189. if ($did == 11) {
  190. .timerclose.qw off
  191. .ignore -pu120 $did(3,$did(3)) 3
  192. notice $did(3,$did(3)) 3 $+ $_vr(querycon,decline)
  193. $ae 3Geweigerd
  194. dialog -x querycon
  195. .timer.queue -m 1 1 verwerkqueue
  196. halt
  197. }
  198. if ($did == 13) { querycon.edit | halt }
  199. }
  200.  
  201. on *:INPUT:?: {
  202. _vw querycon.nicks $query($active) on
  203. }
  204.  
  205. on 1:CLOSE:?: {
  206. _vrem querycon.nicks $nick
  207. }
  208.  
  209. on 1:NICK: {
  210. if ($_vr(querycon.queuemsg, $nick)) {
  211. _vw querycon queue $reptok($_vr(querycon, queue), $nick, $newnick, 1, 32)
  212. _vw querycon.queuemsg $newnick $_vr(querycon.queuemsg, $nick)
  213. _vrem querycon.queuemsg $nick
  214. }
  215. elseif ($_vr(querycon.nicks, $nick)) {
  216. _vw querycon.nicks $newnick $_vr(querycon.nicks, $nick)
  217. _vrem querycon.nicks $nick
  218. }
  219. }
  220.  
  221. on 1:QUIT: {
  222. if ($_vr(querycon.queuemsg, $nick)) {
  223. var %findq = $findtok($_vr(querycon, queue), $nick, 1, 32)
  224. var %restq = $deltok($_vr(querycon, queue), %findq, 32)
  225. var %restqsite = $deltok($_vr(querycon, queuesite), %findq, 32)
  226. if (%restq) {
  227. _vw querycon queue %restq
  228. _vw querycon queuesite %restqsite
  229. }
  230. else {
  231. _vrem querycon queue
  232. _vrem querycon queuesite
  233. }
  234. _vrem querycon.queuemsg $nick
  235. }
  236. }
  237.  
  238. on ^1:TEXT:*:?: {
  239. ; vul hieronder op de puntjes eventueel nicknames in die altijd mogen fluisteren
  240. ; if ($nick == .....) || ($nick == .....) { goto end }
  241. if ($_vr(querycon,switch) == $null) _vw querycon switch on
  242.  
  243. if ($_vr(querycon.nicks,$nick) != on) {
  244. if ($_vr(querycon,switch) == on) {
  245. if ($dialog(querycon) == $null) {
  246. if ($_vr(querycon,soundswitch) == on) { if ($_vr(querycon,sound) != $null) { splay $_vr(querycon,sound) } }
  247. verwerkoproep $nick $site $1-
  248. }
  249. else {
  250. _vw querycon queue $addtok($_vr(querycon,queue), $nick, 32)
  251. _vw querycon queuesite $addtok($_vr(querycon,queuesite), $site, 32)
  252. _vw querycon.queuemsg $nick $1-
  253. did -o querycon 6 1 $_vr(querycon,queue)
  254. }
  255. halt
  256. }
  257. }
  258. elseif ($_vr(querycon,netflood) == on) {
  259. if ($isflood(priveflood. $+ $nick,$_vr(querycon,max.query),$_vr(querycon,max.query.sec))) {
  260. if ($_vr(querycon,ignore.uni) == on) ignore -pu $+ $_vr(querycon,max.query.sec) *!*@*
  261. else ignore -pu $+ $_vr(querycon,max.query.sec) $wildsite
  262. _vrem querycon.nicks $nick
  263. .msg $nick 0,4[ ALARM ] Fluister Flooding. Je wordt nu genegeerd gedurende $_vr(querycon,max.query.sec) sec.
  264. echo -a 0,4[ ALARM ] $nick is Fluister Flooding. User ( $+ $wildsite $+ ) nu genegeerd gedurende $_vr(querycon,max.query.sec) sec.
  265. }
  266. }
  267. :end
  268. }
  269.  
  270. alias verwerkoproep {
  271. ; $1=$nick, $2=$site, $3=$1- (tekst)
  272. if ($_vr(querycon,standby) == $null) { _vw querycon standby Je prive-oproep is tegengehouden, wacht op bevestiging (dit is een automatisch bericht).
  273. }
  274. _vw querycon lastmsg $3-
  275. $ae 3Prive-oproep van $1
  276. $ae 3Wachten op bevestiging...
  277. .ignore -pu $+ $_sq_t $1
  278. .notice $1 3 $+ $_vr(querycon,standby)
  279. set %nw $1
  280. querycon
  281. if ($dialog(querycon) != $null) {
  282. did -o querycon 3 1 $1
  283. did -o querycon 4 1 *!* $+ @ $+ $2
  284. }
  285. }
  286.  
  287. alias ae return echo -at
  288.  
  289. alias se return echo -st
  290. ;[read write data/setting.ini]
  291.  
  292. alias _vr {
  293. if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  294. return $readini data\setting.ini $1 $2
  295. }
  296.  
  297. alias _vw {
  298. if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  299. writeini data\setting.ini $1 $2 $3-
  300. }
  301.  
  302. alias _vrem {
  303. if ($exists(data\setting.ini) == $false) { mkdir data | write -c data\setting.ini }
  304. remini data\setting.ini $1 $2
  305. }
  306.  
  307. alias setquerysound {
  308. _vw querycon sound $dir="Kies een geluid:" $mircdir*.wav
  309. }
  310.  
  311. alias verwerkqueue {
  312. if ($_vr(querycon, queue)) {
  313. if ($_vr(querycon,soundswitch) == on) { if ($_vr(querycon,sound) != $null) { splay $_vr(querycon,sound) } }
  314. var %queuenick = $gettok($_vr(querycon, queue), 1, 32)
  315. var %queuesite = $gettok($_vr(querycon, queuesite), 1, 32)
  316. var %restqueue = $deltok($_vr(querycon, queue), 1, 32)
  317. var %restqueuesite = $deltok($_vr(querycon, queuesite), 1, 32)
  318. if (%restqueue) {
  319. _vw querycon queue %restqueue
  320. _vw querycon queuesite %restqueuesite
  321. }
  322. else {
  323. _vrem querycon queue
  324. _vrem querycon queuesite
  325. }
  326. var %queuemsg = $_vr(querycon.queuemsg, %queuenick)
  327. _vrem querycon.queuemsg %queuenick
  328. verwerkoproep %queuenick %queuesite %queuemsg
  329. }
  330. }
  331.  
  332. alias isflood {
  333. if (!$3) return
  334. var %v = $chr(37) $+ isflood. $+ $1
  335. if !$(%v,2) {
  336. set $(-u $+ $3,2) $(%v,1) 1
  337. }
  338. else {
  339. inc $(%v,1)
  340. }
  341. if $(%v,2) >= $2 {
  342. unset $(%v,1)
  343. return $true
  344. }
  345. return $false
  346. }
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (7)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.052s