All pastes #264833 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-12-02 19:44 UTC
rendered paste body
###########################################
# "Away System" - Xjlpx                   #
# Written on Saturday, December 2, 2006   #
# Edit as you please =)                   #
###########################################

on 20:text:.away*:#:{ 
  if (%away == %null) && (!$2) { set %away $address($nick,4)
    set %awaynick $nick
    set %awaymsg No Reason Given
    set %awaytime $ctime
    set %awaytime2 $time
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg ] [Gone at: 6 %awaytime2 ] [AMS : 6ON] } 
  elseif (%away == %null) && ($2 != %null) { set %away $nick
    set %awaynick $nick
    set %awaymsg $2-
    set %awaytime $ctime
    set %awaytime2 $time 
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg ] [Gone at: 6 %awaytime2 ] [AMS : 6ON] }
}


on 20:text:.back:#:{
  if ($address($nick,4) == %away) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg ] [Gone for: 6 $duration($calc($ctime - %awaytime)) ] 
    unset %away
    unset %awaymsg
    unset %awaytime
    unset %awaytime2
  unset %awaynick }
}

on 10:text:.away*:#:{ 
  if (%away == %null) && (!$2) { set %away.1 $address($nick,4)
    set %awaymsg.1 No Reason Given
    set %awaytime.1 $ctime
    set %awaytime2.1 $time
    set %awaynick.1 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.1 ] [Gone at: 6 %awaytime2.1 ] [AMS : 6ON] } 
  elseif (%away == %null) && ($2 != %null) { set %away.1 $address($nick,4)
    set %awaymsg.1 $2-
    set %awaytime.1 $ctime
    set %awaytime2.1 $time
    set %awaynick.1 $nick 
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.1 ] [Gone at: 6 %awaytime2.1 ] [AMS : 6ON] }
  elseif (%away.2 == %null) && (!$2) { set %away.2 $address($nick,4)
    set %awaymsg.2 No Reason Given
    set %awaytime.2 $ctime
    set %awaytime2.2 $time
    set %awaynick.2 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.2 ] [Gone at: 6 %awaytime2.2 ] [AMS : 6ON] } 
  elseif (%away.2 == %null) && ($2 != %null) { set %away.2 $address($nick,4)
    set %awaymsg.2 $2-
    set %awaytime.2 $ctime
    set %awaytime2.2 $time 
    set %awaynick.2 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.2 ] [Gone at: 6 %awaytime2.2 ] [AMS : 6ON] }
  elseif (%away.3 == %null) && (!$2) { set %away.3 $address($nick,4)
    set %awaymsg.3 No Reason Given
    set %awaytime.3 $ctime
    set %awaytime2.3 $time
    set %awaynick.3 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.3 ] [Gone at: 6 %awaytime2.3 ] [AMS : 6ON] } 
  elseif (%away.3 == %null) && ($2 != %null) { set %away.3 $address($nick,4)
    set %awaymsg.3 $2-
    set %awaytime.3 $ctime
    set %awaytime2.3 $time 
    set %awaynick.3 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.3 ] [Gone at: 6 %awaytime2.3 ] [AMS : 6ON] }
  elseif (%away.4 == %null) && (!$2) { set %away.4 $address($nick,4)
    set %awaymsg.4 No Reason Given
    set %awaytime.4 $ctime
    set %awaytime2.4 $time
    set %awaynick.4 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.4 ] [Gone at: 6 %awaytime2.4 ] [AMS : 6ON] } 
  elseif (%away.4 == %null) && ($2 != %null) { set %away.4 $address($nick,4)
    set %awaymsg.4 $2-
    set %awaytime.4 $ctime
    set %awaytime2.4 $time
    set %awaynick.4 $nick 
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.4 ] [Gone at: 6 %awaytime2.4 ] [AMS : 6ON] }
  elseif (%away.5 == %null) && (!$2) { set %away.5 $address($nick,4)
    set %awaymsg.5 No Reason Given
    set %awaytime.5 $ctime
    set %awaytime2.5 $time
    set %awaynick.5 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.5 ] [Gone at: 6 %awaytime2.5 ] [AMS : 6ON] } 
  elseif (%away.5 == %null) && ($2 != %null) { set %away.5 $address($nick,4)
    set %awaymsg.5 $2-
    set %awaytime.5 $ctime
    set %awaytime2.5 $time
    set %awaynick.5 $nick 
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.5 ] [Gone at: 6 %awaytime2.5 ] [AMS : 6ON] }
  elseif (%away.6 == %null) && (!$2) { set %away.6 $address($nick,4)
    set %awaymsg.6 No Reason Given
    set %awaytime.6 $ctime
    set %awaytime2.6 $time
    set %awaynick.6 $nick
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.6 ] [Gone at: 6 %awaytime2.6 ] [AMS : 6ON] } 
  elseif (%away.6 == %null) && ($2 != %null) { set %away.6 $address($nick,4)
    set %awaymsg.6 $2-
    set %awaytime.6 $ctime
    set %awaytime2.6 $time
    set %awaynick.6 $nick 
  amsg [6 $nick  is now set to 6away] [ Reason: 6 %awaymsg.6 ] [Gone at: 6 %awaytime2.6 ] [AMS : 6ON] }
}

