Away script V 5.0 (NOW WITH DIALOG)

By Phil_FW on Jan 10, 2011

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

Comments

Sign in to comment.
dma   -  Oct 29, 2015

still working in 2015 :)

 Respond  
Phil_FW   -  Apr 06, 2012

How's this for a nice update Jethro :P

 Respond  
Phil_FW   -  Jan 12, 2011

thanks :D

 Respond  
Jethro   -  Jan 12, 2011

:P probably my anti-spam filtered it out. I never received an email. I've had a bunch of people waiting to be added as friends for months. lol You're added.

 Respond  
Phil_FW   -  Jan 12, 2011

Jethro sounds like one of those guys on TV... also at the local bookstores nearest you :D LOL.. and Jethro i sent you a friend request like 3 months ago lol but i don't think you replied yet

 Respond  
Jethro   -  Jan 12, 2011

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/

 Respond  
Phil_FW   -  Jan 12, 2011

got anywhere in mind i can learn regex from? a good site somewhere?

 Respond  
Jethro   -  Jan 12, 2011

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.

 Respond  
Phil_FW   -  Jan 12, 2011

Usually, the only reason i do seperate things is so newer people can understand what they do, like in napa's edit, I don't think many new scripters would know about "(/\Q $+ $me $+ \E\b/iS)" so that's why i keep it simple

 Respond  
Jethro   -  Jan 10, 2011

Why did you use a $nick for > check_away $nick $1-

check_away $1-

will do it just fine.

 Respond  
napa182   -  Jan 10, 2011

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 ]:.
  }
}
 Respond  
eNkIL   -  Jan 10, 2011

Nice man :)

 Respond  
_Teen_   -  Jan 10, 2011

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

 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.