All pastes #966813 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-02 00:34 UTC
rendered paste body
;away
alias afk {
  away $1-
  set %away 50
  set %away.msg $1-
  set %away.nick $mnick
  set %away.time $asctime(hh:nn)
  nick $mnick $+ %away.extension
  amsg ««( $me is now away )»» ¬ ««( reason: %away.msg )»»
}
alias back {
  away
  set %away -
  nick %away.nick
  amsg ««( $me has returned from: %away.msg )»» ¬ ««( gone since: %away.time )»»
}
on 1:dialog:pmaccept:init:0: {
  did -a pmaccept 3 You have received a message from: %pm.nick
}
on 1:dialog:pmaccept:sclick:2: {
  msg %pm.nick ««( your message has been accepted )»»
}
on 1:dialog:pmaccept:sclick:3: {
  closemsg %pm.nick
}
dialog away {
  option dbu
  size 200 200 100 100
  title Away Control:

  text "Away Extension:", 1, 4 5 50 7
  text "Away Reason:",2, 4 17 50 7
  edit "",3, 46 2 35 11
  edit "",4, 46 15 35 11
  button "Go Away",5, 4 30 30 12, flat
  button "Return",6, 38 30 30 12, flat
  button "Ok",7, 25 50 25 12, ok
  button "Cancel",8, 55 50 25 12, cancel
}

on 1:dialog:away:init:0: {
  did -a away 3 %away.extension
  did -a away 4 %away.msg
}
on 1:dialog:away:edit:3 {
  set %away.extension $did(away,3)
}
on 1:dialog:away:sclick:6: {
  back
}
on 1:dialog:away:edit:4: {
  set %away.msg $did(away,4)
}
on 1:dialog:away:sclick:5: {
  afk %away.msg
}
;message control
on 1:OPEN:?:*: {
  if (%away == 1) {
    msg $nick ««( $me is away )»» ¬ ««( reason: %away.msg )»» ¬ ««( gone since: %away.time )»»
    msg $nick ««( your message has been logged )»»
  }
  else {
    msg $nick ««( Please wait for your message to be accepted )»»
    set %pm.nick $nick
    dialog -m pmaccept pmaccept
  }
}
dialog pmaccept {
  option dbu
  size 200 200 150 34
  title "Message Control:"

  text "You have received a message from:", 1, 4 4 147 7
  button "Accept", 2, 4 15 25 12, ok
  button "Ignore", 3, 32 15 25 12, cancel
}
;popups
menu channel {
  Channel:channel
  Away System:dialog -m away away
}