Jump to content

Archived

This topic is now archived and is closed to further replies.

coders-irc_Bot

Add-on couleur & correcteur de texte par devorz

Recommended Posts

  • Administrators

529HyUx4-47431.png

VOila je vien de le finir hier et je voulé savoir les avis des Utilisateur du client mIRC ceux qu'ils en pensent tous est de mois sauf la correction ( dialog de moi )

 

;##################
;#Scripting: Ecriture,Correcteur.              
;#
;#Auteur: /* devorZ */              
;#
;#Année: 2014               
;#
;#Pour Ouvrir le dialog /Ecriture     
;#
;##################

On *:load:{
  .echo -a Addon - Couleurs par devor14Z
  write correction.txt devorz devorZ
} 

alias Ecriture { if (!$dialog(Ecriture))  dialog -m Ecriture Ecriture }
dialog ecriture {
  title "- Ecriture - /Ecriture"
  size -1 -1 169 153
  option dbu
  button "Blanc", 2, 7 11 36 8
  button "Noir", 3, 44 11 36 8
  button "Bleu Foncé", 13, 7 20 36 8
  button "Rouge", 14, 7 29 36 8
  button "Mauve", 15, 7 38 36 8
  button "Gris", 16, 7 74 36 8
  button "Jaune", 17, 7 47 36 8
  button "Bleu Sombre", 18, 7 56 36 8
  button "Bleu", 19, 7 65 36 8
  button "Vert fluo", 20, 44 47 36 8
  button "Rose", 21, 44 74 36 8
  button "Vert", 22, 44 20 36 8
  button "Marron Foncé", 23, 44 29 36 8
  button "Marron Clair", 24, 44 38 36 8
  button "Bleu Ciel", 25, 44 56 36 8
  button "Gris Clair", 26, 44 65 36 8
  button "Désactiver Couleurs", 44, 3 117 163 11, flat
  button "Aperçu", 45, 97 107 69 9, flat
  button "Ok", 46, 3 141 163 11, flat ok cancel
  button "Blanc", 31, 89 11 36 8
  button "Noir", 32, 126 11 36 8
  button "Bleu Foncé", 33, 89 20 36 8
  button "Rouge", 34, 89 29 36 8
  button "Mauve", 35, 89 38 36 8
  button "Gris", 36, 89 74 36 8
  button "Jaune", 37, 89 47 36 8
  button "Bleu Sombre", 38, 89 65 36 8
  button "Bleu", 39, 89 56 36 8
  button "Vert fluo", 40, 126 47 36 8
  button "Rose", 41, 126 65 36 8
  button "Vert", 42, 126 20 36 8
  button "Marron Foncé", 43, 126 29 36 8
  button "Marron Clair", 47, 126 38 36 8
  button "Bleu Ciel", 48, 126 56 36 8
  button "Gris Clair", 49, 126 74 36 8
  button "Correcteur", 4, 3 128 163 11, flat
  check "", 9, 21 93 6 8
  text "Désactiver Couleurs si :", 11, 3 107 59 8
  edit "", 50, 63 107 31 9
  text "Ecriture :", 1, 7 3 25 8
  text "Fond :", 5, 89 3 25 8
  text "1 ère lettre en Majuscule", 6, 28 93 60 8
  box "", 7, 3 -1 81 87
  box "", 8, 85 -1 81 87
  check "", 10, 94 93 6 8
  text "Gras", 30, 101 93 13 8
  check "", 12, 119 93 6 8
  text "Souligné", 27, 126 93 21 8
  box "", 51, 18 86 132 19
}
on *:dialog:ecriture:*:*:{
  if ($devent == edit) {
    if ($did = 6) { set %deco.gauche $did(6) }
    if ($did = 8) { set %deco.droite $did(8) }
    if ($did = 50) { set %symboles $did(50) }
  }
  if ($devent == Init) {
    if %deco.gauche { did -a ecriture 6 %deco.gauche }
    if %deco.droite { did -a ecriture 8 %deco.droite }
    if %symboles { did -a ecriture 50 %symboles }
    if (%Maj == On) { did -c Ecriture 9 }
    if (%souligne == $chr(31)) { did -c ecriture 12 }
    if (%gras == $chr(2)) { did -c ecriture 10 }
    if ($did = 2) { did -a ecriture 28 }
  }
  if ($devent == sclick) {
    if ($did(9).state == 1) { set %Maj On | unset %normal } 
    else { unset %unset %maj | set %normal on }
    if ($did(12).state == 1) { set %souligne $chr(31) } 
    else {  unset %souligne   }
    if ($did(10).state == 1) {  set %gras $chr(2) } 
    else {  unset %gras }
    if ($did = 2) { set %couleur $chr(3) $+ $chr(48) $+ $chr(48) | Echo -a Vous avez Défini la couleur Blanche }
    if ($did = 3) { set %couleur $chr(3) $+ $chr(48) $+ $chr(49) | Echo -a Vous avez Défini la couleur Noir }
    if ($did = 13) { set %couleur $chr(3) $+ $chr(48) $+ $chr(50) | Echo -a Vous avez Défini la couleur Bleu Foncé }
    if ($did = 22) { set %couleur $chr(3) $+ $chr(48) $+ $chr(51) | Echo -a Vous avez Défini la couleur Vert }
    if ($did = 14) { set %couleur $chr(3) $+ $chr(48) $+ $chr(52) | Echo -a Vous avez Défini la couleur Rouge }
    if ($did = 23) { set %couleur $chr(3) $+ $chr(48) $+ $chr(53) | Echo -a Vous avez Défini la couleur Marron Foncé }
    if ($did = 15) { set %couleur $chr(3) $+ $chr(48) $+ $chr(54) | Echo -a Vous avez Défini la couleur Mauve }
    if ($did = 24) { set %couleur $chr(3) $+ $chr(48) $+ $chr(55) | Echo -a Vous avez Défini la couleur Marron Clair }
    if ($did = 17) { set %couleur $chr(3) $+ $chr(48) $+ $chr(56) | Echo -a Vous avez Défini la couleur Jaune }
    if ($did = 20) { set %couleur $chr(3) $+ $chr(48) $+ $chr(57) | Echo -a Vous avez Défini la couleur Vert fluo  }
    if ($did = 18) { set %couleur $chr(3) $+ $chr(49) $+ $chr(48) | Echo -a Vous avez Défini la couleur Bleu Sombre }
    if ($did = 25) { set %couleur $chr(3) $+ $chr(49) $+ $chr(49) | Echo -a Vous avez Défini la couleur Bleu Ciel }
    if ($did = 19) { set %couleur $chr(3) $+ $chr(49) $+ $chr(50) | Echo -a Vous avez Défini la couleur Bleu }
    if ($did = 21) { set %couleur $chr(3) $+ $chr(49) $+ $chr(51) | Echo -a Vous avez Défini la couleur Rose }
    if ($did = 16) { set %couleur $chr(3) $+ $chr(49) $+ $chr(52) | Echo -a Vous avez Défini la couleur Gris }
    if ($did = 26) { set %couleur $chr(3) $+ $chr(49) $+ $chr(53) | Echo -a Vous avez Défini la couleur Gris Clair }
    if ($did = 44) { unset %couleur | unset %fond | unset %gras | unset %souligne | Echo -a Désactivation des Couleur(s) }
    if ($did = 45) { Echo -a Voicie la couleur que tu a choisie : %deco.gauche %souligne $+ %gras $+ %couleur $+ %fond $+ COULEUR %deco.droite }
    if ($did = 4) { dialog -m correcteur correcteur }
    if ($did = 31) { set %fond , $+ $chr(48) $+ $chr(48) | Echo -a Vous avez Défini le Fond Blanche }
    if ($did = 32) { set %fond , $+ $chr(48) $+ $chr(49) | Echo -a Vous avez Défini le Fond Noir }
    if ($did = 33) { set %fond , $+ $chr(48) $+ $chr(50) | Echo -a Vous avez Défini le Fond Bleu Foncé }
    if ($did = 42) { set %fond , $+ $chr(48) $+ $chr(51) | Echo -a Vous avez Défini le Fond Vert }
    if ($did = 34) { set %fond , $+ $chr(48) $+ $chr(52) | Echo -a Vous avez Défini le Fond Rouge }
    if ($did = 43) { set %fond , $+ $chr(48) $+ $chr(53) | Echo -a Vous avez Défini le Fond Marron Foncé }
    if ($did = 35) { set %fond , $+ $chr(48) $+ $chr(54) | Echo -a Vous avez Défini le Fond Mauve }
    if ($did = 47) { set %fond , $+ $chr(48) $+ $chr(55) | Echo -a Vous avez Défini le Fond Clair }
    if ($did = 37) { set %fond , $+ $chr(48) $+ $chr(56) | Echo -a Vous avez Défini le Fond Jaune }
    if ($did = 40) { set %fond , $+ $chr(48) $+ $chr(57) | Echo -a Vous avez Défini le Fond Vert fluo  }
    if ($did = 38) { set %fond , $+ $chr(49) $+ $chr(48) | Echo -a Vous avez Défini le Fond Bleu Sombre }
    if ($did = 48) { set %fond , $+ $chr(49) $+ $chr(49) | Echo -a Vous avez Défini le Fond Bleu Ciel }
    if ($did = 39) { set %fond , $+ $chr(49) $+ $chr(50) | Echo -a Vous avez Défini le Fond Bleu }
    if ($did = 41) { set %fond , $+ $chr(49) $+ $chr(51) | Echo -a Vous avez Défini le Fond Rose }
    if ($did = 36) { set %fond , $+ $chr(49) $+ $chr(52) | Echo -a Vous avez Défini le Fond Gris }
    if ($did = 49) { set %fond , $+ $chr(49) $+ $chr(53) | Echo -a Vous avez Défini le Fond Gris Clair }
  }
}
ctcp *:VERSION:*:{
  timer 1 2 ctcpreply $nick VERSION 1Addon Color par 1devor14Z | HALT
} 
alias correct dialog -m correcteur correcteur
dialog Correcteur {
  title "- Correcteur - /Correct"
  size -1 -1 93 120
  option dbu
  button "Ajouter", 1, 9 10 37 12, flat
  button "Enlever", 2, 46 10 37 12, flat
  button "Désactiver", 4, 46 22 37 12, flat
  button "Activer", 5, 9 22 37 12, flat
  button "Fermer", 6, 2 109 88 10, flat ok cancel
  box "", 7, 2 0 89 107
  list 3, 9 36 75 64, size vsbar
}
On *:dialog:correcteur:init:*:{
  loadbuf -o correcteur 3 correction.txt
}
on *:Dialog:correcteur:sclick:*:{
  if ($did = 5) { correction status 1 }
  if ($did = 4) { correction status 0 }
  if ($did = 1) { correction add $$?="Le mot qui sera remplacé" $$?="Mot qui remplacera" | did -r $dname 3 | loadbuf -o $dname 3 correction.txt }
  if ($did = 2) { 
    if ($did(3).sel) {
      write -dl $+ $did(3).sel correction.txt
      did -r $dname 3
      loadbuf -o $dname 3 correction.txt
    }
  }
}
On *:dialog:correcteur:dclick:*:{
  if ($did = 3) { echo -a $did(correcteur,$did).seltext }
}
alias correction {
  if ($1 == ADD) {
    if ($3) {
      var  1
      while ($read(divers/correction.txt,%ù)) {
        if ($gettok($ifmatch,1,32) == $2) { echo -a $timestamp ( Correction ) Le mot $+(",$2,") est déjà dans la liste. | halt }
        inc 
      }
      write correction.txt $2-
      echo -a $timestamp ( Correction ) Le mot $+(",$2,") sera désormais remplacé par $+(",$3-,")
    }
    else { echo -a $timestamp ( Correction ) Syntaxe : /correction ADD Mot a remplacer Remplacer par... }
  }
  elseif ($1 == DEL) {
    if ($2 && !$3) {
      var %o 1
      while ($read(correction.txt,%o)) {
        if ($gettok($ifmatch,1,32) == $2) { write $+(-dl,%o) correction.txt | echo -a $timestamp ( Correction ) Le mot $+(",$2,") a été supprimé de la liste. | halt }
        inc %o
      }
      echo -a $timestamp ( Correction ) Le mot $+(",$2,") est introuvable dans la liste.
    }
    else { echo -a $timestamp ( Correction ) Syntaxe : /correction DEL Mot }
  }
  elseif ($1 == LIST) {
    if (!$2) {
      echo -a $timestamp ( Correction ) Liste des mots corrigés.
      var %^ 1
      while ($read(correction.txt,%^)) { echo -a $timestamp ( Correction ) Le mot $+(",$gettok($ifmatch,1,32),") est remplacé par $+(",$gettok($ifmatch,2-,32),") | inc %^ }
      echo -a $timestamp ( Correction ) Fin de la liste des mots corrigés.
    }
    else { echo -a $timestamp ( Correction ) Syntaxe : /correction LIST }
  }
  elseif ($1 == STATUS) {
    if ($istok(0.1,$2,46) && !$3) {
      $iif($2,set,unset) %correction 1
    echo -a $timestamp ( Correction ) La correction est maintenant $iif($2,activée,désactivée.)    }
    else { echo -a $timestamp ( Correction ) Syntaxe : /correction STATUS 0|1 }
  }
}
alias corrige {
  var %a = $1- ,%e = 1
  if (%correction) {
    while ($gettok(%a,%e,32)) {
      if ($read(correction.txt,s,$strip($v1))) { var %a = $puttok(%a,$ifmatch,%e,32) }
      inc %e $iif($numtok($ifmatch,32) > 1,$calc($numtok($ifmatch,32) + 1))
    }
  }
  return %a
}
on *:INPUT:*:{
  If (%Normal == on) {
    if ($left($1,1) == !) || ($left($1,1) == .) { say $1- | halt }
    if ($left($1-,1) !isin %symboles) { say  $+(%souligne,%gras,$iif(!%c,$+(%couleur,%fond)),$corrige($1-,%c)) | halt }
  }
  If (%Maj == on) {
    if ($left($1,1) == !) || ($left($1,1) == .) { say $1- | halt }
    var %textmaj = $+($upper($left($1-,1)),$right($1-,$calc($len($1-) - 1)))
    if ($left($1-,1) !isin %symboles) { say  $+(%souligne,%gras,$iif(!%c,$+(%couleur,%fond,,$corrige(%c,%textmaj)))) | halt }
  }
  If (%devorz == on) {
    if ($left($1,1) == !) || ($left($1,1) == .) { say $1- | halt }
    if ($left($1-,1) !isin %symboles) { msg $active $chr(3) $+ $chr(2) $+ $1 $chr(2) $+ $2- | halt }
  }
  :fin
}

alias say { msg $active $1- }
alias msg {
  .msg $1-
  var %color $colnick($1,$me)
  if ($window($1)) echo -t $1 $+($chr(3),%color) $+ $+($chr(3),14,«,$chr(2),$chr(3),1,$left($remove($nick(#,$me).pnick,$me),1),$me,$chr(3),14,») $2-
  else echo -at - $+ $> Msg $1 $+ : $+([, $+ $2-,])
}

 

Link to comment
Share on other sites



×
×
  • Create New...