dialog aw {
  title "Funny Aways"
  size -1 -1 300 280
  option pixels
  box "Position", 1, 10 5 280 80
  button "Ok", 2, 10 257 280 20, ok
  radio "[Absent]", 3, 20 20 60 20
  radio "[OQP]", 4, 20 40 60 20
  radio "[Site]", 5, 20 60 60 20
  radio "[Mange]", 6, 90 20 60 20
  radio "[Games]", 7, 90 40 60 20
  radio "[Dreams]", 8, 90 60 60 20
  radio "Autre", 9, 160 20 50 20
  edit "", 10, 210 20 60 20, autohs
  box "Away Message", 11, 10 100 280 84
  text "Message d'Absence :", 12, 20 163 100 15
  check "Activé pour les pv", 13, 20 115 120 20
  check "Away ferme pvs", 100, 151 140 100 20
  edit "", 14, 150 160 120 20, autohs
  check "Activé sur les Chans", 15, 20 140 120 20

  button "", 22, 170 60 100 20
  icon 16, 12 187 276 68,  images\icones\away.jpg, 0, noborder center
}

on *:dialog:aw:sclick:3: //Set %aw_absent on | //Set %aw_oqp off | //Set %aw_site off | //Set %aw_mange off | //Set %aw_Games off | //Set %aw_dreams off | //Set %aw_autres off
on *:dialog:aw:sclick:4: //Set %aw_oqp on | //Set %aw_absent off | //Set %aw_site off | //Set %aw_mange off | //Set %aw_Games off | //Set %aw_dreams off | //Set %aw_autres off
on *:dialog:aw:sclick:5: //Set %aw_site on | //Set %aw_absent off | //Set %aw_oqp off | //Set %aw_mange off | //Set %aw_Games off | //Set %aw_dreams off | //Set %aw_autres off
on *:dialog:aw:sclick:6: //Set %aw_mange on | //Set %aw_absent off | //Set %aw_oqp off | //Set %aw_site off | //Set %aw_Games off | //Set %aw_dreams off | //Set %aw_autres off
on *:dialog:aw:sclick:7: //Set %aw_Games on | //Set %aw_absent off | //Set %aw_oqp off | //Set %aw_site off | //Set %aw_mange off | //Set %aw_dreams off | //Set %aw_autres off
on *:dialog:aw:sclick:8: //Set %aw_dreams on | //Set %aw_absent off | //Set %aw_oqp off | //Set %aw_site off | //Set %aw_mange off | //Set %aw_Games off | //Set %aw_autres off
on *:dialog:aw:sclick:9: //Set %aw_autres on | //Set %aw_absent off | //Set %aw_oqp off | //Set %aw_site off | //Set %aw_mange off | //Set %aw_Games off | //Set %aw_dreams off 
on *:dialog:aw:sclick:2:{ //set %aw_raison $did(aw,10) | //set %aw_mess $did(aw,14)  }
on *:dialog:aw:sclick:100:{
  if (%aw_ferme == $null) { //set %aw_ferme on | //did -c aw 100 | halt }
  if (%aw_ferme == on) { //set %aw_ferme off | halt }
  if (%aw_ferme == off) { //set %aw_ferme on | //did -c aw 100 | halt }
}
on *:dialog:aw:sclick:13:{
  if (%aw_pv == $null) { //set %aw_pv on | //did -c aw 13 |  halt }
  if (%aw_pv == on) { //set %aw_pv off |  halt }
  if (%aw_pv == off) { //set %aw_pv on | //did -c aw 13  }

}
on *:dialog:aw:sclick:15:{
  if (%aw_chan == $null) { //set %aw_chan on | //did -c aw 15 | halt }
  if (%aw_chan == on) { //set %aw_chan off |  halt }
  if (%aw_chan == off) { //Set %Aw_chan on | //did -c aw 15 } 
} 
on *:dialog:aw:sclick:22:{ 
  if (%aw_action == revenir) { //set %aw_action Se mettre Away | .nick %aw_nick | .away | //did -ca aw 22 %aw_action | halt }
  if (%aw_action == Se mettre Away) { 
    if (%aw_absent == on) { //set %aw_nick $me | //set %aw_nickaw  $me $+ [absent]  | .nick  %aw_nickaw  | .away "absent" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
    if (%aw_oqp == on) { //set %aw_nick $me | //set %aw_nickaw $me $+ [oqp] | .nick %aw_nickaw | .away "oqp" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
    if (%aw_site == on) { //set %aw_nick $me | //set %aw_nickaw $me $+ [site] | .nick %aw_nickaw | .away "site" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
    if (%aw_mange == on) { //set %aw_nick $me | //set %aw_nickaw $me $+ [mange] | .nick %aw_nickaw | .away "mange" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
    if (%aw_Games == on) { //set %aw_nick $me | //set %aw_nickaw $me $+ [Games] | .nick %aw_nickaw | .away "Games" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
    if (%aw_dreams == on) { //set %aw_nick $me | //set %aw_nickaw $me $+ [dreams] | .nick %aw_nickaw | .away "dreams" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } 
  if (%aw_autres == on) {  //set %aw_raison $did(aw,10) | set %aw_nick $me | //set %aw_nickaw $me $+ [ %aw_raison ]  | .nick %aw_nickaw | .away "Raison" | //set %aw_action Revenir | //did -ca aw 22 %aw_action | halt } }
} 


on *:dialog:aw:init:*:{
  // did -ca aw 22 %aw_action 
  //did -ca aw 10 %aw_raison
  //did -ca aw 14 %aw_mess
  if (%aw_ferme == on) { //did -c aw 100 }
  if (%aw_pv == on) { //did -c aw 13  }
  if (%aw_chan == on) { //did -c aw 15 }
  if (%aw_absent == on) { //did -c aw 3 }
  if (%aw_oqp == on) //did -c aw 4 
  if (%aw_site == on) //did -c aw 5 
  if (%aw_mange == on) //did -c aw 6 
  if (%aw_Games == on) //did -c aw 7 
  if (%aw_dreams == on) //did -c aw 8 
  if (%aw_autres == on) //did -c aw 9 
}


on 1:TEXT:*:#:{
  if ($away == $true) {
    if (%aw_chan == on) { 
      if ($me isin $1-) { //set %awchan $chan | /msg %awchan 4 Desole 2 $nick 4 :  %aw_mess  | halt }
} } }

on 1:text:*:?:{
  if ($away == $true) { { if (%aw_pv == on) { /msg $nick  2 $nick 4  :  %aw_mess 1«14« 7L14ost Souls 7® 14»1»  } }
    if (%aw_ferme == on) { /close -m$nick }
} }
