simple away

By shadowofthenight on Apr 19, 2005

A simple away system, nothing to fancy, allows you to use diff formats
you can type the commands but i suggest using menu controls provided. to type commands, use /daway to go away and /dback to come back. within the code below shows diff formats of using this and the two switches -m and -a

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;SETTINGS
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;This is set to go silent away across all servers with the message "going away" by default
;hense if you want this, theres no need for any switches or message

;SWITCHES
; "m" == message active or all server ( if you want to go to active server,then add switch below)
; "a" == active server

;YOU CAN TYPE THESE COMMANDS ARE USE THE MENU CONTROLS PROVIDED 
;CONTROLS CAN BE FOUND ON RIGHT CLICK ON CHANNEL,STATUS,NICKLIST AND THE MENUBAR PULLDOWN

;default usage 
;USAGE: /daway 
;USAGE: /dback 

;if you want your own message
;USAGE:/daway <message>
;USAGE:/dback

;if you wish to go silently away on active server, use this format
;USAGE: /daway -a <message>
;USAGE: /dback -a

;if you wish to msg all channels and message across all servers,use this format
;USAGE: /daway -m <message>
;USAGE: /dback -m

;if you wish to msg all channels on active server, then use this format
;USAGE: /daway -ma <message>
;USAGE: /dback -ma
;USAGE: /daway -am <message>
;USAGE: /dback -am

alias daway {
  var %switches = $1
  if ( %switches == $null ) { set %message $1 }
  else { set %message $2 }
  if ( %message == $null ) { set %message going away }
  if ( %switches == -a ) { away %message }
  elseif ( %switches == $null ) { scon -at1 away %message }
  elseif ( %switches == -ma ) { 
    away %message
    amsg $+(AWAY:,$chr(32),%message)
  }
  elseif ( %switches == -am ) { 
    away %message
    amsg $+(AWAY:,$chr(32),%message)
  }
  elseif ( %switches == -m ) {
    scon -at1 away mes
    scon -at1 amsg $+(AWAY:,$chr(32),%message) 
  }
}

alias dback {
  var %switches = $1
  if ( %switches == -a ) { away  }
  elseif ( %switches == $null ) { scon -at1 away  }
  elseif ( %switches == -ma ) { 
    away 
    amsg $+(BACK FROM:,$chr(32),%message) :: Away For: $duration($awaytime)
    unset %message
  }
  elseif ( %switches == -am ) { 
    away 
    amsg $+(BACK FROM:,$chr(32),%message) :: Away For: $duration($awaytime)
    unset %message
  }
  elseif ( %switches == -m ) {
    scon -at1 away
    scon -at1 amsg $+(BACK FROM:,$chr(32),%message) :: Away For: $duration($awaytime)
    unset %message 
  }
}

;menu controls

menu menubar,channel,status,nicklist {
  Simple Away
  .Away
  ..Silent/All: daway $$?="Enter Message"
  ..Silent/Active: daway -a $$?="Enter Message"
  ..Msg/All: daway -m $$?="Enter Message"
  ..Msg/Active: daway -ma $$?="Enter Message"
  ..
  .Back
  ..Silent/All: dback 
  ..Silent/Active: dback -a 
  ..Msg/All: dback -m 
  ..Msg/Active: dback -ma 

Comments

Sign in to comment.
shadowofthenight   -  Apr 21, 2005

its separte cause people may wish to call the alias from 2 sclick events in a dialog

 Respond  
DarthReven   -  Apr 20, 2005

Im-No-Good move \"amsg $+(BACK FROM:,$chr(32),%message) :: Away For: $duration($awaytime)\" above \"away\" so you will get the time and u can also get rid of the %message variable and just use $awaymsg

 Respond  
Im-No-Good   -  Apr 19, 2005

Ok, im not really into scripting side of things.. is it me, cus you know when u come back from away, (msg all) is doesnt give your away time, it stays as 0 secs ? =/

 Respond  
samcobra   -  Apr 19, 2005

You might want to rename it as \"NotSoSimple\" Away system.

 Respond  
DarthReven   -  Apr 19, 2005

you could have made it into one alias by checking \"if ($away)\"

 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.