This is a good away script that I have worked on. Thanks to PwnerJohn for the on PING part of it.
===Usage===
/afk -- Will set you as away, with your away message, in whatever channel you put down.
/back -- Will take you from being away, will calculate your time, and tell you how long you have been away.
This script will also automatically mark you as being away after one hour idle. You can edit it in seconds at the very first part of the script.
Only edit the settings section. Also note, there is no /back configuration, that's because it will take what you put in the /afk configuration.
Enjoy!
;#Away Script Created by CadetAndrew
;http://www.hawkee.com/snippet/6892/
;#Edit all the settings below, only edit the code part if you know mrc well.
;###SETTINGS###
;##Auto-Away Configuration##
;#Set this if you would like to 1 if you would like to use the auto-away part of this script . ;#If you would not like to use this part set it to 0
set %auto.away 1
;#Set this to the network you would like the auto-away to work on:
set %auto.away.network GameSurge
;#Set this to the time (in seconds) you want your idle time to be to be marked for auto-away:
set %auto.away.duration 3600
;#Set this to the channels you would like the auto-away script to say you are now away with your ;message. Separate each channel with a comma (example: #IRC,#MyChat,#TestChat,#Scripting)
set %auto.away.chan(s) #MyChan
;#Set this to what you want your away message to be in those channels:
set %auto.away.msg Auto-away after %auto.away.duration seconds
;##/afk Configuration##
;#Set this to the channels you would like to describe that you are away in.
;#NOTE: This PART NOW GETS THE NETWORK AUTOMATICALLY, ADD MORE OF THESE LINES TO USE THIS ON MULTIPLE NETWORKS!!!
set % $+ $network $+ .away.chan(s)
;##################CODE BELOW, ONLY EDIT IF YOU KNOW WHAT YOU ARE DOING!!###########
on 1:PING: {
if (%auto.away == 1) {
if ($idle == %auto.away.duration) && ($away == $false) && ($network == &auto.away.network) {
/away %auto.away.msg (Since $time $+ )
/describe %auto.away.chan(s) is now away: %auto.away.msg
}
}
alias afk {
if ($away == $false) {
/away $1- (Since $time $+ )
set % $+ $network $+ .away.reason $1-
set % $+ $network $+ .away.time $ctime
/describe % $+ $network $+ .away.chan(s) is now away: % $+ $network $+ .away.reason
}
}
alias back {
if ($away == $true) {
/away
/describe % $+ $network $+ .away.chan(s) is now back from % $+ $network $+ .away.reason(been away for $duration($calc($ctime - % $+ $network $+ .away.time ) )))
/unset % $+ $network $+ .away.reason
/unset % $+ $network $+ .away.time
/echo 4 All of you $network away settings have been unset.
}
}
What I could do is add this, but I'm not sure how it would come out.
on *:LOAD: {
set %auto.away.network $$?="What is the name of the network you would like auto-away to be enabled on?"
set %auto.away.duration $$?="What would you like your idle to be (in seconds) to be marked for auto-away"?
set %auto.away.chan(s) $$?="What channels would you like to say you are auto-away in? (Separate each channel with a comma. ie: #MyChan,#Chat,#Scripting)"
set %auto.away.msg $$?="What would you like your auto-away message to be?"
set %away.network $$?="What is the name of the network you would like /afk to be enabled on?"
set %away.chan(s) $$?="Which channels would you like to say you are now away in?(Separate each channel with a comma. ie: #MyChan,#Chat,#Scripting)
}
Is that what you mean? If so I can add it no problem.
elseif ($away == $true) {
/echo You are already away and will not be marked for auto-away.
}
You shouldn't really have that, as if you're really away you won't be there to read that, lol.
Also, when you do come back you'll return to a window full of that, from it telling you whenever the script runs that you're away because it doesen't do a check whether it;s been triggered before, just repeats over and over again.