Simple Away Script (dialog and logs)

By TheNitelyfe on Jul 07, 2009

Pretty simple away script. Has logs and first script with dialogs.

menu @Awaylog {
  -
  Closelogs: $iif($?!="Close logs?" == $true,window -c @Awaylog,halt)
}
menu status,nicklist,query,channel {
  -
  Away: aways
}
dialog Aways {
  title "TheNitelyfe's Away Script"
  size -1 -1 392 92
  option pixels
  button "Close", 1, 313 59 65 25
  button "Away", 2, 237 60 65 25
  button "Back", 3, 163 60 65 25
  box "Credit", 4, 8 46 148 42
  text "TheNitelyfe's Away Script", 5, 17 63 128 17
  edit "", 6, 11 15 162 30
  radio "Ame", 7, 192 9 100 17
  radio "Amsg", 8, 192 29 100 17
}
on *:dialog:Aways:*:*: {
  if ($devent == sclick) {
    if ($did == 1) { dialog -x $dname }
    if ($did == 2) { 
      if (!$away) { 
        set %away.reason $did(6) 
        away $iif(!%away.reason,Be back soon,%away.reason) Left at: $timestamp
        $iif(%Away.amsg == yes,amsg,ame) 14I am now away. Reason:12 $iif(%away.reason,%away.reason,Be back soon) - 14Left at:12 $timestamp
        set %away.backnick $me
        nick $+($me,\Away)
        set %away.time $ctime
        window -a @Awaylog
      }
      else { echo 2 -s * Error: You're already away. /away to access the away dialog | halt }
    }
    if ($did == 3) {
      if ($away) { 
        away
        $iif(%Away.amsg == yes,amsg,ame) 14I am now back from:12 $iif(!%away.reason,Be back soon,%away.reason) - 14Gone for:12 $duration($calc($ctime - %away.time))
        nick %away.backnick
        unset %away.*
      }
      else { echo 2 -s * Error: You're not away. | halt }
    }
    if ($did == 7) { set %away.amsg no }
    if ($did == 8) { set %away.amsg yes }
  }
}
alias aways dialog -m Aways Aways
on *:TEXT:$(* $+ $me $+ *):#: {
  if ($away) { 
    .notice $nick Sorry $nick but I am away atm because of: $iif(!%away.reason,Be back soon,%away.reason) - Message has been logged.
    echo @Awaylog $timestamp $+(<,$nick,>) $1-
  }
}
on *:ACTION:$(* $+ $me $+ *):#: {
  if ($away) { 
    .notice $nick Sorry $nick but I am away atm because of: $iif(!%away.reason,Be back soon,%away.reason) - Message has been logged.
    echo 6 @Awaylog $timestamp * $+($chr(3),$nick,$chr(3),6) $1-
  }
}

Comments

Sign in to comment.
Sonny   -  May 01, 2010

rofl.

 Respond  
TheNitelyfe   -  Jul 07, 2009

f@GGOT

 Respond  
Trev   -  Jul 07, 2009

douche bag

 Respond  
Trev   -  Jul 07, 2009

Nice script.

Why not use hash tables, instead of windows? Then you can review your hilights at anytime and do more with the script.

On *:ACTION:$(* $+ $me $+ *):#: {
  if ($away) {
  notice $nick Sorry $nick but I am away atm because of: $iif(!%away.reason,Be back soon,%away.reason) - Message has been logged.
  hadd -m Hilights %away.time $timestamp $1-
  if ($hget(HilightNum,%away.time) == 0) { hadd -m HilightNum %away.time 1 }
  Else { hinc HilightNum %away.time } 
  }
}

;--then you can do

Alias hls {
  msg $active I have been hilighted a total of: $hget(HilightNum,%away.time) times during the last time I was away. My last hilight being $hget(Hilights,%away.time)
}
 Respond  
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.