Anarchy99 Posted October 4, 2009 Share Posted October 4, 2009 Ok heres what im try to achieve. Based on the amount the user enters into the input box the script will run that many times. Now the script has to move the mouse down -2 y every time based on the amount entered and x has to remain the same. How can i achieve this without making a incredibly long IF statement? Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 4, 2009 Share Posted October 4, 2009 Ok heres what im try to achieve. Based on the amount the user enters into the input box the script will run that many times. Now the script has to move the mouse down -2 y every time based on the amount entered and x has to remain the same. How can i achieve this without making a incredibly long IF statement? This does what you say... (I'm assuming by -2 y you mean down? if not change the + to -) $Num = InputBox("Runs", "How many times?", 1) $Start = MouseGetPos() For $i = 1 To $Num MouseMove($Start[0], $Start[1] + 2) $Start = MouseGetPos() Next We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
DW1 Posted October 4, 2009 Share Posted October 4, 2009 Good example above. To expand on that example, you may need to block user input so they may not interfere with the mouse moves. Also, we should check if the mouse will hit the bottom of the screen before the looping is done, and if so, change the amount of loops to what would hit the bottom of the screen. #RequireAdmin ; For BlockInput() $Num = InputBox("Runs", "How many times?", 1) BlockInput(1) ; Block user control of mouse and keyboard ;~ Check if $num is set too high and will cause the mouse to hit the end of the screen early. If MouseGetPos(1) + ($Num * 2) > @DesktopHeight Then $Num = Int((@DesktopHeight - MouseGetPos(1)) / 2) For $i = 1 To $Num MouseMove(MouseGetPos(0), MouseGetPos(1) + 2) Next BlockInput(0) AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Anarchy99 Posted October 14, 2009 Author Share Posted October 14, 2009 Thnx alot 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