begin process at 2012 02 08 19:40:31
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

AddOns

 > ANTIPV + GESTION MESSAGES PAR FICHIER

ANTIPV + GESTION MESSAGES PAR FICHIER


 Information sur la source

Note :
6,25 / 10 - par 4 personnes
6,25 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :AddOns Niveau :Débutant Date de création :07/12/2003 Date de mise à jour :02/04/2004 13:29:52 Vu / téléchargé :2 966 / 115

Auteur : carpediem666fr

Ecrire un message privé
Site perso
Commentaire sur cette source (5)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
bon voila.. cet antipv :
- vous permet d'enregistrer ou pas le message de votre interlocuteur (configurable)
- vous permet de lire le message dans la fenetre active et enregistre ce message dans un fichier texte.
- vous permet de supprimer ou pas les messages précedents. (configurable)
(mis à jour suivant les indication de Kolibot (merci a toa) )

- mise à jour : ajout de la 'date 'effacement (01/01/2004)

Source

  • on *:LOAD:{ echo -a 4 vous venez de loader antiPV par SeigneurCarpe - Auteur de %version ! 10 visitez le site: http://www.onlyu.fr.st }
  • on *:UNLOAD:{ echo -a 4 vous venez de déloader antiPV par SeigneurCarpe - Auteur de %version ! 10 visitez le site: http://www.onlyu.fr.st }
  • dialog antipv {
  • title AntiPV par SeigneurCarpe
  • size -1 -1 277 183
  • option dbu
  • text "Que faire lorsque vous recevez un PV ?", 2, 85 4 98 8
  • check "Fermer le PV", 3, 21 14 50 10
  • check "Envoyer un message automatique", 4, 170 14 99 10
  • text "Message envoyé si fermeture du pv : ", 5, 5 36 95 8
  • edit %pv.fermé.msg, 6, 5 45 182 11
  • radio "Activer les fonctions de l'antipv", 7, 145 130 93 10
  • radio "Désactiver les fonctions de l'antipv", 8, 145 141 95 10
  • button "&Fermer", 9, 136 159 49 20, flat multi ok
  • check " Enregistrement des messages", 10, 6 130 104 10
  • button "&Lire les msg", 14, 80 159 49 20, flat
  • check "supprimer les messages après lecture", 15, 6 140 104 10
  • text "Message envoyé si non fermeture du pv", 17, 5 80 100 8
  • edit %pv.ouvert.msg, 18, 6 90 180 12
  • edit %sonF, 19, 188 45 84 11, autohs
  • edit %sonO, 20, 188 90 82 11
  • button "&Parcourir ...", 21, 189 60 47 15
  • link "http://www.onlyu.fr.st", 23, 20 163 56 8
  • icon 24, 3 158 15 15, icones\cs.ico, 0
  • button "P&arcourir", 22, 190 105 47 15
  • icon 11, 238 105 15 15, icones\Lire.ico, 0, noborder
  • icon 13, 254 105 15 15, icones\stop2.ico, 0, noborder
  • icon 25, 257 60 15 15, icones\stop2.ico, 0, noborder
  • icon 26, 239 60 15 15, icones\Lire.ico, 0, noborder
  • box "", 27, 1 123 137 32
  • text "Son à jouer lors de la fermeture :", 28, 190 36 80 8
  • text "Son à jouer lors de l'ouverture du PV", 29, 185 80 88 8
  • box "", 30, 137 123 140 32
  • box "", 1, 3 0 272 29
  • box "", 12, 81 0 102 13
  • icon 16, 254 161 15 15, images\aide.jpg, 0
  • text "De l'Aide ? cliquez ici --->", 31, 192 166 61 8
  • }
  • on *:dialog:antipv:*:*:{
  • if ($devent == edit) {
  • if ($did == 6) { set %pv.fermé.msg $did(6).text }
  • if ($did == 18) { set %pv.ouvert.msg $did(18).text }
  • }
  • if ($devent == sclick) {
  • if ($did == 14) {
  • if (%enregmsg == on && $exists(antipv.txt) == $true) { Lecture.fichier.pv }
  • if (%enregmsg == on && $exists(antipv.txt) == $false) { set %message problème : le fichier antipv.txt est inexistant ! | Attention }
  • if (%enregmsg == off && $exists(antipv.txt) == $true) { set %message fichier vide car pas d'enregstrement enregistré | Attention }
  • if (%enregmsg == on && $exists(antipv.txt) == $false) { set %message le fichier antipv.txt est inexistant ou vide ! | Attention }
  • if (%suppr == on && $exists(antipv.txt) == $true) { Effacement.fichier.pv }
  • if (%suppr == on && $exists(antipv.txt) == $false) { set %message le fichier antipv.txt est inexistant ! | Attention }
  • }
  • if ($did == 23) { URL }
  • if ($did == 16) { antipvread }
  • if ($did(10).state == 1) { %enregmsg = on }
  • if ($did(10).state == 0) { %enregmsg = off }
  • if ($did(3).state == 1) { set %antipvclose on }
  • if ($did(3).state == 0) { set %antipvclose off }
  • if ($did(7).state == 1) { enable #antipv }
  • if ($did(8).state == 1) { disable #antipv }
  • if ($did(4).state == 1) { %antipvmess = on }
  • if ($did(4).state == 0) { %antipvmess = off }
  • if ($did(15).state == 1) { %suppr = on }
  • if ($did(15).state == 0) { %suppr = off }
  • if ($did == 22) { set %sonO $dir="Choisis un fichier WAV à jouer:" [ c:\ $+ *.wav ] | did -ra Antipv 20 %sonO }
  • if ($did == 11) { did -g Antipv 11 icones\lire2.ico | did -g Antipv 13 icones\stop.ico | splay %sonO }
  • if ($did == 13) { did -g Antipv 13 icones\stop2.ico | did -g Antipv 11 icones\lire.ico | splay stop }
  • if ($did == 21) { set %sonF $dir="Choisis un fichier WAV à jouer:" [ c:\ $+ *.wav ] | did -ra Antipv 19 %sonF }
  • if ($did == 26) { did -g Antipv 26 icones\lire2.ico | did -g Antipv 25 icones\stop.ico | splay %sonF }
  • if ($did == 25) { did -g Antipv 25 icones\stop2.ico | did -g Antipv 26 icones\lire.ico | splay stop }
  • }
  • if ($devent == init) {
  • did -e Antipv 16, 23
  • if (%pv.fermé.msg) { did -ra antipv 6 %pv.fermé.msg }
  • if (%pv.ouvert.msg) { did -ra antipv 18 %pv.ouvert.msg }
  • if ($did(4).enabled == $true) { did -n antipv 6 }
  • if ($group(#antipv) == on) { did -c antipv 7 }
  • if ($group(#antipv) == off) { did -c antipv 8 }
  • if (%antipvmess == on ) { did -c antipv 4 }
  • if (%antipvmess == off) { did -u antipv 4 }
  • if (%antipvclose == on) { did -c antipv 3 }
  • if (%antipvclose == off) { did -u antipv 3 }
  • if (%enregmsg == on) { did -c antipv 10 }
  • if (%suppr == on) { did -c antipv 15 }
  • if (%suppr == off) { did -u antipv 15 }
  • }
  • }
  • #antipv on
  • On 1:OPEN:?:{
  • if (%antipvclose == on) {
  • if (%sonF != $null) { splay %sonF }
  • if (%enregmsg == on) {
  • write -l2 antipv.txt ----------------------------------------------
  • set %nickpv $nick
  • set %11 $1-
  • set %len $lines(antipv.txt)
  • inc %len
  • write -il $+ %len antipv.txt Le $date à $timestamp $nick a dit : 4 %11
  • }
  • if (%antipvmess == on) { msg $nick %pv.fermé.msg }
  • close -m $nick
  • }
  • if (%antipvclose == off) {
  • set %enregmsg off
  • if (%sonO != $null) { splay %sonO }
  • if (%antipvmess == on) { msg $nick %pv.ouvert.msg }
  • }
  • }
  • #antipv end
  • ;### ALIASES ####
  • Alias Effacement.fichier.pv {
  • write -c antipv.txt EFFACEMENT DU FICHIER le $date à $timestamp
  • write -l2 antipv.txt ----------------------------------------------
  • }
  • Alias Lecture.fichier.pv {
  • var %lirenum $lines(antipv.txt)
  • var %lecturecompteur 0
  • while ( %lecturecompteur < %lirenum) {
  • inc %lecturecompteur
  • echo -a $read(antipv.txt,%lecturecompteur)
  • }
  • }
on *:LOAD:{ echo -a 4 vous venez de loader antiPV par SeigneurCarpe - Auteur de %version ! 10  visitez le site: http://www.onlyu.fr.st }
on *:UNLOAD:{ echo -a 4 vous venez de déloader antiPV par SeigneurCarpe - Auteur de %version ! 10  visitez le site: http://www.onlyu.fr.st }

dialog antipv {
  title AntiPV par SeigneurCarpe
  size -1 -1 277 183
  option dbu
  text "Que faire lorsque vous recevez un PV ?", 2, 85 4 98 8
  check "Fermer le PV", 3, 21 14 50 10
  check "Envoyer un message automatique", 4, 170 14 99 10
  text "Message envoyé si fermeture du pv : ", 5, 5 36 95 8
  edit %pv.fermé.msg, 6, 5 45 182 11
  radio "Activer les fonctions de l'antipv", 7, 145 130 93 10
  radio "Désactiver les fonctions de l'antipv", 8, 145 141 95 10
  button "&Fermer", 9, 136 159 49 20, flat multi ok
  check " Enregistrement des messages", 10, 6 130 104 10
  button "&Lire les msg", 14, 80 159 49 20, flat
  check "supprimer les messages après lecture", 15, 6 140 104 10
  text "Message envoyé si non fermeture du pv", 17, 5 80 100 8
  edit %pv.ouvert.msg, 18, 6 90 180 12
  edit %sonF, 19, 188 45 84 11, autohs
  edit %sonO, 20, 188 90 82 11
  button "&Parcourir ...", 21, 189 60 47 15
  link "http://www.onlyu.fr.st", 23, 20 163 56 8
  icon 24, 3 158 15 15,  icones\cs.ico, 0
  button "P&arcourir", 22, 190 105 47 15
  icon 11, 238 105 15 15,  icones\Lire.ico, 0, noborder
  icon 13, 254 105 15 15,  icones\stop2.ico, 0, noborder
  icon 25, 257 60 15 15,  icones\stop2.ico, 0, noborder
  icon 26, 239 60 15 15,  icones\Lire.ico, 0, noborder
  box "", 27, 1 123 137 32
  text "Son à jouer lors de la fermeture :", 28, 190 36 80 8
  text "Son à jouer lors de l'ouverture du PV", 29, 185 80 88 8
  box "", 30, 137 123 140 32
  box "", 1, 3 0 272 29
  box "", 12, 81 0 102 13
  icon 16, 254 161 15 15,  images\aide.jpg, 0
  text "De l'Aide ? cliquez ici --->", 31, 192 166 61 8
}

on *:dialog:antipv:*:*:{
  if ($devent == edit) {
    if ($did == 6) { set %pv.fermé.msg $did(6).text }
    if ($did == 18) { set %pv.ouvert.msg $did(18).text }
  }

  if ($devent == sclick) {
    if ($did == 14) { 
      if (%enregmsg == on && $exists(antipv.txt) == $true) { Lecture.fichier.pv }
      if (%enregmsg == on && $exists(antipv.txt) == $false) { set %message problème : le fichier antipv.txt est inexistant ! | Attention }
      if (%enregmsg == off && $exists(antipv.txt) == $true) { set %message fichier vide car pas d'enregstrement enregistré | Attention }
      if (%enregmsg == on && $exists(antipv.txt) == $false) { set %message le fichier antipv.txt est inexistant ou vide ! | Attention }
      if (%suppr == on &&  $exists(antipv.txt) == $true) { Effacement.fichier.pv }
      if (%suppr == on &&  $exists(antipv.txt) == $false) { set %message le fichier antipv.txt est inexistant ! | Attention }
    }
    if ($did == 23) { URL }
    if ($did == 16) { antipvread }
    if ($did(10).state == 1) { %enregmsg = on }
    if ($did(10).state == 0) { %enregmsg = off }
    if ($did(3).state == 1) { set %antipvclose on } 
    if ($did(3).state == 0) { set %antipvclose off }
    if ($did(7).state == 1) { enable #antipv }
    if ($did(8).state == 1) { disable #antipv }
    if ($did(4).state == 1) { %antipvmess = on }
    if ($did(4).state == 0) { %antipvmess = off }
    if ($did(15).state == 1) { %suppr = on }
    if ($did(15).state == 0) { %suppr = off } 

    if ($did == 22) { set %sonO $dir="Choisis un fichier WAV à jouer:" [ c:\ $+ *.wav ] | did -ra Antipv 20 %sonO  }
    if ($did == 11) { did -g Antipv 11 icones\lire2.ico | did -g Antipv 13 icones\stop.ico | splay %sonO }
    if ($did == 13) { did -g Antipv 13 icones\stop2.ico | did -g Antipv 11 icones\lire.ico | splay stop }

    if ($did == 21) { set %sonF $dir="Choisis un fichier WAV à jouer:" [ c:\ $+ *.wav ] | did -ra Antipv 19 %sonF  }
    if ($did == 26) { did -g Antipv 26 icones\lire2.ico | did -g Antipv 25 icones\stop.ico | splay %sonF }
    if ($did == 25) { did -g Antipv 25 icones\stop2.ico | did -g Antipv 26 icones\lire.ico | splay stop }
  }

  if ($devent == init) {
    did -e Antipv 16, 23
    if (%pv.fermé.msg) { did -ra antipv 6 %pv.fermé.msg }
    if (%pv.ouvert.msg) { did -ra antipv 18 %pv.ouvert.msg }
    if ($did(4).enabled == $true) { did -n antipv 6 }
    if ($group(#antipv) == on) { did -c antipv 7 }
    if ($group(#antipv) == off) { did -c antipv 8 }
    if (%antipvmess == on ) { did -c antipv 4 }
    if (%antipvmess == off) { did -u antipv 4 }

    if (%antipvclose == on) { did -c antipv 3 }
    if (%antipvclose == off) { did -u antipv 3 }

    if (%enregmsg == on) { did -c antipv 10 }

    if (%suppr == on) { did -c antipv 15 }
    if (%suppr == off) { did -u antipv 15 }    
  }
}


#antipv on
On 1:OPEN:?:{ 
  if (%antipvclose == on) {
    if (%sonF != $null) { splay %sonF }
    if (%enregmsg == on) { 
      write -l2 antipv.txt ----------------------------------------------
      set %nickpv $nick
      set %11 $1-
      set %len $lines(antipv.txt)
      inc %len
      write -il $+ %len antipv.txt Le $date à $timestamp $nick a dit : 4  %11
    } 
    if (%antipvmess == on) { msg $nick %pv.fermé.msg }
    close -m $nick
  }

  if (%antipvclose == off) { 
    set %enregmsg off
    if (%sonO != $null) { splay %sonO }
    if (%antipvmess == on) { msg $nick %pv.ouvert.msg }
  }
}
#antipv end


;### ALIASES ####


Alias Effacement.fichier.pv {
  write -c antipv.txt EFFACEMENT DU FICHIER le $date à $timestamp
  write -l2 antipv.txt ----------------------------------------------
}

Alias Lecture.fichier.pv {
  var %lirenum $lines(antipv.txt)
  var %lecturecompteur 0
  while ( %lecturecompteur < %lirenum) { 
    inc %lecturecompteur 
    echo -a $read(antipv.txt,%lecturecompteur)
  }
}

 Conclusion

pour tout reports de bugs : webmaster@onlyu.fr.St


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

Source avec Zip Source avec une capture COULEUR D'ÉCRITURE NOUVELLE FORMULE ...
Source avec Zip CONNECTION À UN SERVEUR EN DIALOGUE
ANTITOUT :-)
Source avec Zip ANTIPUB :-)
Source avec Zip CDES NICKSERV + CHANSERV COMPLETES !

 Sources de la même categorie

PACMAN MULTI-JOUEUR EN LIGNE par wims
PROXY&SOCKS SCANNER+LEECHER par independentt
GESTIONNAIRE DE HIGHLIGHT AVANCÉ AVEC IGNORE SALON OU PSEUDO par doob666
AUTOJOIN HTABLE MULTISERVER par doob666
TCL - AJOUT SUPPRESSION DE LOGS par Atok

Commentaires et avis

Commentaire de NaNo45 le 07/12/2003 15:52:14

^^

Commentaire de ReMi34 le 07/12/2003 15:59:16

Pas mal :) 6/10

Commentaire de Kolibot le 07/12/2003 18:09:52

Je ne comprend pas pourquoi tu as surchagé en condition une partie de ton code :
on *:dialog:antipv:*:*:{
    if ($devent == sclick) && ($did(10).state == 1) { set %enreg on }
    if ($devent == sclick) && ($did(10).state == 0) { set %enreg off }
    if ($devent == sclick) && ($did(3).state == 1) { set %antipvclose on }
    if ($devent == sclick) && ($did(3).state == 0) { set %antipvclose off }
    if ($devent == sclick) && ($did(7).state == 1) { .enable #antipv }
    if ($devent == sclick) && ($did(8).state == 1) { .disable #antipv }
    if ($devent == sclick) && ($did(4).state == 1) { .set %antipvmess on }
    if ($devent == sclick) && ($did(4).state == 0) { .set %antipvmess off }
    if ($devent == init) && ($group(#antipv) == on) { did -c antipv 7 }
    if ($devent == init) && ($group(#antipv) == off) { did -c antipv 8 }
    if ($devent == init) && (%antipvmess == on) { did -c antipv 4 }
    if ($devent == init) && (%antipv != $null) { did -ra antipv 6 %antipv }
    if ($devent == init) && (%antipvclose == on) { did -c antipv 3 }
    if ($devent == init) && (%enreg == on) { did -c antipv 10 }
    if ($devent == sclick) && ($did(15).state == 1) { set %suppr on }
    if ($devent == sclick) && ($did(15).state == 0) { set %suppr off }
    if ($devent == init) && (%suppr == on) { did -c antipv 15 }
}

Essai de faire comme ça :
on *:dialog:antipv:*:*:{
  if $devent == sclick {
    if $did(10).state == 1 { %enreg = on }
    if $did(10).state == 0 { %enreg = off }
    if $did(3).state == 1 { %antipvclose = on }
    if $did(3).state == 0 { %antipvclose = off }
    if $did(7).state == 1 { .enable #antipv }
    if $did(8).state == 1 { .disable #antipv }
    if $did(4).state == 1 { %antipvmess = on }
    if $did(4).state == 0 { %antipvmess = off }
    if $did(15).state == 1 { %suppr = on }
    if $did(15).state == 0 { %suppr = off }
  }
  if $devent == init {
    if $group(#antipv) == on { did -c antipv 7 }
    if $group(#antipv) == off { did -c antipv 8 }
    if %antipvmess == on { did -c antipv 4 }
    if %antipv { did -ra antipv 6 %antipv }
    if %antipvclose == on { did -c antipv 3 }
    if %enreg == on { did -c antipv 10 }
    if %suppr == on { did -c antipv 15 }
  }
}
Cela serait beaucoup plus judicieux

Commentaire de Kolibot le 07/12/2003 18:20:51

Et puis je le sens pas ce script, je trouve pas qu'il soit particulièrement bien codé, il n'est pas structuré de manière optimisé, comme si tu l'avais fait à l'arrache c bizarre... je mets 5/10

Commentaire de Majid000 le 19/05/2007 16:39:20

Je ne comprend pas pourquoi tu as surchagé en condition une partie de ton code :
on *:dialog:antipv:*:*:{
    if ($devent == sclick) && ($did(10).state == 1) { set %enreg on }
    if ($devent == sclick) && ($did(10).state == 0) { set %enreg off }
    if ($devent == sclick) && ($did(3).state == 1) { set %antipvclose on }
    if ($devent == sclick) && ($did(3).state == 0) { set %antipvclose off }
    if ($devent == sclick) && ($did(7).state == 1) { .enable #antipv }
    if ($devent == sclick) && ($did(8).state == 1) { .disable #antipv }
    if ($devent == sclick) && ($did(4).state == 1) { .set %antipvmess on }
    if ($devent == sclick) && ($did(4).state == 0) { .set %antipvmess off }
    if ($devent == init) && ($group(#antipv) == on) { did -c antipv 7 }
    if ($devent == init) && ($group(#antipv) == off) { did -c antipv 8 }
    if ($devent == init) && (%antipvmess == on) { did -c antipv 4 }
    if ($devent == init) && (%antipv != $null) { did -ra antipv 6 %antipv }
    if ($devent == init) && (%antipvclose == on) { did -c antipv 3 }
    if ($devent == init) && (%enreg == on) { did -c antipv 10 }
    if ($devent == sclick) && ($did(15).state == 1) { set %suppr on }
    if ($devent == sclick) && ($did(15).state == 0) { set %suppr off }
    if ($devent == init) && (%suppr == on) { did -c antipv 15 }
}

Essai de faire comme ça :
on *:dialog:antipv:*:*:{
  if $devent == sclick {
    if $did(10).state == 1 { %enreg = on }
    if $did(10).state == 0 { %enreg = off }
    if $did(3).state == 1 { %antipvclose = on }
    if $did(3).state == 0 { %antipvclose = off }
    if $did(7).state == 1 { .enable #antipv }
    if $did(8).state == 1 { .disable #antipv }
    if $did(4).state == 1 { %antipvmess = on }
    if $did(4).state == 0 { %antipvmess = off }
    if $did(15).state == 1 { %suppr = on }
    if $did(15).state == 0 { %suppr = off }
  }
  if $devent == init {
    if $group(#antipv) == on { did -c antipv 7 }
    if $group(#antipv) == off { did -c antipv 8 }
    if %antipvmess == on { did -c antipv 4 }
    if %antipv { did -ra antipv 6 %antipv }
    if %antipvclose == on { did -c antipv 3 }
    if %enreg == on { did -c antipv 10 }
    if %suppr == on { did -c antipv 15 }
  }
}
Cela serait beaucoup plus judicieux

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,468 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales