Système d'Absence

By ZeleSansLogique on Aug 23, 2009

Voici un script pour se mettre en absence créé complètement par Napa182. Je l'ai traduit de l'anglais vers le français. Je n'assume point de mérite de l'avoir créé. Merci à Napa182.

Vous n'avez qu'à cliquer à droite sur l'écran pour afficher le bouton "Système d'Absence." Après y avoir cliqué, un écran apparaitra posant des questions, remplissez-y selon vos préférences.

Abréviations:

Ebt=Etablir
Enlvr=Enlever
Ajt=Ajouter
Sup=Supprimer
Abst=Absent(e)

dialog asy {
  title "Système d'Absence"
  size -1 -1 172 159
  option dbu
  box "Etablir Pseudo d'abs", 1, 1 1 57 34
  edit "", 2, 4 12 50 9, autohs
  button "Etb", 3, 5 23 20 9, flat
  button "Enlvr", 4, 34 23 20 9, flat
  box "Etablir Pseudo de rtr", 5, 62 1 57 34
  edit "", 6, 65 12 50 9, autohs
  button "Etb", 7, 65 23 20 9, flat
  button "Enlvr", 8, 95 23 20 9, flat
  box "Ajt/Sup Raison", 9, 1 36 118 35
  edit "", 10, 4 45 111 9, autohs
  button "ajt", 11, 4 56 54 10, flat
  button "sup", 12, 61 56 54 10, flat
  box "Abs Auto.", 13, 121 1 50 70
  radio "Aucun", 14, 124 12 25 10, flat
  radio "30 Minutes", 15, 124 23 37 10, flat
  radio "60 Minutes", 16, 124 34 37 10, flat
  radio "90 Minutes", 17, 124 45 37 10, flat
  radio "120 Minutes", 18, 124 56 40 10, flat
  box "Liste de Rsns", 19, 1 72 170 60
  list 20, 4 81 163 46, size vsbar
  box " Abst/Retour", 21, 1 133 61 25
  button "Abst", 22, 4 143 25 10, flat
  button "Retour", 23, 34 143 25 10, flat
  box "Slgner Notific.", 24, 64 133 43 25
  check "Act", 25, 69 143 17 10, flat
  check "Dés", 26, 88 143 17 10, flat
  box "Date/Heure", 27, 108 133 63 25
  text "", 28, 112 143 55 8
}
menu menubar,channel {
  .Système d'Absence { dialog $iif($dialog(asy),-v,-md) asy asy }  
}
alias -l asytime { did -ra asy 28 $time(mm.dd.yy h:nn:ss tt) }
alias -l auto.away.check {
  if ($ceil($calc($nick($active,$me).idle / 60)) == $iif(%t.30,30,$iif(%t.60,60,$iif(%t.90,90,$iif(%t.120,120,))))) && (!$away) {
    amsg 14,1[12,1»0,1:: Absence Auto. Après ::12,1«14,1]14,1[12,1»0,1:: $iif(%t.30,30,$iif(%t.60,60,$iif(%t.90,90,$iif(%t.120,120,)))) Minutes ::12,1«14,1]
    .away Absence Auto. Après $iif(%t.30,30,$iif(%t.60,60,$iif(%t.90,90,$iif(%t.120,120,)))) Minutes
    nick %asyanick
  }
}
alias asaway {
  if (!$away && %asyanick && %asybnick) {
    nick %asyanick
    amsg 14,1[12,1»0,1:: Je suis actuellement absent(e) ::12,1«14,1]14,1[12,1»0,1::Raison: $1- ::12,1«14,1]14,1[12,1»0,1:: Parti(e) à ::12,1«14,1]14,1[12,1»0,1:: $time(h:nn tt) ::12,1«14,1]
    .away $1-
  }
}
alias asaback {
  if ($away && %asyanick && %asybnick) {
    amsg 14,1[12,1»0,1:: Je suis de retour de ::12,1«14,1]14,1[12,1»0,1::Raison: $awaymsg ::12,1«14,1]14,1[12,1»0,1:: Absent(e) pendant ::12,1«14,1]14,1[12,1»0,1:: $duration($awaytime) ::12,1«14,1]
    nick %asyanick
    .away
  }
}
on *:load: { 
  echo 12 -a You Have Just Loaded Napa182's Away System
  echo 12 -a A Script0rs Inc. Production 
  echo -a 14,1(14,1¯15,1¯0,1¯0,1º $+($chr(171),$chr(164),$chr(88),$chr(167),$chr(199),$chr(174),$chr(238),$chr(254),$chr(116),$chr(48),$chr(174),$chr(167),$chr(88),$chr(164),$chr(187)) º0,1¯15,1¯14,1¯) $+ $chr(153)
  set %t.none on
}
on *:DIALOG:asy:close:0:{ .timerasytime off }
on *:DIALOG:asy:init:0:{ 
  did -a $dname 28 $time(mm.dd.yy h:nn:ss tt) 
  .timerasytime 0 1 asytime
  if ($away) { did -b $dname 22 | did -e $dname 23,25,26 }
  if (!$away) { did -e $dname 22 | did -b $dname 23,25,26 }
  if (%asyanick) { did -a $dname 2 %asyanick }
  if (%asybnick) { did -a $dname 6 %asybnick }
  did -c $dname $iif(%t.none,14,$iif(%t.30,15,$iif(%t.60,16,$iif(%t.90,17,$iif(%t.120,18,))))) 
  $iif(%highlite,did -c $dname 25,did -c $dname 26)
  if $read(awayreason.txt) { 
    var %x = 1
    while ( %x <= $lines(awayreason.txt)) {
      did -a $dname 20 $read(awayreason.txt,%x)
      inc %x
    }
  }
}
on *:DIALOG:asy:sclick:*:{
  if ($did == 14) { unset %t.* | set %t.none on | .timert* off }
  if ($did == 15) { unset %t.* | set %t.30 on | .timerta 0 1 auto.away.check }
  if ($did == 16) { unset %t.* | set %t.60 on | .timertb 0 1 auto.away.check }
  if ($did == 17) { unset %t.* | set %t.90 on | .timertc 0 1 auto.away.check }
  if ($did == 18) { unset %t.* | set %t.120 on | .timertd 0 1 auto.away.check }
  if ($did == 25) { set %highlite on | did -u $dname 26 }
  if ($did == 26) { unset %highlite | did -u $dname 25 }
  if ($did == 3) { $iif(!$did(2).text,noop $input(Choisissez un Pseudo d'Absence,uwo,Error!),set %asyanick $did(2).text) }
  if ($did == 4) { $iif(!$did(2).text,noop $input(Choisissez un Pseudo d'Absence,uwo,Error!),unset %asyanick $did(2).text) | did -r $dname 2 }
  if ($did == 7) { $iif(!$did(6).text,noop $input(Choisissez un Pseudo de Retour,uwo,Error!),set %asybnick $did(6).text) }
  if ($did == 8) { $iif(!$did(6).text,noop $input(Choisissez un Pseudo de Retour,uwo,Error!),unset %asybnick $did(6).text) | did -r $dname 6 }
  if ($did == 11) { 
    if (!$did(10).text) { noop $input(Choisissez une Raison,uwo,Error!) }
    else {
      .write awayreason.txt $did(10).text 
      did -r $dname 10,20
      var %x = 1
      while ( %x <= $lines(awayreason.txt)) {
        did -a $dname 20 $read(awayreason.txt,%x)
        inc %x
      }
    }
  }
  if ($did == 12) { 
    if (!$did(20).seltext) { noop $input(Choisissez une Raison,uwo,Error!) }
    else {
      var %dawayreason $read(awayreason.txt,w,$did(20).seltext) 
      if (%dawayreason == $did(20).seltext) { 
        write -dl [ $+ [ $readn ] ] awayreason.txt 
        did -r $dname 20 
        var %x = 1
        while ( %x <= $lines(awayreason.txt)) {
          did -a $dname 20 $read(awayreason.txt,%x)
          inc %x
        }
      }
    }
  }
  if ($did == 22) {
    if (!%asyanick || !%asybnick) {
      noop $iif(!%asyanick,$input(Choisissez un Pseudo d'Absence,uwo,Error!),$iif(!%asybnick,$input(Choisissez un Pseudo de Retour,uwo,Error!)))
    }
    elseif (%asyanick && %asybnick && !$did(20).seltext) {
      nick %asyanick
      did -b $dname 22
      did -e $dname 23,25,26
      .away none
      amsg 14,1[12,1»0,1:: Je suis actuellement absent ::12,1«14,1]14,1[12,1»0,1::Raison: Aucune ::12,1«14,1]14,1[12,1»0,1:: Parti(e) à ::12,1«14,1]14,1[12,1»0,1:: $time(h:nn tt) ::12,1«14,1]
    }
    elseif (%asyanick && %asybnick && $did(20).seltext) {
      nick %asyanick
      did -b $dname 22
      did -e $dname 23,25,26
      .away $did(20).seltext
      amsg 14,1[12,1»0,1:: Je suis actuellement absent ::12,1«14,1]14,1[12,1»0,1::Raison: $did(20).seltext ::12,1«14,1]14,1[12,1»0,1:: Parti(e) à ::12,1«14,1]14,1[12,1»0,1:: $time(h:nn tt) ::12,1«14,1]
    }
  }
  if ($did == 23) {
    nick %asybnick
    amsg 14,1[12,1»0,1:: Je suis de retour de ::12,1«14,1]14,1[12,1»0,1::Raison: $awaymsg ::12,1«14,1]14,1[12,1»0,1:: Absent pendant ::12,1«14,1]14,1[12,1»0,1:: $duration($awaytime) ::12,1«14,1]
    did -e $dname 22
    did -b $dname 23,25,26
    unset %highlitecheck.*
    .away
  }
}
on *:TEXT:*:#:{
  if (%highlite && $away) {
    if (%asyanick isin $1- || %asybnick isin $1-) { 
      inc $+(%,highlitecheck,.,$nick)
      if ($($+(%,highlitecheck,.,$nick),2) = 1) { .notice $nick  14,1[12,1» 0,1::C'est une réponse finale:: Je suis absent au moment :Raison:12,1 $awaymsg 0,1:Absent pendant:12,1 $duration($awaytime) 12,1«14,1] | window @away | aline @away $nick écrit votre pseudo à $time(h:nn:tt) sur $chan et dit: $1- }
      if ($($+(%,highlitecheck,.,$nick),2) >= 2) { window @away | aline @away $nick écrit votre pseudo $time(h:nn:tt) sur $chan et dit: $1- }
    }
  }
}
on *:input:*:{
  if (%t.30 || %t.60 || %t.90 || %t.120) {
    if ($away) {
      amsg 14,1[12,1»0,1:: Je suis de retour de ::12,1«14,1]14,1[12,1»0,1::Raison: $awaymsg ::12,1«14,1]14,1[12,1»0,1:: Absent pendant ::12,1«14,1]14,1[12,1»0,1:: $duration($awaytime) ::12,1«14,1]
      nick %asybnick
      unset %highlitecheck.*
      .away
    }
  }

Comments

Sign in to comment.
GlobalAnomaly   -  Aug 23, 2009

That's a relief :P

 Respond  
ZeleSansLogique   -  Aug 23, 2009

I posted it for people who want to use a French script. I messaged the original writer telling him that if he wants it taken down that I would. I did a lot of work translating though, so I think I deserve to post it :p But thank you so much for your comment, and your French is understandable.

 Respond  
GlobalAnomaly   -  Aug 23, 2009

Parler en anglais s'il vous plaît. Vous êtes plus susceptible d'obtenir une réponse décente. ainsi.. pourquoi poster un script fait par une autre personne?

Sorry, I don't normally speak French.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.