Jump to content

Simple click thing.


Recommended Posts

I have been trying to get a script that will go to a link in a page and left click on it and select open in new window i have been insuccesfull this is the script i have been using

#include <IE.au3>
; Create a browser window and navigate to a website
$oIE = _IECreate()
_IENavigate($oIE, "http://www.mywebsite.com")

HotKeySet("{ESC}", "quit")
While 
MouseMove (900, 700, 50)
Sleep(1000)
MouseClick ("right", 900,700,2,50)
WEnd

Func quit()
Exit
EndFunc

help would be apreciated

Edited by tang
Link to comment
Share on other sites

maybe...

#include <IE.au3>
; Create a browser window and navigate to a website
$oIE = _IECreate ()
_IENavigate ($oIE, "http://www.mywebsite.com")

HotKeySet("{ESC}", "quit")
While 1
    MouseMove(900, 700)
    Sleep(1000)
    MouseClick("right", 900, 700, 2)
WEnd

Func quit()
    Exit
EndFunc  ;==>quit

use

[ code ] ; no spaces

; post your code

[ /code ]

to show us your code in the box

8)

NEWHeader1.png

Link to comment
Share on other sites

I see i have a uptade in script but it still dosent work i tried yor script but the problem is it keeps clicking left there needs to be something that stops it from click it left move the mose to open in new window and click.

#include <IE.au3>
; Create a browser window and navigate to freewebs
$oIE = _IECreate()
_IENavigate($oIE, "http://www.freewebs.com")

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

While  1
MouseClick("right", 409, 489)
Wend

While  1
MouseClick("left", 439, 514)
Wend


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc
Edited by tang
Link to comment
Share on other sites

Surely this

While  1
MouseClick("right", 409, 489)
Wend

While  1
MouseClick("left", 439, 514)
Wend

should be something like

While  1
MouseClick("right", 409, 489)
MouseClick("left", 439, 514)
ExitLoop
Wend

Once the code goes into the first loop it will just stay there right clicking


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Surely this

While  1
MouseClick("right", 409, 489)
Wend

While  1
MouseClick("left", 439, 514)
Wend

should be something like

While  1
MouseClick("right", 409, 489)
MouseClick("left", 439, 514)
ExitLoop
Wend

Once the code goes into the first loop it will just stay there right clicking

Who's Shirley?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Who's Shirley?

????????? :o


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Sorry... bad joke... Surely = Shirley ... didn't mean to hijack the thread, just saw humor in it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Sorry... bad joke... Surely = Shirley ... didn't mean to hijack the thread, just saw humor in it.

No problem, I must have had my humor gene switched off. Thats what happens when you spend the day fighting with a Dell computer.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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