Simple away script.
Type /awaycommands for commands.
Load script by opening it or type /awayload
Self-checker to make sure the script works before you use it
Config letting you choose the colors
Updates:
Wednesday, July 09, 2008
08:24 AM EST
-Cleaned script up a little (thanks to comments)
08:34 AM EST
-Cleaned up some various things, changed way /config works so that it uses /awaycolor, thus using a few less characters than before
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;Script By Vegeto079/Peach/Peachbot;;;;;;;;;;;;;;;;
;;;;;;Sorry about many variables, but it's the way i script!;;;;;;
;;;;;Please do not edit this in any way without my permission;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:load:{
awayload
}
alias awaycontinue {
if (%away.test == $null) { HALT }
if (%away.test != yes yes yes yes yes yes) {
echo -a Script was not loaded. Error in script. Look at @away for more information.
unset %away.test
awayerror
halt
}
echo -a Script successfully loaded! Type /awaycommands to see commands.
unset %away.test
}
alias awayload {
.timer 05 01 awaycontinue
echo -a Loading Away Script...
unset %away
unset %away.*
set %away.color1 04
set %away.color2 02
set %away.logo $+ %away.color2 $+ [ $+ %away.color1 $+ AWAY $+ %away.color2 $+ ]
set %away.test 0
set %away.test $away(checking) $back(checking) $backamsg(checking) $awayamsg(checking) $awayback(checking) $config(checking)
}
alias awayerror {
window @away
echo @away Your script has failed to load. This could mean a few things.
echo @away 1. You have another script that is interfering with the Away script.
echo @away 1. To fix: Check if you have any script using the following aliases:
echo @away 1. Away, Awaycontinue, Awayload, Awayerror, Back, Backamsg, Awayamsg, Awayback, Awaycommands, Awaycolor, Config
echo @away 1. If so, please delete them or turn them off.
echo @away 2. You have tried to edit the coding, and something has gone through an error
echo @away 2. To fix: Re-download the script and don't edit it
echo @away 3. The admin of the script (Peach/Vegeto079) has made an initial error scripting
echo @away 3. To fix: Message Peach/Vegeto079 (irc.swiftirc.net:#peach) and tell them what has happened.
}
alias awaycommands {
window @away
echo @away Away commands
echo @away Syntax: Command - What it does
echo @away /away [reason] - Sets yourself as away
echo @away /back - Unsets yourself from being away
echo @away /config - Sets colors of script
}
alias away {
if ($1- == checking) {
return yes
halt
}
if (%away.logo == $null) {
echo -a Please type /awayload before using /away
}
if (%away == yes) {
echo -a %away.logo $+ %away.color1 $+ Error: $+ %away.color2 You are already away!
halt
}
set %away yes
set %away.say Reason not specified.
if ($1-) { set %away.say $1- }
awayamsg %away.say
halt
}
alias back {
if ($1- == checking) {
return yes
halt
}
if (%away.logo == $null) {
echo -a Please type /awayload before using /back
}
if (%away != yes) {
echo -a %away.logo $+ %away.color1 $+ Error: $+ %away.color2 You are already back!
halt
}
unset %away
backamsg
halt
}
on *:input:*:{
if (/ == $left($1,1)) || (away isin $1-) {
goto end
}
if (%away == yes) {
unset %away
backamsg
}
:end
}
alias backamsg {
if ($1- == checking) {
return yes
halt
}
set %i -1
:next
inc %i
set %send $comchan($me,%i)
if (%send == $null) { goto end }
if (%send !isin %normchan) || (%send isnum) { goto next }
msg %send %away.logo $+ $+ %away.color2 $+ Back from: $+ %away.color1 %away.say $+ %away.color2 $+ Gone since: $+ %away.color1 %away.time $+
goto next
:end
unset %amsgperson
halt
}
alias awayamsg {
if ($1- == checking) {
return yes
halt
}
set %i -1
:next
inc %i
set %send $comchan($me,%i)
if (%send == $null) { goto end }
if (%send !isin %normchan) || (%send isnum) { goto next }
awayback
msg %send %away.logo $+ $+ %away.color2 $+ Now Away: $+ %away.color1 %away.say $+ %away.color2 $+ Left at: $+ %away.color1 %away.time $+
goto next
:end
unset %amsgperson
halt
}
alias awayback {
if ($1- == checking) {
return yes
halt
}
set %away.time $date $time
}
alias config {
if ($1- == checking) {
return yes
halt
}
set %away.color1 $awaycolor(one $1)
set %away.color2 $awaycolor(one $2)
if ($1 == $null) {
set %away.color1 $awaycolor($?="What do you want the primary color to be?")
}
if ($2 == $null) {
set %away.color2 $awaycolor($?="What do you want the secondary color to be?")
}
set %away.logo $+ %away.color2 $+ [ $+ %away.color1 $+ AWAY $+ %away.color2 $+ ]
echo -a $+ %away.color1 $+ P $+ $+ %away.color2 $+ review $+ $+ %away.color1 $+ :
echo -a %away.logo $+ $+ %away.color2 $+ Now Away: $+ %away.color1 Preview $+ %away.color2 $+ Left at: $+ %away.color1 $time $+
}
alias -l awaycolor {
if ($left($1-,3) == one) { return $replace($mid($1-,5,100),dark_red,05,light_red,04,red,04,dark_blue,02,light_blue,11,blue,12,purple,06,pink,13,dark_grey,14,light_grey,15,dark_gray,14,light_gray,15,gray,15,orange,07,yellow,08,light_green,09,dark_green,03,green,03,aqua,10,black,01,white,00) | goto end }
return $replace($1-,dark_red,05,light_red,04,red,04,dark_blue,02,light_blue,11,blue,12,purple,06,pink,13,dark_grey,14,light_grey,15,dark_gray,14,light_gray,15,gray,15,orange,07,yellow,08,light_green,09,dark_green,03,green,03,aqua,10,black,01,white,00,$null,01,$false,01)
:end
}