Just a simple away I made. Please remember to add your nick on yournickhere Please This is the first snippet I have ever posted so please feel free to comment and let me know ways to improve
alias afk {
set %away $me
set %here $1-
amsg %away is afk due to %here $asctime
}
on *:text:$(* $+ $me $+ *):#: {
if ($me == %away) {
.notice $nick Sorry $nick but I am away. Reason: %here $+ . To Leave a Message w/o color type !page <messagehere>
}
}
on *:text:!page*:#: {
if ($me == %away) {
query $me $nick said $2- at $asctime
}
}
alias back {
amsg %away is now back from %here Was gone for $duration($nick(#,$me).idle)
unset %away
unset %here
}
Not sure the point in this if you have Invision... cuz invision comes with an away setting already on there. BUT i was wondering.... does this come with a Pop up box for the !page? if not it would be pretty nifty..... and does it have to be set with out color? stupid questions i know. but hey if i dont ask no one else will :p
To further improve your suggestion, Fuzionx, regex is well suited for this operation:
on $*:text:$(/(^| )(\Q $+ $replacecs($me,\E,\E\\E\Q) $+ \E|^!page)( |$)/Si):#:{
if ($away) {
if ($regml(2) == !page) { query $me $nick said $strip($2-) at $time $date | halt }
.notice $nick Sorry $nick but I am away. Reason: $awaymsg $+ . Leave a message if you want.
}
}
Two text events are combined as one, and the control codes are stripped out because of the /S modifier. Some people like to use color, bold, or underline embedded text, and if your mIRC is not set to strip incoming messages, the trigger for $me and !page will not respond at all.
I improved your code a bit.
alias awy {
away $iif($1-, $1-, No reason specified)
tnick $me $+ |Away
amsg I'm Away now. Reason: $awaymsg
}
on *:text:$(* $+ $me $+ *):#: {
if ($away) {
.notice $nick Sorry $nick but I am away. Reason: $awaymsg $+ . Leave a message if you want.
}
}
alias back {
if (!$away) { echo $color(info) -a * You're not away | halt }
amsg I am back from $awaymsg $+ . Been away for $duration($awaytime)
away
nick $mnick
}
I hope this helps you. ;)