JohanDev Posted November 5, 2018 Posted November 5, 2018 Hi there! I have a question regarding MouseWheel. It works fine at first, but next I need the mousewheel to go down a little bit every time during the loop and that doesn't work. MouseWheel("down",17) Local $i = 0 Local $x = 0 Local $mouseX = 150 Local $mouseX_plus = 60 While $i < 10 $mouseXt = $mouseX + $mouseX_plus * $i ; Go to and click on the top profile MouseMove(1350, $mouseXt, 5) MouseClick("left") ; Go to and click on the top profile MouseMove(1350, 220, 5) MouseClick("left") ; Click back to profiles MouseMove(1270, 50, 5) MouseClick("left") MouseWheel($MOUSE_WHEEL_DOWN, 5) $i = $i + 1 WEnd
JohanDev Posted November 5, 2018 Author Posted November 5, 2018 To clarify the above a bit more: The MouseWheel function at the first line works like expected, but next the MouseWheel function in the loop doesn't do anything. I tried everything I could imagine, like changing the figure from 5 to 15 and 30, moving the line right below the while-statement etc etc, but whatever I do the mouse doesn't scroll while in that loop.
Nine Posted November 5, 2018 Posted November 5, 2018 (edited) $MOUSE_WHEEL_DOWN is not declare anywhere always put opt ("mustdeclarevars",1) at the beginning of a script, helps to debug Edited November 5, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Danp2 Posted November 5, 2018 Posted November 5, 2018 Usually there's a better option than using to mouse commands to automate some task. Perhaps you could provide more details on the program you are attempting to automate. Latest Webdriver UDF Release Webdriver Wiki FAQs
careca Posted November 5, 2018 Posted November 5, 2018 (edited) Needs #include <AutoItConstants.au3> or use 'down' line the first line instead of the constant $MOUSE_WHEEL_DOWN Edited November 5, 2018 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
JohanDev Posted November 5, 2018 Author Posted November 5, 2018 Thanks for the replies, very much appreciated! I changed 'down' to $MOUSE_WHEEL_DOWN, just because I was so desperate that I tried anything =) so that's not the problem unfortunately..
JohanDev Posted November 5, 2018 Author Posted November 5, 2018 Now I changed it to the code below: While $i < 10 MouseWheel('down', 15) $mouseXt = $mouseX + $mouseX_plus * $i ; Go to and click on the top profile MouseMove(1350, $mouseXt, 5) MouseClick("left") ; Go to and click on the top profile MouseMove(1350, 220, 5) MouseClick("left") ; Click back to profiles MouseMove(1270, 50, 5) MouseClick("left") $i = $i + 1 WEnd The problem now is that the mousewheel scrolls down only one time in that loop (and one time outside of the loop). So just once weird enough...
Nine Posted November 5, 2018 Posted November 5, 2018 here the code i use to test it and it is working fine, so I opt ("MustDeclareVars",1) opt ("WinTitleMatchMode",2) WinActivate ("Mouse") MouseWheel("down",5) Local $i = 0 While $i < 2 msgbox (0,"test","test") WinActivate ("Mouse") MouseWheel("down", 10) $i = $i + 1 WEnd must assume that you are loosing control of the screen you are scrolling “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
JohanDev Posted November 7, 2018 Author Posted November 7, 2018 Thanks for the very kind support Nine, appreciated, I will try to see if that's the problem.
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