mIRC Homepage
Posted By: gomp Away acript... (Requested.) [With explenation.] - 24/05/07 02:55 PM
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..
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
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!

Why waste a variable (%awaystatus) when mIRC already keeps track of it ($away) ?

Also, checking every second seems a bit overzealous..
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
    }
  }
}
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
I'll add that now. Thanks! laugh
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.

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.

I cant get it to work. Did you test the script?
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
why will the current net be 0 ?

How to set up this script?
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.
© mIRC Discussion Forums