Simple away script

By Epik-Fail on May 28, 2010

This is my away script. I've been learning a lot since with scripting since I last posted my color script.. this is the first public release I've made in 2 years

EDIT: Kinda used example codes posted in the comments to make this better. I originally made this script but Napa & Jethro made it simpler. Thank you Napa & Jethro ×Ð

#####################################
## Script: Simple Away Script      ##
## Made by: Prefix/Epik-Fail       ##
## Helped by: Napa & Jethro_       ##
## Server: chat.frostwire.com      ##
## Skype: xx_zagar_x               ##
## Server Channel: #GaGa           ##
#####################################
##   Commands For Script (S.A.S)   ##
## /away2 : Set Away & Back        ##
## /saway : Set silent Away & back ##
#####################################

alias away2 {
  if (!$away) {
    ame 14,1is now 11away 0,1- 14Left at11 $time(h:nn tt) 14with the reason0,1:11 $$1-
    tnick $+($me,[aFK])
    .away $$1-
  }
  else {
    ame 14,1is now 11back 14from0:11 $awaymsg 0- 14 $+ $me was gone for0:11 $duration($awaytime)
    nick $mnick
    .away
  }
}
alias saway {
  if (!$away) {
    tnick $+($me,[aFK])
    .away $$1-
  }
  else {
    nick $mnick
    .away
  }
}
on $*:text:$(/\Q $+ $me $+ \E$/iS):#:simpleaway
on $*:action:$(/\Q $+ $me $+ \E$/iS):#:simpleaway
alias -l simpleaway {
  if ($away && !%f) {
    inc -u5 %f
    notice $nick I'm currently away with the reason: $awaymsg - Auto Message on: $me $+ .
  }
}

Comments

Sign in to comment.
Epik-Fail   -  May 30, 2010

Used examples you guys gave and remade it when I was drunk... lmao >_<

 Respond  
Jethro   -  May 29, 2010

Good call, napa182. I overlooked that.

 Respond  
napa182   -  May 29, 2010

Jethro_ maybe add into ur simpleaway alias a check if ur away so it wont trigger if you are not away.

if ($away && !%f) {
 Respond  
Jethro   -  May 29, 2010

There's nothing regex about the codes napa showed you above.> on :TEXT:Prefix[aFK]:#:{
notice $nick I'm currently away with the reason: %reason - Auto Message on: Prefix[aFK].
}
on
:ACTION:Prefix[aFK]:#:{
notice $nick I'm currently away with the reason: %reason - Auto Message on: Prefix[aFK].
}can turn into this:

on $*:text:$(/\Q $+ $me $+ \E$/iS):#:simpleaway
on $*:action:$(/\Q $+ $me $+ \E$/iS):#:simpleaway
alias -l simpleaway {
  if (!%f && $away) {
    inc -u5 %f
    notice $nick I'm currently away with the reason: %reason - Auto Message on: prefix[afk]
  }
}

This way, you don't need to reiterate the notice twice in each event. You need a trigger control so that you don't get bombarded with trigger flood.

 Respond  
Epik-Fail   -  May 29, 2010

Like I said, I made this in 5 mins... Read my tags :P I just started editing it again after I posted this here & thanks napa182, I'll try it

 Respond  
Jethro   -  May 29, 2010

I know, and I don't reckon napa182 will teach someone regex for a bad intention...unless of couse that someone was born to start or engage in a war easily...anywhere and anytime...lol

 Respond  
napa182   -  May 29, 2010

I have no clue what war script he is talking about

 Respond  
Jethro   -  May 29, 2010

War script? Like you-kick-me-and-I-kick-you-back kinda script?

 Respond  
darkc0de   -  May 28, 2010

Cool napa182.. Haha.. Thx 4 teach me some regex.. Its realy work in my war script.. Thx bro

 Respond  
napa182   -  May 28, 2010

no real need to set any vars for this. look into using $awaytime and $awaymsg
also you should really add some kind of flood control to ur on text/action events or risk being flooded off.

here is an example without vars

alias away2 {
  ame 14,1is now 11away 0,1- 14Left at11 $time(h:nn tt) 14with the reason0,1:11 $$1-
  tnick $+($me,[aFK])
  .away $$1-
}
alias back2 {
  ame 14,1is now 11back 14from0:11 $awaymsg 0- 14 $+ $me was gone for0:11 $duration($awaytime)
  nick $mnick
  .away
}

or make it one alias

alias away2 {
  if (!$away) {
    ame 14,1is now 11away 0,1- 14Left at11 $time(h:nn tt) 14with the reason0,1:11 $$1-
    tnick $+($me,[aFK])
    .away $$1-
  }
  else {
    ame 14,1is now 11back 14from0:11 $awaymsg 0- 14 $+ $me was gone for0:11 $duration($awaytime)
    nick $mnick
    .away
  }
}

just to give you an idea i guess

 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.