Jump to content

MouseMove troubles


Recommended Posts

Hi, I have a weird problem, in my script I want it to move the mouse inside a window to a pos 70,295 but Autoit Moves the mouse to something like 290,650 :)

It's used to open SpyBot Search&Destroy and push the update button.

Here's the erratic part of the script, perhaps someone can test it to see what I mean.

AutoItSetOption("MouseCoordMode", 0)

If FileExists("C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe") Then
  If ProcessExists("SpybotSD.exe") Then
  WinActivate ( "Spybot" )
  Else
  Run ( "C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe" , "C:\Program Files\Spybot - Search & Destroy\" )
  Sleep (5000)
  WinActivate ( "Spybot" )
  EndIf
MouseMove (70 , 295 )


Endif

Exit

Please try this and see the problem :">

Link to comment
Share on other sites

Read the help file.

Especially this part:

MouseCoordMode          Sets the way coords are used in the mouse functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

Link to comment
Share on other sites

Read the help file.

Especially this part:

<{POST_SNAPBACK}>

I did, that's why I put AutoItSetOption("MouseCoordMode", 0)

That fact is, it goes to something completely different :">

Try it yourself, you'll see :)

Link to comment
Share on other sites

I did, that's why I put AutoItSetOption("MouseCoordMode", 0)

That fact is, it goes to something completely different  :">

Try it yourself, you'll see  :)

<{POST_SNAPBACK}>

I grabbed the code and modified it slightly since I don't have Spybot, but it was running correctly.

AutoItSetOption("MouseCoordMode", 0)
Opt("WinTitleMatchMode", 2)

If ProcessExists("notepad.exe") Then
  WinActivate ( "Notepad" )
Else
  Run ( "Notepad")
  Sleep (5000)
  WinActivate ( "Notepad" )
EndIf
    
MouseMove (70 , 295 )

Exit
Edited by Kerberuz

Kerby

Link to comment
Share on other sites

installed it and ran the following, it put the mouse over the update button

AutoItSetOption("MouseCoordMode", 0)

If FileExists("C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe") Then
  If ProcessExists("SpybotSD.exe") Then
  WinActivate ( "Spybot - Search & Destroy","&Check for problems" )
  Else
  Run ( "C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe" , "C:\Program Files\Spybot - Search & Destroy\" )
  ProcessWait("SpybotSD.exe")
;~   Sleep (5000)
  Winwait( "Spybot - Search & Destroy","&Check for problems" )

  WinActivate ( "Spybot - Search & Destroy","&Check for problems" )
  EndIf
MouseMove (70 , 295 )


Endif

Exit
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Why not use SpyBot Command line parameters ?

Much simpler

Here is a list of command line parameters that the Spybot-S&D main executable (spybotsd.exe) supports:

/taskbarhide
Runs Spybot-S&D completely hidden (no window, no taskbar icon), so make absolutely sure you use it only in combination with /autoclose (otherwise it would remain in memory sitting idle). Useful only in combination with /autocheck, /autoupdate or /autoimmunize, as it cannot be controlled when completely invisible. 
/minimized
Starts the window minimized. 
/uninstall
Uninstalls Spybot-S&D. This command line parameter is very outdated - unins000.exe should be used instead! 
/blinduser
Starts with support for blind users (special menus). 
/autoupdate
Does an update after starting the program. 
/autocheck
Starts scanning immediately. 
/autofix
Fixes problems after scan. 
/autoclose
Closes program after it has scanned or updated. 
/autoimmunize
Runs the immunization at program start. 
/onlyspyware
Fixes only spyware (red) entries with /autofix, leaving all usage tracks as they are. 
/easymode
Starts with easier interface for newbies.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...