Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.36 KB | None | 0 0
  1. [Module]
  2. Name=Quoteur
  3. Description=Enregistrement de citations (quotes)
  4. Version=1.00
  5. Ref=1.00
  6. View=1
  7. Author=Pada
  8. Email=pada@Teamscript.net
  9. Date=01/01/05
  10.  
  11.  
  12. Menu menubar {
  13. .Quoteur $chr(9) /quoteur:/quoteur
  14. }
  15. Alias -l quotepath return $remove($scriptdir,$fichier)
  16.  
  17. ;# Quoteur
  18. Alias Quoteur dialog $iif($dialog(quoteur),-v,-m) quoteur quoteur
  19. dialog quoteur {
  20. title Quoteur - /quoteur - $tsmax
  21. size -1 -1 450 293
  22. option dbu
  23. button "liste/mdx", 1,1 2 448 253
  24. button "OK", 2, 404 269 45 23,default ok
  25. button "Ajouter", 3, 1 269 55 11
  26. button "Supprimer", 4, 58 269 55 11
  27. button "", 5, 167 269 143 11 /* dire */
  28. button "", 13, 312 269 90 11 /* quit */
  29. button "Apercu/mdx", 6, 1 257 448 11
  30. box "", 7, 64 134 1 11
  31. button "Trier", 8, 115 269 50 11
  32. box "", 9, 96 134 1 11
  33. button "", 12, 1 281 80 11 /* hop */
  34. button "", 14, 83 281 80 11 /* part */
  35. button "", 10, 165 281 95 11 /* do */
  36. button "", 11, 262 281 95 11 /* say */
  37. button "Clipboard", 15, 359 281 43 11 /* clipboard */
  38. }
  39. on *:dialog:quoteur:*:*:{
  40. if ($devent == init) {
  41. mdxinit
  42. mdx SetFont $dname 5 +a 13 800 Verdana
  43. mdx SetDialog $dname icon 0 $fichier(System\images\icones\quoteur.ico)
  44. mdx SetControlMDX $dname 1 window > $mdxdialog
  45. window -lh +x @quotes Verdana 11
  46. did -a $dname 1 grab $window(@quotes).hwnd @quotes
  47. mdx SetControlMDX $dname 6 window > $mdxdialog
  48. window -pho +dL @Apercu.quotes -1 -1 500 20
  49. did -a $dname 6 grab $window(@Apercu.quotes).hwnd @Apercu.quotes
  50. mdx SetBorderStyle $dname 1,6 border
  51. set %quotem *
  52. set %quoteactive $active
  53. set %quoteactivecid $activecid
  54. did -a $dname 5 Dire sur %quoteactive
  55. if ($status == connected) && $xbot2(%quoteactive) {
  56. did -a $dname 10 ( $+ $xbot2(%quoteactive) $+ ) !do %quoteactive
  57. did -a $dname 11 ( $+ $xbot2(%quoteactive) $+ ) !say %quoteactive
  58. }
  59. else did -h $dname 10,11
  60. if ($status == connected) && (%quoteactive ischan) { did -a $dname 12 /hop %quoteactive }
  61. else did -h $dname 12
  62. if ($status == connected) && $lines($quotepath $+ quotes.txt) { did -a $dname 13 /quit $server }
  63. else did -h $dname 13
  64. if ($status == connected) && (%quoteactive ischan) { did -a $dname 14 /part %quoteactive }
  65. else did -h $dname 14
  66. load.quote
  67. }
  68. elseif ($devent == sclick) {
  69. var %a = $read($quotepath $+ quotes.txt,$gettok($sline(@quotes,1),1,32))
  70. if ($did == 3) { write.quote $date $point $$?="Quote à ajouter ?" }
  71. elseif ($did == 4) { rem.quote $$gettok($sline(@quotes,1),1,32) $sline(@quotes,1).ln }
  72. elseif ($did == 5) { read.quote %a }
  73. elseif ($did == 8) { set %quotem $?="Masque à rechercher ? (* pour afficher tous)" | load.quote }
  74. elseif ($did == 10) { do.quote %a }
  75. elseif ($did == 11) { say.quote %a }
  76. elseif ($did == 12) { hop.quote %a }
  77. elseif ($did == 13) { quit.quote %a }
  78. elseif ($did == 14) { part.quote %a }
  79. elseif ($did == 15) { clipboard %a }
  80. }
  81. elseif ($devent == close) { unset %quotem %quoteactive %quoteactivecid }
  82. }
  83. Menu @quotes {
  84. lbclick:apercu.quote
  85. dclick:read.quote
  86. }
  87. Alias -l apercu.quote {
  88. tokenize 32 $iif($1-,. $1-,$sline(@quotes,1))
  89. .timerquotes.defile off
  90. clear @apercu.quotes
  91. drawtext -bp @apercu.quotes 1 0 Verdana 11 2 1  $+ $2-
  92. if ($width( $+ $2-,Verdana,11,0,1) >= 890) { .timerquotes.defile 1 2 defile.quote -498 $calc($ifmatch + 500) $2- }
  93. }
  94. alias -l defile.quote {
  95. if $window(@apercu.quotes) {
  96. drawtext -bp @apercu.quotes 1 0 Verdana 11 $calc($1 % $2 + 500) 1  $+ $3- $+  $+ $chr(160)
  97. .timerquotes.defile -h 1 20 defile.quote $calc($1 - 1) $2-
  98. }
  99. }
  100. Alias -l Load.quote {
  101. %quotem = $replace($+(*,%quotem,*),***,*,**,*)
  102. if $exists($quotepath $+ quotes.txt) { filter -fwcbn $quotepath $+ quotes.txt @quotes %quotem }
  103. apercu.quote  $line(@quotes,0) quote $+ $iif($line(@quotes,0) >= 2,s) correspondant à %quotem
  104. }
  105. Alias -l write.quote {
  106. set %quotem *
  107. write $quotepath $+ quotes.txt $1-
  108. if $dialog(quoteur) {
  109. load.quote
  110. sline @quotes $line(@quotes,0)
  111. apercu.quote
  112. }
  113. }
  114. Alias -l rem.quote {
  115. ;$1 -> fichier, $2 -> fenêtre
  116. write -dl $+ $$1 $quotepath $+ quotes.txt
  117. dline -l @quotes $$2 $+ -
  118. var %m = $iif(%quotem,* $+ %quotem $+ *,*) , %L = $+($1,-,$lines($quotepath $+ quotes.txt))
  119. filter -fwbnr %L $quotepath $+ quotes.txt @quotes %m
  120. sline @quotes $$2
  121. apercu.quote
  122. }
  123. Alias -l read.quote {
  124. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  125. if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
  126. scid %quoteactivecid $iif(%quoteactive == Status Window,echo -stg,dire %quoteactive) 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
  127. }
  128. Alias -l do.quote {
  129. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  130. if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
  131. scid %quoteactivecid xdescribe %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
  132. }
  133. Alias -l say.quote {
  134. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  135. if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
  136. scid %quoteactivecid xmsg %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
  137. }
  138. Alias -l hop.quote {
  139. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  140. if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
  141. scid %quoteactivecid hop -c %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
  142. }
  143. Alias -l part.quote {
  144. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  145. if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
  146. scid %quoteactivecid part %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
  147. }
  148. Alias -l quit.quote {
  149. if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
  150. if !%quoteactivecid { var %quoteactivecid $active }
  151. var %input = $input(Quitter le serveur $server avec ce message de Quit ? $crlf $crlf $strip($$1-),y,Message de Quit)
  152. if (%input == $true) {
  153. scid %quoteactivecid quit 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23)) $+ 
  154. }
  155. }
  156. Alias quo {
  157. if ($2) { write.quote $1- }
  158. elseif ($1 isnum) { read.quote $$read($quotepath $+ quotes.txt,$1) }
  159. elseif ($1) {
  160. filter -ffcb $quotepath $+ quotes.txt $quotepath $+ quotes2.txt $+(*,$1,*)
  161. read.quote $$read($quotepath $+ quotes2.txt)
  162. .remove $quotepath $+ quotes2.txt
  163. }
  164. else { read.quote $$read($quotepath $+ quotes.txt) }
  165. }
  166. on 1:KEYDOWN:@quotes:46:{ if (!$keyrpt) { rem.quote $$gettok($sline(@quotes,1),1,32) $sline(@quotes,1).ln } }
  167. On *:INPUT:*:{
  168. if ($1 == !quote) && ($2 != $null) { write.quote $date $point $2- | wecho $event(Info,Quote ajoutée ^^) }
  169. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement