mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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

Last edited by sparta; 20/05/04 10:51 AM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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 :-).

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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,.) }
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I think "mouseevents.dll" does what you are asking for. smile


New username: hixxy
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
Posts: 11
Oh that's nice, thx you !
Could you give me further information as I'm a complete beginner in mirc scripting ?

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You have to put the timer in an event wink


New username: hixxy
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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 :-(.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
on *:connect:{ .timer 0 1 $iif($mouseidle($mouse.dx $mouse.dy,$!mouse.dx $!mouse.dy) == 60,/nick iC|Seb_Lz`Aw) }


New username: hixxy
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Not sure then.


New username: hixxy
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
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.
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
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.

Last edited by Seb_Lz; 21/05/04 06:09 PM.
Joined: May 2004
Posts: 11
S
Seb_Lz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: May 2004
Posts: 11
No1's got an idea ?


Link Copied to Clipboard