This is my newly updated away script, with a dialog. I'm going to add some common presets to it later though. Just right click anywhere and choose "Away System"
menu channel,menubar,query {
-
.Away System { dialog -m awaysystem awaysystem }
-
}
dialog AwaySystem {
title "Away System V 5.0"
size -1 -1 390 180
option pixels notheme
edit "", 1, 26 32 300 20
edit "", 2, 26 83 120 20
edit "", 3, 212 83 120 20
button "ON", 4, 17 118 105 35
button "OFF", 5, 141 118 105 35
button "Cancel", 6, 266 118 105 35, cancel
link "http://www.hawkee.com/snippets/user/61411/", 7, 81 156 231 17
box "Reason:", 8, 17 17 356 43
box "Away Nick", 9, 17 68 168 44
box "Return Nick", 10, 204 68 168 44
text "My scripts --->", 11, 8 156 73 17
text "<---My Scripts", 12, 311 156 73 17
}
on *:DIALOG:AwaySystem:sclick:4:{ set %AwayControl ON | set %AwayREASON $did(1) | set %AwayNICK $did(2) | set %BackNICK $did(3) | nick %AwayNICK | away %AwayREASON | amsg 14,1It is currently0,1 $time(dddd mmmm dd yyyy h:nn TT) EST | amsg 9,1I'm away bitches... 4,1Reason?:11,1 %AwayREASON }
on *:DIALOG:AwaySystem:sclick:5:{ set %AwayControl OFF | amsg 9,1I'm back from11,1 %AwayREASON $+ 9,1. 6,1I was gone for15,1 $duration($awaytime) | amsg 14,1I returned on0,1 $time(dddd mmmm dd yyyy h:nn TT) EST | nick %BackNICK | unset %AwayNICK | unset %BackNICK | unset %AwayREASON | away }
on *:DIALOG:AwaySystem:sclick:7:{ url http://www.hawkee.com/snippets/user/61411/ }
ON *:TEXT:*:#:{
tokenize 32 $strip($1-)
if (%AwayControl == ON) {
if ($me isin $1-) {
echo -a 15 $nick has said your name in $chan saying14,1... 9,1 $+ $1-
notice $nick 4,1.:[8,1I am away4,1]:. 7,1.:[ 9,1Reason:11,1 %AwayREASON 7,1]:. 8,1.:[ 12,1I've been away for15,1 $duration($awaytime) 8,1]:.
}
if ($me != $1-) {
{ HALT }
}
if (%AwayControl != ON) {
{ HALT }
}
}
}
ON *:ACTION:*:#:{
tokenize 32 $strip($1-)
if (%AwayControl == ON) {
if ($me isin $1-) {
echo -a 15 $nick has done an action to you in $chan saying14,1... 9,1 $+ $1-
notice $nick 4,1.:[8,1I am away4,1]:. 7,1.:[ 9,1Reason:11,1 %AwayREASON 7,1]:. 8,1.:[ 12,1I've been away for15,1 $duration($awaytime) 8,1]:.
}
if ($me != $1-) {
{ HALT }
}
if (%AwayControl != ON) {
{ HALT }
}
}
}
phil24, there're countless websites you can find about regex, as well as the local bookstores nearest you. One good website is: http://www.regular-expressions.info/
phil24, that is regex, and yes...not every one understands it. But it's worth the learning experience if one decides to learn about regex. Just remember that you don't need to make the same routine for separate events. Just use an alias for the routine and then have all the events refer to it. This way, your code is less redundant.
no need to set a var just use $away to do the checks
menu Channel,menubar {
.Away
.. $iif($away,Off,On):{
away $iif(!$away,$$?"What is your away Reason?")
$iif(!$away,tnick $+($me,[AFK]),nick $mnick)
.amsg $iif(!$away,I'm away bitches... Reason? Here's your$&
damn reason you bastard:$!,I'm back from the reason i said when i left)
}
}
on $*:text:$(/\Q $+ $me $+ \E\b/iS):#:$awaynotice($nick)
on $*:action:$(/\Q $+ $me $+ \E\b/iS):#:$awaynotice($nick)
alias -l awaynotice {
if ($away && !$hget(away,$1)) {
hinc -mu120 away $1
.notice $nick .:[I am away]:. .:[ Reason: $awaymsg ]:.
}
}
the events, could be this
ON *:TEXT:*:*: check_away $nick $1-
ON *:ACTION:*:*: check_away $nick $1-
alias check_away {
if (%AwayControl == ON) && ($me isin $strip($1-)) {
notice $nick .:[I am away]:. .:[ Reason: %AwayMSG ]:.
}
}
no need to use the if ($me != $1-) by the way, its wrong, if you would to use something like this is if ($me !isin $1-), and no halts, look
if your nick its not on $1- and %awaycontrol its not on, it will not be triggered so dont need a check for this
by the way
I'm away bitches
i think this message its kinda offensive for ppl, and some ppl will not like this
u put
unset %AwayMSG, and then unset %AwayNICK,
you could use this unset %Away*
its a simple edit for this