mIRC Home    About    Download    Register    News    Help

Topic Options
#83549 - 20/05/04 11:34 AM Auto-away script after x min idling (like on MSN)?
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
Hello,
Is it possible to make an auto-away script on IRC that execute after x min of idling ? I mean x min of idling = no keybord or mouse moves, like on msn, not x min idling on irc. I've been looking for such a script for a long time, please help me :-).
Thx a lot in advance.

Top
#83550 - 20/05/04 11:37 AM Re: Auto-away script after x min idling (like on MSN)?
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
Yes it is.. wink not that hard ether.. smile

Code:
on 1:connect: {
if (%auto_away == on) { .timer29 0 1 _autoaway }
}
on 1:input: {
 unset %_idle
}
alias _autoaway {
  inc %_idle
  if (%_idle >= %autoaway_idle) && ($away != $true) { autoaway }
}
alias autoaway
/ame is away, Idle-Away | away Idle-Away

just add the code to Remote, then add a value to:
%autoaway_idle

just remember that this one counts seconds.. so %autoaway_idle 60 will put you away after 1 minute

/set %autoaway_idle value

/set %auto_away on/off <<-- this will enable/disable the code.

Edit: I saw that you wanted it on no key press.. sorry, this one will go after your idle time on irc.. smirk


Edited by sparta (20/05/04 11:51 AM)
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#83551 - 20/05/04 12:01 PM Re: Auto-away script after x min idling (like on MSN)?
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
Thx for the answer Sparta,
What I would like is the script to start after the mouse hasn't moved for 1 min (in whole win xp, not only in IRC) and that the people who try to PM me get an away notice like (Away after x min of idling).
I would like it to stop when my mouse has moved again (once more, I mean in win xp, because my irc is minimized in the taskbar), so no more away message etc.

*Additionnaly it would be cool if my name could also be changed to iC|Seb_Lz`Aw after 15min of idling but the is a second step :-).

Top
#83552 - 20/05/04 12:05 PM Re: Auto-away script after x min idling (like on MSN)?
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I have never seen a script like that for mirc, i know ICQ and other programs have it, but maybe a DLL can do what you asking for.. i think that my away only need to trigger when im awat, as when i have idled on the server for X minutes. if i dont type anything in mirc for X minutes, then i dont look at it, and that means that i maybe playing a game or somthing else.. and if it only set me away when i dont move my mouse, then i would be set as not away even when i maybe are in fact away from mirc smile
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#83553 - 20/05/04 01:13 PM Re: Auto-away script after x min idling (like on MSN)?
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
I think "mouseevents.dll" does what you are asking for. smile
_________________________
New username: hixxy

Top
#83554 - 20/05/04 01:15 PM Re: Auto-away script after x min idling (like on MSN)?
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
Oh that's nice, thx you !
Could you give me further information as I'm a complete beginner in mirc scripting ?

Top
#83555 - 20/05/04 01:25 PM Re: Auto-away script after x min idling (like on M
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
AFAIK mouseevents.dll only performs events not tell you when they occur.

You may be able to use a /timer and $mouse.x and $mouse.y to get an idea of how long the mouse has been idle.

Top
#83556 - 20/05/04 01:29 PM Re: Auto-away script after x min idling (like on M
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Code:
alias mouseidle { 
  if $1 == $2 { 
    inc %mouseidle 
    return %mouseidle 
  } 
  else { unset %mouseidle }
}
.timer 0 1 $iif($mouseidle($mouse.dx $mouse.dy,$!mouse.dx $!mouse.dy) == &lt;time in seconds&gt;,/dostuff)


I think that should work.
_________________________
New username: hixxy

Top
#83557 - 20/05/04 02:48 PM Re: Auto-away script after x min idling (like on M
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
I put this in a txt file (autoaway.txt) :

Code:
alias mouseidle { 

  if $1 == $2 { 

    inc %mouseidle 

    return %mouseidle 

  } 

  else { unset %mouseidle }

}

.timer 0 1 $iif($mouseidle($mouse.dx $mouse.dy,$!mouse.dx $!mouse.dy) == 60,/nick iC|Seb_Lz`Aw)


Then typed "load -rs autoaway.txt" in mirc but the script still doesn't work.

Top
#83558 - 20/05/04 02:51 PM Re: Auto-away script after x min idling (like on M
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
You have to put the timer in an event wink
_________________________
New username: hixxy

Top
#83559 - 20/05/04 03:44 PM Re: Auto-away script after x min idling (like on M
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
I'm sorry to insist, but I'm really new in irc scripting, and I don't see what you mean with "putting a timer in an event". I'm sorry I know absolutely nothin in scripting yet :-(.

Top
#83560 - 20/05/04 04:10 PM Re: Auto-away script after x min idling (like on M
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
on *:connect:{ .timer 0 1 $iif($mouseidle($mouse.dx $mouse.dy,$!mouse.dx $!mouse.dy) == 60,/nick iC|Seb_Lz`Aw) }
_________________________
New username: hixxy

Top
#83561 - 20/05/04 06:35 PM Re: Auto-away script after x min idling (like on M
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
It still doesn't work, I put this in the txt file :

Code:
alias mouseidle { 

  if $1 == $2 { 

    inc %mouseidle 

    return %mouseidle 

  } 

  else { unset %mouseidle }

}

on *:connect:{ .timer 0 1 $iif($mouseidle($mouse.dx $mouse.dy,$!mouse.dx $!mouse.dy) == 60,/nick iC|Seb_Lz`Aw) }


load -rs it
then restarted irc but it doesn't work, nothing happens.

Top
#83562 - 20/05/04 06:55 PM Re: Auto-away script after x min idling (like on M
tidy_trax Offline
Hoopy frood

Registered: 02/11/03
Posts: 2327
Not sure then.
_________________________
New username: hixxy

Top
#83563 - 21/05/04 12:30 PM Re: Auto-away script after x min idling (like on M
zack Offline
Fjord artisan

Registered: 09/12/02
Posts: 266
Loc: Australia
Code:
alias mouseidle {
  if (%idlemouse.x == $1) &amp;&amp; (%idlemouse.y == $2) &amp;&amp; (!$away) inc %idlemouse.count
  if (%idlemouse.x != $1) &amp;&amp; (%idlemouse.y != $2) &amp;&amp; ($away) { echo -a you're back! | away | unset %idlemouse.* }
  if (%idlemouse.count == 60) { echo -a you're away! | away GONE!!! | unset %idlemouse.count }
  %idlemouse.x = $1
  %idlemouse.y = $2
}
on *:CONNECT:.timeridle 0 1 mouseidle $!mouse.x $!mouse.y


Just something I threw together quickly. The timer is set when you reconnect to a server.
_________________________
You won't like it when I get angry.

Top
#83564 - 21/05/04 07:04 PM Re: Auto-away script after x min idling (like on M
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
Thx you very much for all your help,
Your script zack does work well as far as I have the mirc windows in front. But when it is minimized the script put me away and then put me back directly when i open irc.


Edited by Seb_Lz (21/05/04 07:09 PM)

Top
#83565 - 26/05/04 07:03 PM Re: Auto-away script after x min idling (like on M
Seb_Lz Offline
Pikka bird

Registered: 20/05/04
Posts: 11
No1's got an idea ?

Top