on 10:text:.back:#:{
  if ($address($nick,4) == %away.1) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.1 ] [Gone for: 6 $duration($calc($ctime - %awaytime.1)) ] 
    unset %away.1
    unset %awaymsg.1
    unset %awaytime.1
    unset %awaytime2.1 
  unset %awaynick.1 }
  if ($address($nick,4) == %away.2) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.2 ] [Gone for: 6 $duration($calc($ctime - %awaytime.2)) ] 
    unset %away.2
    unset %awaymsg.2
    unset %awaytime.2
    unset %awaytime2.2 
  unset %awaynick.2 }
  if ($address($nick,4) == %away.3) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.3 ] [Gone for: 6 $duration($calc($ctime - %awaytime.3)) ] 
    unset %away.3
    unset %awaymsg.3
    unset %awaytime.3
    unset %awaytime2.3 
  unset %awaynick.3 }
  if ($address($nick,4) == %away.4) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.4 ] [Gone for: 6 $duration($calc($ctime - %awaytime.4)) ] 
    unset %away.4
    unset %awaymsg.4
    unset %awaytime.4
    unset %awaytime2.4 
  unset %awaynick.4 }
  if ($address($nick,4) == %away.5) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.5 ] [Gone for: 6 $duration($calc($ctime - %awaytime.5)) ] 
    unset %away.5
    unset %awaymsg.5
    unset %awaytime.5
    unset %awaytime2.5 
  unset %awaynick.5 }
  if ($address($nick,4) == %away.6) { amsg [6 $nick  is now back. ] [Reason for being gone: 6 %awaymsg.6 ] [Gone for: 6 $duration($calc($ctime - %awaytime.6)) ] 
    unset %away.6
    unset %awaymsg.6
    unset %awaytime.6
    unset %awaytime2.6 
  unset %awaynick.6 }
}


on $*:text:/^[!,@]awaystatus*/Si:#: {
  set %send $iif($left($1,1) == @,msg $chan,notice $nick)
  if (!$2) && ($address($nick,4) == %away) { %send [[ 6 %away  is currently set to away. ] [Reason: 6 %awaymsg ] [Gone at: 6 %awaytime2 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away) { %send [[ 6 %away  is currently set to away. ] [Reason: 6 %awaymsg ] [Gone at: 6 %awaytime2 ] }
  elseif (!$2) && ($address($nick,4) == %away.1) { %send [[ 6 %away.1  is currently set to away. ] [Reason: 6 %awaymsg.1 ] [Gone at: 6 %awaytime2.1 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.1) { %send [[ 6 %away.1  is currently set to away. ] [Reason: 6 %awaymsg.1 ] [Gone at: 6 %awaytime2.1 ] } 
  elseif (!$2) && ($address($nick,4) == %away.2) { %send [[ 6 %away.2  is currently set to away. ] [Reason: 6 %awaymsg.2 ] [Gone at: 6 %awaytime2.2 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.2) { %send [[ 6 %away.2  is currently set to away. ] [Reason: 6 %awaymsg.2 ] [Gone at: 6 %awaytime2.2 ] } 
  elseif (!$2) && ($address($nick,4) == %away.3) { %send [[ 6 %away.3  is currently set to away. ] [Reason: 6 %awaymsg.3 ] [Gone at: 6 %awaytime2.3 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.3) { %send [[ 6 %away.3  is currently set to away. ] [Reason: 6 %awaymsg.3 ] [Gone at: 6 %awaytime2.3 ] } 
  elseif (!$2) && ($address($nick,4) == %away.4) { %send [[ 6 %away.4  is currently set to away. ] [Reason: 6 %awaymsg.4 ] [Gone at: 6 %awaytime2.4 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.4) { %send [[ 6 %away.4  is currently set to away. ] [Reason: 6 %awaymsg.4 ] [Gone at: 6 %awaytime2.4 ] }
  elseif (!$2) && ($address($nick,4) == %away.5) { %send [[ 6 %away.5  is currently set to away. ] [Reason: 6 %awaymsg.5 ] [Gone at: 6 %awaytime2.5 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.5) { %send [[ 6 %away.5  is currently set to away. ] [Reason: 6 %awaymsg.5 ] [Gone at: 6 %awaytime2.5 ] }
  elseif (!$2) && ($address($nick,4) == %away.6) { %send [[ 6 %away.6  is currently set to away. ] [Reason: 6 %awaymsg.6 ] [Gone at: 6 %awaytime2.6 ] } 
  elseif ($2 != %null) && ($address($2,4) == %away.6) { %send [[ 6 %away.6  is currently set to away. ] [Reason: 6 %awaymsg.6 ] [Gone at: 6 %awaytime2.6 ] }
  elseif (!$2) && ($address($nick,4) != %away,%away.1,%away.2,%away.3,%away.4,%away.5,%away.6)  { %send $nick doesn't seem to be currently set to away. }
  elseif ($2 != %null) ($address($2,4) != %away,%away.1,%away.2,%away.3,%away.4,%away.5,%away.6)  { %send $2 doesn't seem to be currently set to away. }
  unset %send
}


on *:text:*:#:{
  if (%awaynick isin $1-) { msg %awaynick  *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.1 isin $1-) { msg %awaynick.1  *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.2 isin $1-) { msg %awaynick.2 *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.3 isin $1-) { msg %awaynick.3 *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.4 isin $1-) { msg %awaynick.4 *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.5 isin $1-) { msg %awaynick.5 *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
  elseif (%awaynick.6 isin $1-) { msg %awaynick.6 *** [6AMS]: $nick said " $+ $1- $+ ", at $time $+ . }
}