| View previous topic :: View next topic |
| Author |
Message |
pcsurgeon Guest
|
Posted: Thu Jul 17, 2008 9:58 pm Post subject: mouse movement |
|
|
i need a code fragment to detect any mouse movement and if the mouse does move to goto one label "if it doesnt" to goto the other.
im trying to write a script for a "security alarm" all i need now is that
thx for any help |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 290 Location: Canada
|
Posted: Fri Jul 18, 2008 12:15 am Post subject: |
|
|
how about something like...
| Code: |
s:: ;hotkey is s
MouseGetPos, MouseX, MouseY ;gets start position
Loop,
{
Sleep, 5000 ; 5 second intervols
MouseGetPos, MouseX2, MouseY2 ;checks position
if %MouseX2% = %MouseX%
{
Continue
}
else if %MouseX2% != %MouseX%
{
; do whater your alarm event is....
Break,
}
if %MouseY2% = %MouseY%
{
Continue
}
else if %MouseY2% != %MouseY%
{
; do whater your alarm event is....
Break,
}
}
|
Edit:: You can make the hotkey anything... A Gui button would work too. _________________ http://www.spider-games77.piczo.com
Join the Elite few...
Last edited by SpiderGames on Fri Jul 18, 2008 12:16 am; edited 1 time in total |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 559 Location: MN, USA
|
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 290 Location: Canada
|
|
| Back to top |
|
 |
|