Jump to content
Sign in to follow this  
ReaImDown

Why doesnt the mouse change positions?

Recommended Posts

ReaImDown

I am writing a script out of sheer boredom... but its not working properly (go figure) I want the mouse to move to a position, and hold that position for 5 seconds, then move, hold that position for 5 seconds... etc. it only moves once (the initial time) - thanks in advance :idea:

Global $Width = 0, $Height = 0
HotKeySet("{END}", "Escape")
AdlibRegister("StayPut", 10)

while 1
    $Width = Random(1,@DesktopWidth)
    $Height = Random(1,@DesktopHeight)
    mousemove($Width,$Height)
    Sleep(5000)
WEnd

Func StayPut()
    MouseMove($Width,$Height)
EndFunc

Func Escape()
    Exit
EndFunc
Edited by ReaImDown

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites
ReaImDown

problem solved... I added in a SEND cmd so I can get a better grasp of what was happening... the AdLibRegister of 10ms was too low, it needed to be longer...

Global $Width = 0, $Height = 0
HotKeySet("{END}", "Escape")
AdlibRegister("StayPut", 50)

while 1
    $Width = Random(1,@DesktopWidth)
    $Height = Random(1,@DesktopHeight)
    Send($Width & "    " & $Height & "{ENTER}")
    mousemove($Width,$Height)
    Sleep(5000)
WEnd

Func StayPut()
    MouseMove($Width,$Height)
EndFunc

Func Escape()
    Exit
EndFunc

Results:

781.148254384752 496.100710163591

919.840957969893 314.633919907268

635.418895430863 103.070687694009

1069.88627260295 578.165844274219

932.48127661855 783.224379677791

577.233332111035 479.187442579772

993.724824472098 671.427003605524

837.656400452135 88.3015074518044

1230.52777018561 439.870651608566

248.33347094385 780.885140076512


[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.