Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Module]
- Name=Quoteur
- Description=Enregistrement de citations (quotes)
- Version=1.00
- Ref=1.00
- View=1
- Author=Pada
- Email=pada@Teamscript.net
- Date=01/01/05
- Menu menubar {
- .Quoteur $chr(9) /quoteur:/quoteur
- }
- Alias -l quotepath return $remove($scriptdir,$fichier)
- ;# Quoteur
- Alias Quoteur dialog $iif($dialog(quoteur),-v,-m) quoteur quoteur
- dialog quoteur {
- title Quoteur - /quoteur - $tsmax
- size -1 -1 450 293
- option dbu
- button "liste/mdx", 1,1 2 448 253
- button "OK", 2, 404 269 45 23,default ok
- button "Ajouter", 3, 1 269 55 11
- button "Supprimer", 4, 58 269 55 11
- button "", 5, 167 269 143 11 /* dire */
- button "", 13, 312 269 90 11 /* quit */
- button "Apercu/mdx", 6, 1 257 448 11
- box "", 7, 64 134 1 11
- button "Trier", 8, 115 269 50 11
- box "", 9, 96 134 1 11
- button "", 12, 1 281 80 11 /* hop */
- button "", 14, 83 281 80 11 /* part */
- button "", 10, 165 281 95 11 /* do */
- button "", 11, 262 281 95 11 /* say */
- button "Clipboard", 15, 359 281 43 11 /* clipboard */
- }
- on *:dialog:quoteur:*:*:{
- if ($devent == init) {
- mdxinit
- mdx SetFont $dname 5 +a 13 800 Verdana
- mdx SetDialog $dname icon 0 $fichier(System\images\icones\quoteur.ico)
- mdx SetControlMDX $dname 1 window > $mdxdialog
- window -lh +x @quotes Verdana 11
- did -a $dname 1 grab $window(@quotes).hwnd @quotes
- mdx SetControlMDX $dname 6 window > $mdxdialog
- window -pho +dL @Apercu.quotes -1 -1 500 20
- did -a $dname 6 grab $window(@Apercu.quotes).hwnd @Apercu.quotes
- mdx SetBorderStyle $dname 1,6 border
- set %quotem *
- set %quoteactive $active
- set %quoteactivecid $activecid
- did -a $dname 5 Dire sur %quoteactive
- if ($status == connected) && $xbot2(%quoteactive) {
- did -a $dname 10 ( $+ $xbot2(%quoteactive) $+ ) !do %quoteactive
- did -a $dname 11 ( $+ $xbot2(%quoteactive) $+ ) !say %quoteactive
- }
- else did -h $dname 10,11
- if ($status == connected) && (%quoteactive ischan) { did -a $dname 12 /hop %quoteactive }
- else did -h $dname 12
- if ($status == connected) && $lines($quotepath $+ quotes.txt) { did -a $dname 13 /quit $server }
- else did -h $dname 13
- if ($status == connected) && (%quoteactive ischan) { did -a $dname 14 /part %quoteactive }
- else did -h $dname 14
- load.quote
- }
- elseif ($devent == sclick) {
- var %a = $read($quotepath $+ quotes.txt,$gettok($sline(@quotes,1),1,32))
- if ($did == 3) { write.quote $date $point $$?="Quote à ajouter ?" }
- elseif ($did == 4) { rem.quote $$gettok($sline(@quotes,1),1,32) $sline(@quotes,1).ln }
- elseif ($did == 5) { read.quote %a }
- elseif ($did == 8) { set %quotem $?="Masque à rechercher ? (* pour afficher tous)" | load.quote }
- elseif ($did == 10) { do.quote %a }
- elseif ($did == 11) { say.quote %a }
- elseif ($did == 12) { hop.quote %a }
- elseif ($did == 13) { quit.quote %a }
- elseif ($did == 14) { part.quote %a }
- elseif ($did == 15) { clipboard %a }
- }
- elseif ($devent == close) { unset %quotem %quoteactive %quoteactivecid }
- }
- Menu @quotes {
- lbclick:apercu.quote
- dclick:read.quote
- }
- Alias -l apercu.quote {
- tokenize 32 $iif($1-,. $1-,$sline(@quotes,1))
- .timerquotes.defile off
- clear @apercu.quotes
- drawtext -bp @apercu.quotes 1 0 Verdana 11 2 1 $+ $2-
- if ($width( $+ $2-,Verdana,11,0,1) >= 890) { .timerquotes.defile 1 2 defile.quote -498 $calc($ifmatch + 500) $2- }
- }
- alias -l defile.quote {
- if $window(@apercu.quotes) {
- drawtext -bp @apercu.quotes 1 0 Verdana 11 $calc($1 % $2 + 500) 1 $+ $3- $+ $+ $chr(160)
- .timerquotes.defile -h 1 20 defile.quote $calc($1 - 1) $2-
- }
- }
- Alias -l Load.quote {
- %quotem = $replace($+(*,%quotem,*),***,*,**,*)
- if $exists($quotepath $+ quotes.txt) { filter -fwcbn $quotepath $+ quotes.txt @quotes %quotem }
- apercu.quote $line(@quotes,0) quote $+ $iif($line(@quotes,0) >= 2,s) correspondant à %quotem
- }
- Alias -l write.quote {
- set %quotem *
- write $quotepath $+ quotes.txt $1-
- if $dialog(quoteur) {
- load.quote
- sline @quotes $line(@quotes,0)
- apercu.quote
- }
- }
- Alias -l rem.quote {
- ;$1 -> fichier, $2 -> fenêtre
- write -dl $+ $$1 $quotepath $+ quotes.txt
- dline -l @quotes $$2 $+ -
- var %m = $iif(%quotem,* $+ %quotem $+ *,*) , %L = $+($1,-,$lines($quotepath $+ quotes.txt))
- filter -fwbnr %L $quotepath $+ quotes.txt @quotes %m
- sline @quotes $$2
- apercu.quote
- }
- Alias -l read.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
- 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))
- }
- Alias -l do.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
- scid %quoteactivecid xdescribe %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
- }
- Alias -l say.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
- scid %quoteactivecid xmsg %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
- }
- Alias -l hop.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
- 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))
- }
- Alias -l part.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactive { var %quoteactive $active } | if !%quoteactivecid { var %quoteactivecid $active }
- scid %quoteactivecid part %quoteactive 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23))
- }
- Alias -l quit.quote {
- if !$1 && $window(@quotes) { tokenize 32 $sline(@quotes,1) | tokenize 32 $2- }
- if !%quoteactivecid { var %quoteactivecid $active }
- var %input = $input(Quitter le serveur $server avec ce message de Quit ? $crlf $crlf $strip($$1-),y,Message de Quit)
- if (%input == $true) {
- scid %quoteactivecid quit 2 $+ $chr(35) $gettok($sline(@quotes,1),1,32) $point $replace($left($$1-,23),[,[,],]) $+ $right($$1-,$calc($len($$1-)-23)) $+
- }
- }
- Alias quo {
- if ($2) { write.quote $1- }
- elseif ($1 isnum) { read.quote $$read($quotepath $+ quotes.txt,$1) }
- elseif ($1) {
- filter -ffcb $quotepath $+ quotes.txt $quotepath $+ quotes2.txt $+(*,$1,*)
- read.quote $$read($quotepath $+ quotes2.txt)
- .remove $quotepath $+ quotes2.txt
- }
- else { read.quote $$read($quotepath $+ quotes.txt) }
- }
- on 1:KEYDOWN:@quotes:46:{ if (!$keyrpt) { rem.quote $$gettok($sline(@quotes,1),1,32) $sline(@quotes,1).ln } }
- On *:INPUT:*:{
- if ($1 == !quote) && ($2 != $null) { write.quote $date $point $2- | wecho $event(Info,Quote ajoutée ^^) }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement