mIRC Home    About    Download    Register    News    Help

Print Thread
Away Script #168957 17/01/07 09:53 AM
Joined: Mar 2004
Posts: 27
A
AltReality Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2004
Posts: 27
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

Re: Away Script [Re: AltReality] #168959 17/01/07 12:41 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
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.

Re: Away Script [Re: AltReality] #168960 17/01/07 01:23 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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


* cold edits his posts 24/7
Re: Away Script [Re: drc4] #168972 17/01/07 05:18 PM
Joined: Mar 2004
Posts: 27
A
AltReality Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2004
Posts: 27
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

Last edited by AltReality; 17/01/07 05:19 PM.
Re: Away Script [Re: AltReality] #168974 17/01/07 05:54 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
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.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Re: Away Script [Re: AltReality] #168975 17/01/07 06:07 PM
Joined: Oct 2006
Posts: 342
L
learn3r Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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.


learn learn learn