Sign in to follow this  
Followers 0
Britbadboy

Mouse movements

16 posts in this topic

Hi there,

well can someone please guide me as to how can I do without mouse movements. I mean to move on the screen is there anyway where i can click screen without plotting the mouse co-ordinates.

regards,

Badboy.

Share this post


Link to post
Share on other sites

Hi there,

well can someone please guide me as to how can I do without mouse movements. I mean to move on the screen is there anyway where i can click screen without plotting the mouse co-ordinates.

regards,

Badboy.

<{POST_SNAPBACK}>

Are you trying to click a button or other control on a window or dialog box? You can do that with Controlxxxyyy() functions without steering the mouse around. For a simple example:

Run notepad.exe from the Run dialog box (if it's already open):

ControlSetText("Run", "", "Edit1", "notepad.exe")
ControlClick("Run", "", "Button2")

The help file describes the functions and the AutoIt Window Spy will tell you the class+instance (e.g. Edit1 or Button2) of the control you wish to work with. You can find both at Start | Programs | AutoIt v3


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

Are you trying to click a button or other control on a window or dialog box? You can do that with Controlxxxyyy() functions without steering the mouse around. For a simple example:

Run notepad.exe from the Run dialog box (if it's already open):

ControlSetText("Run", "", "Edit1", "notepad.exe")
ControlClick("Run", "", "Button2")

The help file describes the functions and the AutoIt Window Spy will tell you the class+instance (e.g. Edit1 or Button2) of the control you wish to work with. You can find both at Start | Programs | AutoIt v3

<{POST_SNAPBACK}>

Hi there,

well I need help to click buttons a web page. I mean am trying a mass installation of some software. So am making a script that goes to this particular location on a website and then clicks the download link from there. So you know what am trying to say. If each user has diff screen resolutions then it might create a problem for me to use mouse co-ordinates. Or is there a way where I can change the screen resolution to mine i.e. 1024x768 and then reset it back to what their original screen was. But this I think may create a whole new level of problems.I don't want to make it very complicated. Please have a below at what am trying to do at the moment.

Send("#r")

If WinWaitActive("Run") Then

Send("some programl")

EndIf

Sleep(1000) ;pauses the program for 1 second.

Send("{Enter}")

Sleep(3000) ;pauses the program for 1 second.

Send("{PGDN}")

Sleep(2000)

MouseMove (60, 400)

MouseClick("")

regards,

Badboy.

Share this post


Link to post
Share on other sites

Hi there,

well I need help to click buttons a web page. I mean am trying a mass installation of some software. So am making a script that goes to this particular location on a website and then clicks the download link from there. So you know what am trying to say. If each user has diff screen resolutions then it might create a problem for me to use mouse co-ordinates. Or is there a way where I can change the screen resolution to mine i.e. 1024x768 and then reset it back to what their original screen was. But this I think  may create a whole new level of problems.I don't want to make it very complicated. Please have a below at what am trying to do at the moment.

If WinWaitActive("Run") Then
    Send("some programl")
EndIf

Sleep(1000);pauses the program for 1 second.
Send("{Enter}")

    Sleep(3000);pauses the program for 1 second.
    Send("{PGDN}")
    Sleep(2000)
    MouseMove (60, 400)
    MouseClick("")

regards,

Badboy.

<{POST_SNAPBACK}>

Well, I had this exact same problem with a different type of software.

I sloved it like this:

http://www.autoitscript.com/forum/index.php?showtopic=7357


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Well, I had this exact same problem with a different type of software. 

I sloved it like this:

http://www.autoitscript.com/forum/index.php?showtopic=7357

<{POST_SNAPBACK}>

Hi there,

is there a script which I might be able 2 look at? Would be great help if you can show me a snippet. You might wanna mail it to brit_bad_boy@yahoo.co.uk.

Regards,

Badboy.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Britbadboy, are you completely daft? What don't you understand about the link he posted? Not to mention that, but I can't see many users just fixing something for you not knowing what effect you are trying to accomplish. Nobody is going to work for you for nothing. Try actually doing something yourself. Not to mention that you obviously have not looked at the helpfile very well or you would have seen that

Send("#r")

If WinWaitActive("Run") Then
Send("some programl")
EndIf

Is a stupid way to run a program when there is a Run function already included.

EDIT: It is also obvious that you haven't even scratched the surface of InetGet, because if you did then you wouldn't be having to "click a webpage" anyway.

READ THE MANUAL

Edited by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$size = WinGetPos($b)
$x = Round($size[2] * .22527)
$y = Round($size[3] * .39333333333333)

...

MouseMove($x, $y, 0); unnecessary, but it's insurance more than anything.
MouseClick($primary, $x, $y, 1, 0)

The was ratio is figured out by dividing the height of the window by the position we need to click at...That way, it doesn't matter what resolution the desktop is.

For example, if the window size is 800 * 600, and we need to click at 120 * 240 on our screen...but not sure where to click on the other user's.

then the x location ratio is: $x = Round($size[2] * (120/800))

rinse and repeat for the y: $y = Round($size[2] * (240/600))

This really only works if the window will contain all the text you're looking for.

If you're trying to fill in a web-page, why not try sending {tab xxx} until you've highlighted the button or control that you want then send an {enter}? It's cumbersome, but you don't have to worry about mouse positions.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Blue, please read above post directed at brit.


Who else would I be?

Share this post


Link to post
Share on other sites

Britbadboy, are you completely daft? What don't you understand about the link he posted? Not to mention that, but I can't see many users just fixing something for you not knowing what effect you are trying to accomplish. Nobody is going to work for you for nothing. Try actually doing something yourself. Not to mention that you obviously have not looked at the helpfile very well or you would have seen that

Send("#r")

If WinWaitActive("Run") Then
Send("some programl")
EndIf

Is a stupid way to run a program when there is a Run function already included.

EDIT: It is also obvious that you haven't even scratched the surface of InetGet, because if you did then you wouldn't be having to "click a webpage" anyway.

READ THE MANUAL

<{POST_SNAPBACK}>

Hi there,

I take you are highly accomplished. Ok I might have not looked in very carefully but what kind of daftness are you showing by your language. Man chill a bit, point taken that you know every bit of this... allright mate.

cheers... ta!

Share this post


Link to post
Share on other sites

Blue, please read above post directed at brit.

<{POST_SNAPBACK}>

Meh.... there seems to be a lot of "RTFM" posts today.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Two questions:

1. Is it difficult to read the manual/help file?

If it is, tell us exactly what makes it hard so we can improve it.

2. Why do you ask questions and ask for examples when they all can be found in the help file?

If something is missing, tell us so we can improve it.

Thank you for taking the time to read this.

Share this post


Link to post
Share on other sites

Britbadboy,

InetGet is probably not in the version of AutoIt that you are using.

URLDownloadToFile is in v3.0.102 released (4th Aug, 2004)

v3.0.103 seems close to release and I think that the InetGet replacement for URLDownloadToFile is pretty stable. I would suggest using the beta version with InetGet

I realize that the first thing that comes to mind is to automate tasks exactly the way the human is doing it... and if that is easier for you to script, then look into sending your browser the correct number of tabs to get to where you want to "click" and then "press enter". You will have other hurdles to overcome if you go this route, but most of them can be overcome.

The "simulated human" scripts are still good teaching tools - URLDownloadToFile and InetGet are very efficient - but they "hide the magic".

have fun...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Yea, brit. Sorry about the flames, It gets a little annoying to see such a well-layed-out helpfile that nobody seems to read. If you aren't daft, then I apologise. No real offense intended. Keep trying. You may just make it after all.


Who else would I be?

Share this post


Link to post
Share on other sites

The "simulated human" scripts are still good teaching tools - URLDownloadToFile and InetGet are very efficient - but they "hide the magic".

have fun...

<{POST_SNAPBACK}>

Heh. "simulated human" is the only type of script that I can use with the software at my company....although there are a few that I can use ControlClick with.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

$size = WinGetPos($b)
$x = Round($size[2] * .22527)
$y = Round($size[3] * .39333333333333)

...

MouseMove($x, $y, 0); unnecessary, but it's insurance more than anything.
MouseClick($primary, $x, $y, 1, 0)

The was ratio is figured out by dividing the height of the window by the position we need to click at...That way, it doesn't matter what resolution the desktop is.

For example, if the window size is 800 * 600, and we need to click at 120 * 240 on our screen...but not sure where to click on the other user's.

then the x location ratio is: $x = Round($size[2] * (120/800))

rinse and repeat for the y:  $y = Round($size[2] * (240/600))

This really only works if the window will contain all the text you're looking for.

If you're trying to fill in a web-page, why not try sending {tab xxx} until you've highlighted the button or control that you want then send an {enter}?  It's cumbersome, but you don't have to worry about mouse positions.

<{POST_SNAPBACK}>

Hi there,

am back again, whilst I try to work with this screen ratio, it seems to get stuck without any response. Please have a look at my code's snippet.

Send("#r")

If WinWaitActive("Run") Then

Send("http://download/standardsoftware/win/bre60502en/bre60502en.html")

EndIf

Sleep(1000) ;pauses the program for 1 second.

Send("{Enter}")

Sleep(3000) ;pauses the program for 1 second.

Send("{PGDN}")

Sleep(2000)

Dim $b

$size = WinGetPos($:idiot:

$x = Round($size[2] * (60/1024))

$y = Round($size[3] * (400/768))

MouseMove($x, $y, 0);

MouseClick("")

regards,

Badboy.

Share this post


Link to post
Share on other sites

Hi there,

am back again, whilst I try to work with this screen ratio, it seems to get stuck without any response. Please have a look at my code's snippet.

Send("#r")

If WinWaitActive("Run") Then

Send("http://download/standardsoftware/win/bre60502en/bre60502en.html")

EndIf

Sleep(1000) ;pauses the program for 1 second.

Send("{Enter}")

Sleep(3000) ;pauses the program for 1 second.

Send("{PGDN}")

Sleep(2000)

Dim $b

$size = WinGetPos($:lmao:

$x = Round($size[2] * (60/1024))

$y = Round($size[3] * (400/768))

MouseMove($x, $y, 0);

MouseClick("")

regards,

Badboy.

<{POST_SNAPBACK}>

hi there,

please someone have a look and suggest me a way out!!!

regards,

Badboy.

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