Simple multi network away script

By Saxo on Dec 02, 2008

type /away [REASON]
and /back

it works on multi networks/servers but you'll have to type /away [reason] on all servers

alias away { 
    /set %reason. [ $+ [ $network ] ] $1-
    /set %away.1. [ $+ [ $network ] ] $ctime
    /set %awayscript. [ $+ [ $network ] ] on
    /ame I am now away.13 $1- $+ .
}

alias back {
  if (%awayscript. [ $+ [ $network ] ] == on) {    
    /ame I am back from13 %reason $+ . I was away for13 $duration($calc( $ctime - %away.1 [ $+ [ $network ] ] ))
    /unset %reason. [ $+ [ $network ] ]
    /unset %away.1. [ $+ [ $network ] ]
    /set %awayscript. [ $+ [ $network ] ] off
  } 
} 

on *:text:$($+(*,$me,*)):#:{
  if (%awayscript. [ $+ [ $network ] ] == on){ 
    /notice $nick I am currently away. Reason: %reason. [ $+ [ $network ] ] $+ . I have been away for $duration($calc( $ctime - %away.1 ))
  }
}

Comments

Sign in to comment.
SnapeisntEvil   -  Jul 27, 2009

do u realize that if you have to do it for each individual server that its not multi-server?

 Respond  
newklear   -  Dec 05, 2008

ermm I think the above part of

on *:text:**:#: {
if $1 != $me $+ ? { halt }

is a little bit hairy
why not just use:

alias away { .scon -a away $iif(!$1,AFK,$1-) | set %reason. [ $+ [ $network ] ] $iif(!$1,AFK,$1-) | set %away.1. [ $+ [ $network ] ] $ctime | set %awayscript. [ $+ [ $network ] ] on | amsg I am now away. $1- $+ . }
alias back { if (%awayscript. [ $+ [ $network ] ] == on) { .scon -a away | amsg I am now back from $awaymsg $+ , I was gone for: $duration($awaytime) | unset %reason. [ $+ [ $network ] ] | unset %away.1. [ $+ [ $network ] ] | set %awayscript. [ $+ [ $network ] ] off } }

on *:TEXT:$( * $+ $me $+ * ):#: {
  if (%awayscript. [ $+ [ $network ] ] == on) && (%flood [ $+ [ $address($nick,2) ] ] != on) {
    .notice $nick I am currently away. Reason: %reason. [ $+ [ $network ] ] $+ . I have been away for $duration($calc($ctime - %away.1. [ $+ [ $network ] ] ))
    set -u60 %flood [ $+ [ $address($nick,2) ] ] on
  }
}

on *:TEXT:*:?: {
  if (%awayscript. [ $+ [ $network ] ] == on) && (%flood [ $+ [ $address($nick,2) ] ] != on) { 
    .msg $nick I am currently away. Reason: %reason. [ $+ [ $network ] ] $+ . I have been away for $duration($calc($ctime - %away.1. [ $+ [ $network ] ] ))
    set -u60 %flood [ $+ [ $address($nick,2) ] ] on
  }
}

And it will work across multiple networks.

 Respond  
bugyou   -  Dec 05, 2008

I had to change a bit for it to work

alias away {
/set %reason. [ $+ [ $network ] ] $1-
/set %away.1. [ $+ [ $network ] ] $ctime
/set %awayscript. [ $+ [ $network ] ] on
/me I am now away. $1- $+ .
}
alias back {
if (%awayscript. [ $+ [ $network ] ] == on) {
/me I am back from %reason. [ $+ [ $network ] ] $+ . I was away for $duration($calc($ctime - %away.1. [ $+ [ $network ] ] ))
/unset %reason. [ $+ [ $network ] ]
/unset %away.1. [ $+ [ $network ] ]
/set %awayscript. [ $+ [ $network ] ] off
}
}
on *:text:**:#: {
if $1 != $me $+ ? { halt }
if (%awayscript. [ $+ [ $network ] ] == on) {
/notice $nick I am currently away. Reason: %reason. [ $+ [ $network ] ] $+ . I have been away for $duration($calc($ctime - %away.1. [ $+ [ $network ] ] ))
}
}

 Respond  
Saxo   -  Dec 02, 2008

Dunno i just prefer it that way to see who highlights me ect

 Respond  
newklear   -  Dec 02, 2008

What's up with all the tags ? Please keep the Tags script specific so it helps people search accurately what they are looking for.
No need to have the "/" command prefix you can just leave it out or use a "." instead to make the command execute silently.
Have a peek of what I did in my away script: http://www.hawkee.com/snippet/5231/

 Respond  
Saxo   -  Dec 02, 2008

Edited it, thanks.

 Respond  
guest598594   -  Dec 02, 2008
on *:text:*(INSERT IRC NAME HERE)*:#: {

You could do:

on *:text:$($+(*,$me,*)):#:{
 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.