Jump to content

mouseclick - how to get it to clicking north of the cordinates


Recommended Posts

Hey guys, quick question..

how can i get the mouseclick to also click once abit north of the current pos.

reson im asking is becouse im using a script that clicks on user set mousecords, and sometimes it fails becouse the box changes posistion,

the main code that is running after the person input X & Y cords is this.

sleep (3000)
   mouseclick ("Left",GUICtrlRead($xpos1), GUICtrlRead($ypos1)) ;<- button 1
        sleep (1500)
        send ("{PGDN}")
        sleep (1500)
        mouseclick ("Left", GUICtrlRead($xpos2), GUICtrlRead($ypos2)) ;<-button 2
        sleep (1500)
        send ("{Enter}")
        sleep (5000)
Link to comment
Share on other sites

Hey guys, quick question..

how can i get the mouseclick to also click once abit north of the current pos.

reson im asking is becouse im using a script that clicks on user set mousecords, and sometimes it fails becouse the box changes posistion,

the main code that is running after the person input X & Y cords is this.

sleep (3000)
   mouseclick ("Left",GUICtrlRead($xpos1), GUICtrlRead($ypos1)) ;<- button 1
        sleep (1500)
        send ("{PGDN}")
        sleep (1500)
        mouseclick ("Left", GUICtrlRead($xpos2), GUICtrlRead($ypos2)) ;<-button 2
        sleep (1500)
        send ("{Enter}")
        sleep (5000)
You could just repeat the click at Y - 10 (or however much "north" you want). But if it's a GUI control you are clicking on, you should be able to ControlClick() on it no matter where it is. What kind of "box" is it you are clicking on?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You could just repeat the click at Y - 10 (or however much "north" you want). But if it's a GUI control you are clicking on, you should be able to ControlClick() on it no matter where it is. What kind of "box" is it you are clicking on?

:)

well it is a website, and it is a general action box, like "post reply",

the thing is, that the box changes between two positions at random refresh'es.

so the first pos is what the user puts in, and the second needs to be abit higher,

so do i need to rewrite the entire script, or is there a quickfix to that problem that it just do two clicks at each pos, foreaxmple: if the user types in x & y 400,200, it first clicks at those cords, then say 20 above, so 400, 220?

Link to comment
Share on other sites

well it is a website, and it is a general action box, like "post reply",

the thing is, that the box changes between two positions at random refresh'es.

so the first pos is what the user puts in, and the second needs to be abit higher,

so do i need to rewrite the entire script, or is there a quickfix to that problem that it just do two clicks at each pos, foreaxmple: if the user types in x & y 400,200, it first clicks at those cords, then say 20 above, so 400, 220?

If it's an HTML form/image, you can use _IEAction or the _IELinkClickBy... functions.

If it's Flash-based or some other embedded object, you may have to use PixelSearch to locate the box.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

If it's an HTML form/image, you can use _IEAction or the _IELinkClickBy... functions.

If it's Flash-based or some other embedded object, you may have to use PixelSearch to locate the box.

well the sourcecode for that button is this

"<input type="submit" value="Slett" style="width:100px;margin-top:3px;" class="button" onclick="if (confirm('Vil du virkelig slette meldingene?')) return true; else return false;">"

but i kinda just want it to do 2 clicks instead of writing a entire new script

Link to comment
Share on other sites

well the sourcecode for that button is this

"<input type="submit" value="Slett" style="width:100px;margin-top:3px;" class="button" onclick="if (confirm('Vil du virkelig slette meldingene?')) return true; else return false;">"

but i kinda just want it to do 2 clicks instead of writing a entire new script

It might just need _IEFormSubmit(). Read up on the _IE* functions in the help file and try the three different examples under _IEFormSubmit().

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

well it is a website, and it is a general action box, like "post reply",

the thing is, that the box changes between two positions at random refresh'es.

so the first pos is what the user puts in, and the second needs to be abit higher,

so do i need to rewrite the entire script, or is there a quickfix to that problem that it just do two clicks at each pos, foreaxmple: if the user types in x & y 400,200, it first clicks at those cords, then say 20 above, so 400, 220?

400, 220 is 20 "below".

20 "above" should be 400, 180 :) Since you are going "north", Y-Pos should decrease.

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...