Max's Away System v1.3

By MaxEvans on Dec 18, 2011

This is a simple away system dialog I whipped up in about ten minutes (written entirely by me) when I couldn't get an alias to work the way I wanted it to. It works flawlessly, and I plan on adding more to it when I can. But this is the simple first version. Just type /awaysys to use it. =)

Update 1.2: Made a couple of changes, now shows the away reason variable in parentheses in both the /me command and query replies. Also when you click "I'm back" it removes the away reason from the edit box on the dialog. More to come soon.

Update 1.3: Changed the edit boxes to allow longer nicknames and longer away reasons. Also removes the nicknames when you click "unset."

Screenshot:
Image

;~~~~~~~~~~~~~~~~~~~~~~~~~;
; Max's Away System v1.3  ;
;      By: Max Evans      ;
;    irc.geekshed.net     ;
;#GeekUnderground & #Chris;
;~~~~~~~~~~~~~~~~~~~~~~~~~;

dialog Away {
  title "Max's Away System v1.3"
  size -1 -1 160 104
  option dbu
  edit %annick, 1, 14 22 60 10, autohs center
  edit %awaynick, 2, 82 22 60 10, autohs center
  box Nickname Settings - %annick, 3, 7 3 146 45
  button "Set", 4, 53 35 23 9
  box "Away Reason", 5, 7 49 146 39
  text "Normal Nick", 6, 26 13 38 8, center
  text "Away Nick", 7, 102 13 25 8
  edit %areason, 8, 11 62 137 10, autohs center
  button "Go Away", 9, 53 75 28 9
  button "Unset", 10, 82 35 23 9
  button "I'm Back", 11, 85 75 28 9
  button "Close", 12, 68 90 29 9, ok cancel
}

on *:Dialog:Away:init:*: {
  did $iif(%annick,-m,-n) $dname 1
  did $iif(%awaynick,-m,-n) $dname 2
  did $iif(%areason,-m,-n) $dname 8
}

on *:Dialog:Away:sclick:*: {
  if ($did == 4) { %annick = $did(Away,1) | %awaynick = $did(Away,2) | did -m Away 1,2 }
  if ($did == 10) { unset %annick %awaynick | did -n Away 1,2 | did -r Away 1,2 }
  if ($did == 9) { set %areason $did(Away,8) | did -m Away 8 | away }
  if ($did == 11) { unset %areason | did -n Away 8 | did -r Away 8 | back }
}

alias awaysys {
  dialog -m Away Away
}

alias away {
  nick %awaynick
  set %away on
  me is now currently away. ( $+ %areason $+ )
}

alias back {
  nick %annick
  unset %away
  me is back from being away.
}

on *:TEXT:*:?: {
  if (%away == on) {
    msg $nick Sorry, $nick $+ , I am currently away. ( $+ %areason $+ )
  }
}

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.