address Posted February 20, 2012 Share Posted February 20, 2012 Mouseclick takes so much more processor load than mousemove, even with 100x times more sleep. What is the mechanism behind mouseclick? HotKeySet("{ESC}", "ExitApp") for $i = 1 to 100 Mouseclick("left", 144, 303, 1, 0) Sleep (100) Mouseclick("left",606, 303, 1, 0) Sleep (100) next Func ExitApp() Exit EndFunc HotKeySet("{ESC}", "ExitApp") for $i = 1 to 100 Mousemove(144, 303, 0) Sleep (1) Mousemove(606, 303, 0) Sleep (1) next Func ExitApp() Exit EndFunc Link to comment Share on other sites More sharing options...
Beege Posted February 20, 2012 Share Posted February 20, 2012 (edited) It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.Edit: I should say it used to use mouse_event. That might have changed. Edited February 20, 2012 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
address Posted February 20, 2012 Author Share Posted February 20, 2012 It uses mouse_event function. Not sure what you mean though. I get the same cpu values for both scripts. I also swapped sleep values, re-ran and got the same outcome.Edit: I should say it used to use mouse_event. That might have changed.Why such terrible effect on my computer from mouseclicks? Autoit and machine are up to date Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 20, 2012 Share Posted February 20, 2012 Be careful with Sleep(1), that can be confusing. 1-9 still take 10 ms as you can see by timing it. $iTotal = 0 For $iX = 1 To 100 $iTimer = TimerInit() Sleep(1) $iTotal += TimerDiff($iTimer) Next ConsoleWrite("Average is " & $iTotal/ ($iX - 1) & " ms" & @LF) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now