===New Away Script===

By CadetAndrew on Nov 07, 2009

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.
  }
}

Comments

Sign in to comment.
Cracker200   -  Nov 14, 2009

@Grant LMFAO i only Just red it lolz

 Respond  
CadetAndrew   -  Nov 14, 2009

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.

 Respond  
sunslayer   -  Nov 13, 2009

You should now only have to edit the settings partadding an event does not change that. and multiple $? would annoy the fk out of me tbh

 Respond  
Ghost-writer   -  Nov 13, 2009

sunslayer, $$?"Question" so you dontj ust set it to nothing.. whitch basically does nothing.

 Respond  
sunslayer   -  Nov 13, 2009

the code in the beginning won't do anything because its not in an event. adding a load event fixes this

on *:load: {
  set %auto.away.network 
  set %auto.away.duration
  set %auto.away.chan(s)
  set %auto.away.msg
  set %away.network
  set %away.chan(s)
}
 Respond  
CadetAndrew   -  Nov 13, 2009

The script is now complete! You should now only have to edit the settings part, don't worry about the code unless you know mrc well.

 Respond  
CadetAndrew   -  Nov 13, 2009

Thanks for the comments everyone, I'm working on making this script much more customizable and easier to set up.

 Respond  
SnoooP   -  Nov 09, 2009

Grant that was class LOL

 Respond  
sunslayer   -  Nov 08, 2009

ghost-writer that does the exact same thing as

  elseif ($away == $true) {
    /echo You are already away and will not be marked for auto-away.
  }

using the ping event for an away script isn't the best way to do this either

 Respond  
Ghost-writer   -  Nov 08, 2009

Testor, elseif ($away) echo You are already away and will not be marked for auto-away.

 Respond  
Testor   -  Nov 08, 2009
  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.

 Respond  
SketchDrawer   -  Nov 08, 2009

CHANNEL could just be $chan so the user does not have to edit that.

 Respond  
Grant-   -  Nov 08, 2009

Cracker200--What do you expect from a ten year old who ban evades, leeches, steals credit, and is a CHILD PORNOGRAPHY DISTRIBUTOR?

 Respond  
CadetAndrew   -  Nov 08, 2009

C'mon let's now turn this into a script war here.

However, if you have any ideas for this script I would love to hear them. :)

 Respond  
Cracker200   -  Nov 08, 2009

Ghost-Writer, you act like you know how to improve, every thing. But yet, you do not post any snippits, or tell the people how to improve it or you just critisise.(I can't spell don't say fúck all about it)

 Respond  
Ghost-writer   -  Nov 08, 2009

well it could be more customisable but its good and does its job so i guess its okay.

 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.