mIRC Homepage

Away Script

Posted By: AltReality

Away Script - 17/01/07 09:53 AM

Simple question...

(with hopefully a simple answer)

I want to track my away time.
when I do a /away I am away - the server returns 'You have been marked as being away'

How can I capture that? Is it an SNOTICE? TEXT? RAW?
I have tried variations..but can't seem to figure it out.

a simple ON $me:AWAY:{blah} would be perfect..but I don't see that documented anywhere.

Thanks in advance!
-AltReality
Posted By: drc4

Re: Away Script - 17/01/07 12:41 PM

It's so much simpliar than it seems. You can keep track of your away message with $awaymsg and your away time with $awaytime. The away time is returned in seconds, so if you want to break it down to minutes, you can utilize $calc to divide the $awaytime by 60. Hope this is of assistance.
Posted By: cold

Re: Away Script - 17/01/07 01:23 PM

To catch raw events, use /debug @somewindow and enter the related commands.

"You have been marked as being away": raw 306
"You are no longer marked as being away": raw 305
Posted By: AltReality

Re: Away Script - 17/01/07 05:18 PM

Thanks for the quick reply!

Is there any way to trigger an event when you set your away status though?

My first post was worded badly...I'm actually trying to track my active time, (not my away time) so I want to assign $time to a variable when I set my away status.

That's a much better description of the problem.

aahh..the RAW events in the next post are exactly what I was looking for. Thanks alot for your help!

-AltReality
Posted By: Scripto

Re: Away Script - 17/01/07 05:54 PM

If you want to trigger an event when you go away, you could include a seperate alias within your away statment, like

Code:
/away {
  /away
  set %away.seconds 0
  /custom-alias <~~~~ make this be your event, or trigger your event
  /another-alias <~~~ do something else with this... 
  .timer.away 0 1 away-alias (or command) <~~ set a timer for another alias or command, whatever you want. 
} 


/away-alias {
  inc %away.seconds
  set %away.total $replace($duration(%away.seconds),hrs,hs,hr,h,mins,m,min,m,secs,s,sec,s)
} 


As far as keeping track of your time, you could set a variable to the time you went away, and then set a timer to keep track of the seconds (or minutes) away.... increment it one second at a time, and then use this on return:
Code:
 
/msg $chan Im now back after %away.total


I use this for mine. It doesnt have days or weeks in it, because if im away that long, i type /quit cool

You sound like your away time isnt your goal, but maybe you could use this type of example to keep track of your active time as well... set a variable to your time away, then subtract the difference?... im not sure what youre exact goal is, but maybe this would help.
Posted By: learn3r

Re: Away Script - 17/01/07 06:07 PM

Code:

raw 306:*: commands here | echo -a (You have been marked as being away)
raw 305:*: echo -a $duration($awaytime) | echo -a (You are no longer marked as being away)





a simple ON $me:AWAY:{blah} would be perfect..but I don't see that documented anywhere.
© 2021 mIRC Discussion Forums