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