mIRC Home    About    Download    Register    News    Help

Print Thread
#243767 23/12/13 01:22 PM
Joined: Dec 2013
Posts: 14
J
James Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2013
Posts: 14
Can someone take a look at this away script for me. I have something set wrong for the return from away. no matter how long the away is on when i set back it says i was only gone for 8 sec.

on *:dialog:Away:sclick:3: {
away $did(2)
set %awaymessage $did(2)
set %away 1
titlebar Karaoke-Realm --------[ %auidenni ]---------- ~[ You are marked as AWAY ]~
ame 13,1It Is Currently0,1 $time(dddd mmmm dd yyyy h:nn TT)
ame 8,1I Am Away 4K0R9e0a13l0m 7P11e8e4p11s... 9Away Reason:4 $did(2) 8~13| 9Woo 13Hoo|8~
}

on *:dialog:Back:sclick:3: {
titlebar Karaoke-Realm
unset %awaymessage
unset %away
ame is 4B0A8c0K 9I8n 11T0he 8H0ouse! 8~13| 9Woo 13Hoo|8~
ame 4I 8Was 11Gone 7For $duration($calc($time - %away 1))
ame 8,1I Returned On0,1 $time(dddd mmmm dd yyyy h:nn TT)
}

James #243768 23/12/13 01:33 PM
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
What do you think $calc(08:32:43 - 1 1) is supposed to return?

Loki12583 #243769 23/12/13 01:56 PM
Joined: Dec 2013
Posts: 14
J
James Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Dec 2013
Posts: 14
suppose to return the amount of time i was away since activating the away message so if i set away on at 8pm and set back at 8:15 pm then it should say i was gone for $weeks $days $hours $mins $secs so it should say i was gone for 15 mins

James #243770 23/12/13 05:37 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
For the away time you use $ctime.

When you set away, create a variable.

set %atime $ctime

And when you return you want to use that variable.

$duration($calc($ctime - %atime))

And this will give you the answer on how long time it have been since you put your self away.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard