;=================== away ==================
alias xaway {
  dialog -m xaway xaway
  if ($dialog(xaway) != $null) {
    set %stemp 2
    :start
    inc %stemp 2
    dialog -s xaway $dialog(xaway).x $dialog(xaway).y %stemp 104
    if (%stemp >= 285) { goto done }
    goto start 
    :done
  }
}
dialog xaway {
  title "PrimitiveX MODE AWAY SYSTAM"
  size 230 194 285 103
  option pixels
  edit "", 1, 78 10 201 22, autohs
  text "Away Reason:", 3, 8 13 70 18
  button Away, 4, 8 61 66 21, flat
  button Back, 5, 76 61 66 21, flat
  box "", 12, 1 -7 285 110
  button Close, 13, 212 61 66 21, flat ok
  edit 600, 14, 78 31 43 22, autohs
  text "msg every:", 15, 8 35 69 16
  text Sec, 2, 123 35 19 17
  text "PrimitiveX mirc version 1.3 X ", 6, 76 86 136 15, disable
  button Advertise, 7, 144 61 66 21, flat
  edit "", 9, 179 31 100 22
  box "", 10, 5 -2 277 59
  box "", 11, 5 51 277 35
  text Nick:, 18, 153 35 26 17
}
on *:dialog:xaway:sclick:4: { set %awayr $did(1) | set %awaytime $ctime | awayx }
on *:dialog:xaway:sclick:5: { backx }
on *:dialog:xaway:sclick:7: { /ame %MetalXx }
on *:dialog:xaway:*:*: {
  if ($devent == init) {
    .did -ra xaway 9 %anick
  }
  if ($devent == sclick) {
    %anick = $did(9)
    if ($did == 13) { .timer -mo 1 1 fade_out $dname | halt }
  }
}
alias awayx {
  set %timermsg $did(14)
  set %timewentaway $time(h:nntt)
  away $sleb(Awa) $+ $sleb(Y) : %awayr : $sleb(time) : $time(hh.nntt) $x2)    
  ame $sleb(Start,Awa) $+ $sleb(Y) : %awayr : $sleb(time) : $time(hh.nntt) $x2    
  timeraway 0 %timermsg idleaway
  set %nickd $me
  nick $did(9)
}
alias idleaway { ame $sleb(Awa) $+ $sleb(Y) : %awayr : $sleb(time) : $time(hh.nntt) $x2 }
alias backx {
  away
  ame $sleb(Back,from) : %awayr : $sleb(time) : $time(hh.nntt) $x2  
  timeraway off
  unset %awayr
  unset %timermsg
  unset %awaytime
  unset %timewentaway
  nick %nickd 
}
;=================== end ==================
