Jarod's away system

Contenu du snippet

un away system très sipmle et cool

Source / Exemple :


On 1:LOAD:{ 
  if ($version < 5.6) { echo 4 -se >> Erreur! ce système away ne fonctionne que sur des versions de mIRC de 5.6 et + et non sur sur mIRC $version $+ . | unload -rs $nopath($script) }
  else { .set %awaymode Back | .enable #awaypager | .enable #awaylogging | .enable #awaynotices | .set %awaysystem.log Off
    if (%awaysystemlog.log == $null) { .set %awaysystemlog.log $shortfn($logdir) $+ awaysys.log }
    awaysys.config
  }
}
on 1:START:{ 
  if (%awaymode != Back) { echo 4 -se >> Vs étiez considéré away ou une patente de même. On revient au mode normal. | .set %awaymode Back | .unset %oldnick | awaystatus.compare | if (%awaysystem.log == On) { write %awaysystemlog.log 6>> remis au mode normal @ $time(HH:nn:ss) $date(dd/mm/yyyy) | write %awaysystemlog.log - } }
  if (%awaysystemlog.log == $null) { echo 4 -se >> Le log des away est à reconfigurer. Appliquer à $logdir | .set %awaysystemlog.log $shortfn($logdir) $+ awaysys.log }
}
on 1:CONNECT:{ if (%awaymode == Away) { echo 4 -se >> Vs étiez considéré away ou une patente de même. On revient au mode normal. | away %awaymsg | .timerTemp 1 5 setaway.disp } }
alias -l setaway.disp { if ($chan(0) > 0) { ame est pas là (12Raison:4 %awaymsg $+ ) depuis %awayclock $+ . AwayPager est $group(#awaypager).status $+ , AwayLog est $group(#awaylogging).status | .set %awaymode Away | .timerAway 0 2700 ame est toujours away (12Raison:4 %awaymsg $+ ) depuis %awayclock $+ . AwayPager est $group(#awaypager).status $+ , AwayLog est $group(#awaylogging).status } }
alias -l setback.disp { if ($chan(0) > 0) { ame est revenu (12Retour de:4 %awaymsg $+ ) parti pendant $duration($calc(%awayback - %awaytime)) | disable #offraw301 | enable #cancelaway  } }
alias -l setaway { 
  .set %awaymode Away
  if (%awaysystem.log == On) { write %awaysystemlog.log - | write %awaysystemlog.log 6>> Déclaré Away @ $time(HH:nn:ss) $date(dd/mm/yyyy) }
  if (%awaynick != $null) { set %oldnick $me | .set %awaytime $ctime | away %awaymsg | nick %awaynick | .set %awayclock $time(h:nn:ss tt) | setaway.disp }
  else { .set %awaytime $ctime | away %awaymsg | .set %awayclock $time(h:nn:ss tt) | setaway.disp }
  tbar
}
alias -l setback {
  if (%awaymode == Back) { echo 4 -ae >> Fait longtemps que tu es revenu tsé :)) }
  else {
    if (%awaysystem.log == On) && (%awaymode == Away) { write %awaysystemlog.log 6>> Revenu en mode normal @ $time(HH:nn:ss) $date(dd/mm/yyyy) | write %awaysystemlog.log - }
    if ($server == $null) && (%awaymode == Away) { .set %awaymode Back | echo 4 -ae >> Revenu en mode normal }   
    if (%awaymode == Away) && (%oldnick != $null) && ($server != $null) { .timerAway off | .set %awayback $ctime | nick %oldnick | .set %awaymode Back | away | setback.disp | .unset %oldnick }
    if (%awaymode == Away) && ($server != $null) { .timerAway off | .set %awayback $ctime | .set %awaymode Back | away | setback.disp }
    .unset %awaymsg
    .unset %awaytime
    .unset %awayback
    .unset %awaytime
    .unset %awayclock
    awaystatus.compare
    tbar
  }
}
alias -l tbar { 
  if (%awaymode == Away) { titlebar - Tu es maintenant away depuis %awayclock }
  else { titlebar }
}
#awaypager on
ctcp *:PAGE:{ 
  if ($nick != $me) { 
    .ctcpreply $nick PAGE Ton page a été enregistré!
    if (%awaypager.snd != $null) { .splay %awaypager.snd }
    window -g2 @AwayPager
    aline -p @AwayPager $time(HH:nn:ss) $date(dd/mm/yyyy) 4Page:12 $nick $+ :  $2-
    if (%awaysystem.log == On) { write %awaysystemlog.log $time(HH:nn:ss) $date(dd/mm/yyyy) 4Page:12 $nick $+ :  $2- }
  }
}
#awaypager end
#awaylogging on
on *:TEXT:*:?:{
  if (%awaymode == Away) && ($nick != $me) { 
    window -g1 @AwayLog
    if (%awaylog.snd != $null) { .splay %awaylog.snd }
    if (%awaysystem.log == On) { write %awaysystemlog.log  $time(HH:nn:ss) $date(dd/mm/yyyy) Message: <4 $+ $nick $+ > $1- }
    aline -p @AwayLog $time(HH:nn:ss) $date(dd/mm/yyyy) Message: <4 $+ $nick $+ > $1-
    close -m $nick
    .msg $nick Ça a l'air que je ne suis pas à l'écran alors ton message est enregistré. 
    if ($group(#awaypager).status == on) { .msg $nick Si ton message est urgent call le 911 ou tape 4/ctcp $me PAGE <ton beau p'tit message> }
  }
}
on *:TEXT:*:#:{
  if (%awaymode == Away) && ($me isin $parms) { 
    window -g1 @AwayLog
    if (%awaylog.snd != $null) { .splay %awaylog.snd }
    if (%awaysystem.log == On) { write %awaysystemlog.log  $time(HH:nn:ss) $date(dd/mm/yyyy) 13Message: <3 $+ $chan $+ 12\4 $+ $nick $+ > $1- }    
    aline -p @AwayLog $time(HH:nn:ss) $date(dd/mm/yyyy) 13Message: <3 $+ $chan $+ 12\4 $+ $nick $+ > $1-
    close -m $nick
    .msg $nick Tu es dans ton jour de chance haha ton message est enregistré. (pars en courant à Loto-Québec)
    if ($group(#awaypager).status == on) { .msg $nick Si ton message est urgent call le 911 ou tape 4/ctcp $me PAGE <ton beau p'tit message> }
  }
}
#awaylogging end
#awaynotices on
on *:NOTICE:*:*:{
  if (%awaymode == Away) && ($nick != $me) && ($group(#awaylogging).status == on) { 
    window -g1 @AwayLog
    if (%awaylog.snd != $null) { .splay %awaylog.snd }
    if (%awaysystem.log == On) { write %awaysystemlog.log  $time(HH:nn:ss) $date(dd/mm/yyyy) Notice: 5- $+ $nick $+ - $1- }
    aline -p @AwayLog $time(HH:nn:ss) $date(dd/mm/yyyy) Notice: 5- $+ $nick $+ - $1-
  }
}
#awaynotices end
menu @AwayLog,@AwayPager {
  Effacer la fenetre:clear
  &Voir les logs du Away:awaysystemlog
  -
  &Configure le sytème Away..:awaysys.config
}
menu channel,menubar,query,status {
  &AwaySystem ( $+ %awaymode mode)
  .Auto_ Away..:goaway
  .Auto_Back..:setback
  .-
  .Configuration..:awaysys.config
  .-
}
menu @AwaySystemLogs {
  Effacer les logs des away:clearawaysystemlog
  -
  Configuration..:awaysys.config
}
alias -l clearawaysystemlog { if ($$?!="Voulez-vous réellement détruire les logs "Away"?" === $true ) { if ($exists(%awaysystemlog.log)) { .remove %awaysystemlog.log | clear @AwaySystemLogs | echo 4 -a >> Les logs d'away sont effacés. } } }
alias -l awaysystemlog {
  clear @AwaySystemLogs
  window -ad @AwaySystemLogs 100 100 650 400
  if ($exists(%awaysystemlog.log)) { loadbuf -p @AwaySystemLogs %awaysystemlog.log }
  else { 
    clear @AwaySystemLogs
    aline -p @AwaySystemLogs 4>> Les logs d'away sont vides
  }
}
alias -l logfolder {
  .set %oldawaysystemlog.log %awaysystemlog.log
  %awaysystemlog.log = $$sdir="Choisir le repertoire pour entreposer les logs des «Away». Le répertoire courant est $nofile(%oldawaysystemlog.log)"
  %awaysystemlog.log = $shortfn(%awaysystemlog.log) $+ awaysys.log
  echo 4 -ae >> Les logs seront conservés dans ' $+ $colour(normal) $+ $nofile(%awaysystemlog.log) $+ 4'
  if ($exists(%oldawaysystemlog.log)) { .timer 1 0 deloldlog }
  else { .unset %oldawaysystemlog.log }
}
alias -l deloldlog {  if ($$?!="Détruire les vieux awaysys.log?" === $true) { .remove %oldawaysystemlog.log | echo 4 -ae >> AwaySystem Logs deleted sucessfully! | .unset %oldawaysystemlog.log } else { .unset %olsawaysystemlog.log } }
alias -l pagersndselect { did -ra awaysysconf 21 $$dir="Choisir le son du Away Pager" *.wav }
alias -l logsndselect { did -ra awaysysconf 26 $$dir="Choisir le son du Away" *.wav }
alias -l asuninstall { if ($$?!="Voulez-vs réellement enlever le  système Away?" === $true) { .unset %away* | .unset %oldnick* | .unset %oldpager.snd | .unset %oldlog.snd | echo 4 -se >> Système Away retiré du script. | did -bm awaysysconf 2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | .unload -rs $nopath($script) } }
alias -l awaysys.config { $dialog(awaysysconf,awaysysconf) }
dialog awaysysconf {
  title "Configuration du système AWAY"
  size -1 -1 320 390
  button "OK", 1, 110 360 60 23, ok
  button "Canceller", 2, 175 360 60 23, cancel default
  button "Enlever", 34, 10 360 60 23
  text "Notice: AwayPager/Log changements non-applicable en mode retour!", 35, 18 340 389 15
  text "[Away Mode]", 36, 240 10 100 20
  text "System Away par Jarod23", 4, 75 10 160 20, center
  box "AwayPager", 5, 40 30 110 50
  radio "Off", 6, 55 50  35 20, group center
  radio "On", 7, 100 50  35 20, center
  box "AwayLog", 8, 170 30 110 60
  radio "Off", 9, 180 50  35 20, group center
  radio "On", 10, 225 50  35 20, center
  check "Log Notices", 33, 200 70 75 16 
  box "AwaySystem Log", 11, 20 90 280 50
  radio "Off", 12, 25 110  35 20, group center
  radio "On", 13, 65 110  35 20, center
  button "Voir", 14, 110 110 40 23, default
  button "Effacer", 15, 155 110 40 23, default
  button "Changer répertoire", 16, 200 110 90 23, default
  box "AwaySystem Sons", 17, 20 150 280 120
  text "AwayPager Sons:", 18, 30 170 280 50
  radio "Non", 19, 25 185  54 20, group center
  radio "Oui", 20, 85 185  54 20, center
  edit "",21, 140 185 90 22, autohs
  button "Change...", 22, 235 185 60 23, default
  text "AwayLog Sound:", 23, 30 220 280 50
  radio "Non", 24, 25 237  54 20, group center
  radio "Oui", 25, 85 237  54 20, center
  edit "",26, 140 237 90 22, autohs
  button "Change...", 27, 235 237 60 23, default
  box "AwayNick", 28, 20 280 280 50
  radio "Non", 29, 25 300  54 20, group center
  radio "Oui", 30, 85 300  54 20, center
  text "Nick:", 32, 145 303 30 20
  edit "",31, 170 300 127 22
}
on *:DIALOG:awaysysconf:init:0: {
  did -ft awaysysconf 1
  if (%awaymode != Away) { did -h awaysysconf 35,36 }
  if ($group(#awaypager).status == on) { did -c awaysysconf 7 }
  if ($group(#awaypager).status == off) { did -c awaysysconf 6 }
  if ($group(#awaylogging).status == on) { did -c awaysysconf 10 }
  if ($group(#awaylogging).status == off) { did -c awaysysconf 9 | did -b awaysysconf 33 }
  if ($group(#awaynotices).status == on) { did -c awaysysconf 33 }
  if (%awaysystem.log == On) { did -c awaysysconf 13 }
  if (%awaysystem.log != On) { did -c awaysysconf 12 | did -b awaysysconf 16 }
  if (%awaypager.snd != $null) { did -c awaysysconf 20 | did -nra awaysysconf 21 %awaypager.snd }
  if (%awaypager.snd == $null) { did -c awaysysconf 19 | did -ma awaysysconf 21 %oldpager.snd | did -b awaysysconf 22 }
  if (%awaylog.snd != $null) { did -c awaysysconf 25 | did -nra awaysysconf 26 %awaylog.snd }
  if (%awaylog.snd == $null) { did -c awaysysconf 24 | did -ma awaysysconf 26 %oldlog.snd | did -b awaysysconf 27 }
  if (%awaynick != $null) { did -c awaysysconf 30 | did -nra awaysysconf 31 %awaynick }
  if (%awaynick == $null) { did -c awaysysconf 29 | did -ma awaysysconf 31 %oldnick1 }
  if (%awaymode == Away) { did -bm awaysysconf 28,29,30,31,32,34 }
}
On *:DIALOG:awaysysconf:sclick:34:{ .timer 1 0 asuninstall }
On *:DIALOG:awaysysconf:sclick:3:{ awaysystemhelp }
On *:DIALOG:awaysysconf:sclick:1:{
  if ($did(6).state == 1) { .disable #awaypager }
  if ($did(7).state == 1) { .enable #awaypager }
  if ($did(9).state == 1) { .disable #awaylogging }
  if ($did(10).state == 1) { .enable #awaylogging }
  if ($did(12).state == 1) { .set %awaysystem.log Off }
  if ($did(13).state == 1) { .set %awaysystem.log On }
  if ($did(19).state == 1) && (%awaypager.snd != $null) { .set %oldpager.snd %awaypager.snd | .unset %awaypager.snd }
  if ($did(20).state == 1) { .set %awaypager.snd $shortfn($did(21).text) }
  if ($did(24).state == 1) && (%awaylog.snd != $null) { .set %oldlog.snd %awaylog.snd | .unset %awaylog.snd }
  if ($did(25).state == 1) { .set %awaylog.snd $shortfn($did(26).text) }
  if ($did(29).state == 1) && (%awaynick != $null) { .set %oldnick1 %awaynick | .unset %awaynick }
  if ($did(30).state == 1) { .set %awaynick $did(31).text }
  if ($did(33).state == 1) { .enable #awaynotices }
  if ($did(33).state == 0) { .disable #awaynotices }
  echo -se 4>> AwaySystem Configuration Saved.
}
On *:DIALOG:awaysysconf:sclick:10:{ did -e awaysysconf 33 }
On *:DIALOG:awaysysconf:sclick:9:{ did -b awaysysconf 33 }
On *:DIALOG:awaysysconf:sclick:12:{ did -b awaysysconf 16 }
On *:DIALOG:awaysysconf:sclick:13:{ did -e awaysysconf 16 }
On *:DIALOG:awaysysconf:sclick:19:{
  did -m awaysysconf 21
  did -b awaysysconf 22
}
On *:DIALOG:awaysysconf:sclick:24:{
  did -m awaysysconf 26
  did -b awaysysconf 27
}
On *:DIALOG:awaysysconf:sclick:20:{
  did -n awaysysconf 21
  did -e awaysysconf 22
}
On *:DIALOG:awaysysconf:sclick:25:{
  did -n awaysysconf 26
  did -e awaysysconf 27
}
On *:DIALOG:awaysysconf:sclick:29:{ did -m awaysysconf 31 }
On *:DIALOG:awaysysconf:sclick:30:{ did -n awaysysconf 31 }
On *:DIALOG:awaysysconf:sclick:14:{ awaysystemlog }
On *:DIALOG:awaysysconf:sclick:15:{ .timer 1 0 clearawaysystemlog }
On *:DIALOG:awaysysconf:sclick:16:{ .timer 1 0 logfolder }
On *:DIALOG:awaysysconf:sclick:22:{ .timer 1 0 pagersndselect }
On *:DIALOG:awaysysconf:sclick:27:{ .timer 1 0 logsndselect }
alias -l goaway { 
  if ($server == $null) { echo 4 -ae >> Tu n'es pas connecté à un serveur irc }
  elseif (%awaymode == Away) { echo 4 -ae >> Tu es déjà away! }
  else { $dialog(awayd,awayd) } 
}
dialog awayd { 
  title "Entrer le mode Away" 
  size -1 -1 300 120 
  text "Message d'Away:", 202, 14 10 100 20 
  edit "", 1, 10 30 280 22, autohs 
  check "Away&Pager on", 2, 10 60 90 16 
  check "Away&Log on", 3, 115 60 80 16, 3state
  button "&OK", 101, 10 86 50 25, OK default 
  button "&Canceller", 102, 70 86 50 25, cancel
  text "(", 105, 170 100 7 20
  check "Pas de log de Notice)", 104, 175 100 119 16, 3state
} 
on *:DIALOG:awayd:init:*:{ 
  if ($group(#awaypager).status == on) { did -c awayd 2 } 
  if ($group(#awaylogging).status == on) { did -c awayd 3 }
  if ($group(#awaynotices).status == off) && ($group(#awaylogging).status == on) { did -cu awayd 3 }
  did -cu awayd 104
}
on *:DIALOG:awayd:sclick:104:{ did -cu awayd 104 }
on *:DIALOG:awayd:sclick:101:{ 
  %awaypager.status = $group(#awaypager).status
  %awaylogging.status = $group(#awaylogging).status
  %awaynotices.status = $group(#awaynotices).status
  if ($did(2).state == 1) { .enable #awaypager }
  if ($did(2).state == 0) { .disable #awaypager }
  if ($did(3).state == 1) { .enable #awaylogging | .enable #awaynotices }
  if ($did(3).state == 0) { .disable #awaylogging | .disable #awaynotices }
  if ($did(3).state == 2) { .enable #awaylogging | .disable #awaynotices }
  if ($did(1).text != $null) { .set %awaymsg $did(1).text }
  disable #cancelaway
  enable #offraw301
  else { .set %awaymsg Away }
  setaway
} 
alias -l awaystatus.compare {
  if (%awaypager.status == on) { .enable #awaypager }
  if (%awaylogging.status == on) { .enable #awaylogging }
  if (%awaynotices.status == on) { .enable #awaynotices }
  if (%awaypager.status == off) { .disable #awaypager }
  if (%awaypager.status == off) { .disable #awaylogging }
  if (%awaynotices.status == off) { .disable #awaynotices }
  .unset %awaypager.status
  .unset %awaylogging.status
  .unset %awaynotices.status
}
on 1:connect:{
  disable #cancelaway
  enable #offraw301
}

Conclusion :


par jarod23

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.