Away Snippet

By MichaelA on Sep 09, 2010

This is just an away script i made one night when i was bored....it doesn't mark you as away in a /whois but i still find it useful and less annoying then the ones that continually messages the channel telling people.

Please leave a comment and tell me what you think ^_^

menu Channel {
  .Away
  ..ON: set %AwayMSG $$?"What is your away Reason?" | set %AwayControl ON | set %Awaytime $time $date
  ..OFF: set %AwayControl OFF | unset %AwayMSG
}

ON $*:TEXT:*:#:{
  if (%AwayControl == ON) {
    if ($me isin $1-) {
      notice $nick .:[I am away]:. .:[I left at: %AwayTime ]:. .:[Current time(24 hour time): $time $date ]:. .:[ Reason: %AwayMSG ]:.
    }
    if ($me != $1-) {
      { HALT }
    }
  }
  if (%AwayControl != ON) {
    { HALT }
  }
}

ON $*:ACTION:*:#:{
  if (%AwayControl == ON) {
    if ($me isin $1-) {
      notice $nick .:[I am away]:. .:[I left at: %AwayTime ]:. .:[Current time(24 hour time): $time $date ]:. .:[ Reason: %AwayMSG ]:.
    }
    if ($me != $1-) {
      { HALT }
    }
  }
  if (%AwayControl != ON) {
    { HALT }
  }
}

alias Gone {
set %AwayMSG $$?"What is your away Reason?"
set %AwayControl ON
set %Awaytime $time $date
}
alias back {
set %AwayControl OFF
unset %AwayMSG
}

Comments

Sign in to comment.
Jethro   -  Jan 09, 2011

Don't make the /halt a scripting habit of when you can negate. In some cases it may halt a script routine unnecessarily.

 Respond  
Phil_FW   -  Jan 09, 2011

i didnt really pay attention to that part lol. but thanks :D

 Respond  
sunslayer   -  Jan 09, 2011

@phil24

if ($me != $1-) {
      { HALT }
    }

should be

if ($me != $1-) {
      HALT
    }

however the halt's aren't necessary as you could just remove the entire if statement

 Respond  
Phil_FW   -  Jan 09, 2011

Here is a version of it with the setting of away and back nicks and an amsg. Along with regular 12 hour time but the one thing you need to change is on the time.. i have it say EST... so if you're not EST.. then you need to change it :D


menu Channel {
  .Away
  ..ON: set %AwayMSG $$?"What is your away Reason?" | set %AwayNICK $$?"What do you want your away nick to be?" | set %BackNICK $$?"What do you want your back nick to be?" | set %AwayControl ON | set %Awaytime $time(dddd mmmm dd yyyy h:nn TT) EST | nick %AwayNICK | amsg I'm away bitches... Reason? Here's your damn reason you bastard: %AwayMSG
  ..OFF: set %AwayControl OFF | unset %AwayNICK | amsg I'm back from %AwayMSG bitches :P | nick %BackNICK | unset %BackNICK | unset %AwayMSG
}

ON *:TEXT:*:#:{
  tokenize 32 $strip($1-)
  if (%AwayControl == ON) {
    if ($me isin $1-) {
      notice $nick .:[I am away]:. .:[I left at: %AwayTime ]:. .:[Current time: $time(dddd mmmm dd yyyy h:nn TT) EST ]:. .:[ Reason: %AwayMSG ]:.
    }
    if ($me != $1-) {
      { HALT }
    }
  }
  if (%AwayControl != ON) {
    { HALT }
  }
}

ON *:ACTION:*:#:{
  tokenize 32 $strip($1-)
  if (%AwayControl == ON) {
    if ($me isin $1-) {
      notice $nick .:[I am away]:. .:[I left at: %AwayTime ]:. .:[Current time: $time(dddd mmmm dd yyyy h:nn TT) EST ]:. .:[ Reason: %AwayMSG ]:.
    }
    if ($me != $1-) {
      { HALT }
    }
  }
  if (%AwayControl != ON) {
    { HALT }
  }
}
alias gone {
  set %AwayTime $time(dddd mmmm dd yyyy h:nn TT) EST
  set %AwayControl ON
}
 Respond  
MichaelA   -  Sep 09, 2010

you should really get a blank version of mirc an add ur own snippets to it.

^ i'm doing that nappa :D

 Respond  
MaSOuD   -  Sep 09, 2010

You named it "Away Snippet" but i can't see that in your codes. Is it a fake/personal away without using /away.
You could use $away, $awaymsg and $awaytime; There is no need to use %variables instead of them...
(It was just a suggestion, good luck.)

 Respond  
napa182   -  Sep 09, 2010

MichaelA Said:

some versions of mIRC have the fail scripts
huh?
maybe some scripts for mirc are fail scripts.
you should really get a blank version of mirc an add ur own snippets to it.

On a side note...
one thing i have noticed about you is you don't really take in account
the help that is offered to you. You receive help and better ways to go about ur snippet, but you never update them or fix them.

 Respond  
MichaelA   -  Sep 09, 2010

lmao because some versions of mIRC have the fail scripts that end up flooding the channel, plus my services kept highlighting me :P
and this way its also good to not show away in a /whois

 Respond  
napa182   -  Sep 09, 2010

MichaelA Said:

@nappa i wanted it so it wouldn't be like setting /away

lolwut? why not?

 Respond  
MichaelA   -  Sep 09, 2010

lol thanks ^_^
@nappa i wanted it so it wouldn't be like setting /away
but thanks for the input :D

 Respond  
napa182   -  Sep 09, 2010

no need to set vars at all also why are you using $ in ur on action and text events if you are using a wildcard ie *
you need to ad some kind of flood pro to it or risk being flooded

=/

maybe something like this
Oh and this one will set you away & back.

menu Channel {
  . $iif(!$away,Away,Back): away $iif(!$away,$$?"What is your away Reason?")
}
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 -mu10 away $1
    .notice $nick .:[ I am away ]:. .:[ I Have Been Gone For: $duration($awaytime) ]:. .:[ My Current date & time: $time(m/d/yy h:nn tt) ]:. .:[ Reason: $awaymsg ]:.
  }
}

anyways ur snippet as is has a lot of unnecessary coding along with redundancy. as is id give it a 2/10

 Respond  
Snip3KitTy   -  Sep 09, 2010

for such a smal script there is a lot of var setting XD

 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.