mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
I wish there was a way that if I am not already set to away. (By having done so with the //scid -at1 /away "reason".)

Then after an hour or so, it would automatically set me to "away: Been idle more than an hour!" ...

But as said, only if I am not already set to away..


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
here's a start....

Code:
timerawaycheck 0 1 { checkaway }
alias checkaway {
  if %awaystatus != $true {
    if $scon(1).$idle >= 3600 {
      scid -at1 /away Idle for at least an hour
      set %awaystatus $true
    }
  }
}


you might want to increment a loop to check each server connection within that comparison, oh an else statement to reset the %awaystatus when you return from away.

hope this helps

btk


billythekid
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
I have no idea what you just said. wink

I can nothing about coding/scripting.

I just got lots and lots of ideas.. frown

But anyways. I am testing it now! laugh

Thank you ever so much!



I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Why waste a variable (%awaystatus) when mIRC already keeps track of it ($away) ?

Also, checking every second seems a bit overzealous..

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
How would I implement that?

The script does not work for me. I do not know why..

Got this: In remote
Code:
timerawaycheck 0 1000 { checkaway }
alias checkaway {
  if %awaystatus != $true {
    if $scon(1000).$idle >= 3600 {
      scid -at1 /away Idle for at least an hour
      set %awaystatus $true
    }
  }
}

Last edited by gomp; 03/03/08 02:59 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
umm, you do know there's an inbuilt $away, yes?

i.e.
Code:
alias checkaway {
  scon -at1 if (!$away && $idle >= 3600) { away idle for at least an hour }
}


Really, why complicate it further? :P

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
I'll add that now. Thanks! laugh


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
I tested this:
//scon -at1 if (!$away && $idle >= 1) { away idle for at least an hour }

1 is for testing only. But the script dont work.

This works:
//scon -at1 if (!$away) { away idle for at least an hour }

I am on Quakenet, may there is some issue?

Thanks.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Try using $!idle

~ Edit ~

From mirc.chm

Note: If you use a command that contains $identifiers, and you want the identifiers to be evaluated in the target connection, you must pass them as $!identifier to prevent them from being evaluated first in the current connection.


Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
I cant get it to work. Did you test the script?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
will always be 0 for the current net: //scon -at1 echo -s $!idle
I suppose you have to loop the cons and use $scon(N).idle

Last edited by Horstl; 17/04/08 11:47 PM.
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483
why will the current net be 0 ?

How to set up this script?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
As the very //command "breaks" your idling smile
Each 'editbox operation' (finished by RETURN) resets $idle (for the associated network), you don't need to send text (or the like ) via editbox to do so.

Edited my previous post: You may loop the $scon(N), but you dont have to.

Take this code:
Code:
alias idlecheck {
  scon -at1 echo -s away: $!away idle: $!idle
  scon -at1 if (( $!away == $!false ) && ( $!idle >= 1 )) { echo -s conditions true; set away idle for $!network }
}

run it with 1) /idlecheck
compare this to 2) /.timer.idle 1 3 idlecheck
The latter matches the if-conditions, as you're then idling 3 seconds after firing the /timer.

Last edited by Horstl; 18/04/08 12:05 AM.

Link Copied to Clipboard