alias awy

By _Lestat_ on Oct 26, 2011

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 
}
Sign in to comment.
FireStar   -  Dec 16, 2011

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

 Respond  
_Lestat_   -  Oct 28, 2011

I know that I don't have to change my code but new ideas always help which is why I just took parts of Fuzionx's code and added it to my original. I always just take what I want from what people say and leave the rest. :)

 Respond  
toclafane1   -  Oct 28, 2011

Dean shh you tit

 Respond  
toclafane1   -  Oct 28, 2011

Dean Wrote: > Jethro created the $regex identifier or maybe he just likes to use regex in codes?

 Respond  
_Dean_   -  Oct 28, 2011

i dont care what you think, since trash dont think your words are meaningless to me

 Respond  
toclafane1   -  Oct 28, 2011

Dean Jethro posted a/an opinion, i'm not backing him up, i'm just saying it how it is

 Respond  
_Dean_   -  Oct 28, 2011

Lestat you dont have to change your code, just cause they posted their option, your code works, and this is a different way, Jethro created the $regex identifier ( i dont know if you already knew that ) just to confuse you guys who are starting

 Respond  
_Lestat_   -  Oct 28, 2011

ok changed it to how I would like it using some of fuzionx description kept vars as I want it a self away not mirc marked away kept !page as I want to know what people said not everyone will query me and tokenize 32 $stip($!-) doesn't seem to be working on !page so if ne ideas please comment

 Respond  
Jethro   -  Oct 27, 2011

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.

 Respond  
Fuzionx   -  Oct 27, 2011

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
}
  • Use of $away, $awaytime and $awaymsg instead of variables.
  • Use of tnick (temporary nick) and $mnick (main nick) for an away nickname.
  • Use of $me in the ON TEXT event so the user doesn't have to fill it in him/herself
  • Deleted the !page command since people rather message you themselves instead of using !page
  • Awaytime shown when you come back.
  • The alias bck renamed to back, makes more sense.
  • Check if you are away when the /back command is executed.

I hope this helps you. ;)

 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.