Simple away system for multiple networks

By RusselB on Jan 01, 2006

Allows you to mark yourself away on one or more networks from a single dialog. Network names show in one of two lists.

The OK & Cancel buttons aren't really necessary, as the code marks you away (or not away?) upon selection of the network in the dialog.

Just right click anywhere and select Away

Nick change added

dialog Away {
  title "Away"
  size -1 -1 115 85
  option dbu
  text "Away", 10, 60 5 50 10, center
  text "Active", 20, 5 5 50 10, center
  list 30, 5 15 50 50, size
  list 40, 60 15 50 50, size
  button "OK", 50, 5 70 50 10, ok default
  button "Cancel", 60, 60 70 50 10, cancel
}
menu * {
  .Away: .dialog -md Away Away
}
on *:dialog:Away:init:*:{
  var %networks = $scon(0)
  var %a = 1
  while %a <= %networks {
    did -a $dname $iif($scon(%a).away == $false,30,40) $scon(%a).network
    inc %a
  }
}
on *:dialog:Away:sclick:30,40:{
  did -a $dname $iif($did == 30,40,30) $did($dname,$did).seltext
  set %network $did($dname,$did).seltext
  did -d $dname $iif($did == 30,30,40) $did($dname,$did).sel
  var %c = 1 
  while $scon(%c).network { 
    if ($v1 == %network) {
      if $did == 30 {
        .scon %c nick $+($me,|AFK) | away $$?="Away Message"
      }
      else {
        .scon %c nick $left($me,-4) | away
      }
      echo -a $iif($did == 30,Now,No longer) away on $scon(%c).network
      var %c = $scon(0)
    } 
    inc %c 
  }
}

Comments

Sign in to comment.
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.