Sign in to follow this  
Followers 0
Toppy

MouseMove troubles

9 posts in this topic

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 :">

Share this post


Link to post
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

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Well, I tried option 0 (window) and 2 (Client) and it still goes to somewhere completely different :)

Nobody that have Spybot that could try it ? :D

Share this post


Link to post
Share on other sites

I even tried to maximize the Spybot window, with ...

WinSetState ( "SpyBot - Search & Destroy", "", @SW_MAXIMIZE)

... But that doesn't work either :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Can someone tell me why even the following line doesn't work ? :)

WinSetState ( "SpyBot - Search & Destroy", "", @SW_MAXIMIZE)

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  
Followers 0