Jump to content

Script will Click to link


kater
 Share

Recommended Posts

I think you didn't understand me :)

I'm very new in AutoIt v3 and I'm now under learning

can you please help me step by step how to do that script

I'm here as the student ;) and you are my teacher ;) , teach me please ;)

Edited by kater
Link to comment
Share on other sites

Thank you for your fast replay , But I didn't mean like this !! ;)

My idea is :

I want from the script to open the home page http://www.autoitscript.com/forum

and I want form the script go to this link General Help and Support and clike it

Can we do that or no ? your kind advice is very important for me :)

it depends from what you need to what youl get

you need mouse click (to see mouse click the link) or redirect on ie to that page?

ether way heare r your advices from the help file

_IECreate

--------------------------------------------------------------------------------

Create an Internet Explorer Browser window.

_IENavigate

--------------------------------------------------------------------------------

Directs an existing browser window to navigate to the specified URL.

_IELinkClickByIndex

--------------------------------------------------------------------------------

Simulate a mouse click on a link by 0-based index (in source order).

_IELinkClickByText

--------------------------------------------------------------------------------

Simulate a mouse click on a link with text sub-string matching the string provided.

MouseClick

--------------------------------------------------------------------------------

Perform a mouse click operation.

MouseMove

--------------------------------------------------------------------------------

Moves the mouse pointer.

every command have Example so start reading and testing the commands

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

hello !

Misha's script is the better way to obtain the final result.

But if you want to know how to locate a special link and click it, there are no general way.

The easier is to count the number of "tab" key to send and send ENTER when the last is reached.

You can use external information like statusbar too, by moving the mouse, but it's approximative :

Opt("WinTitleMatchMode", 2)

#include <IE.au3> 
Hotkeyset("{F5}","OpenSite")
Hotkeyset("{ESC}","My_exit")

while 1
sleep(100)
wend

Func OpenSite()
$oIE=_IECreate ("http://www.autoitscript.com/forum")
ConsoleWrite(WinSetState("AutoIt Forum","",@SW_MAXIMIZE))
_IELoadWait ($oIE)
send("{F11}"); full screen to avoid to manage the vertical scroll bar ...

$y_pos=0; start from the top of the screen
Do
    MouseMove(150,$y_pos); 150 is an approximation of the x position of the link ... so you're dependinf of the screen resolution
    $y_pos+=5; a step of 5 pixels is enough
    $txt=StatusbarGetText ("AutoIt Forum","",1); case for ie
    ConsoleWrite($txt&" "&@error&@CRLF); only for debug ...
Until StringRegExp($txt,"http://www\.autoitscript\.com/forum/index\.php[\?s=[\da-f]+&]{0,1}showforum=2")<>0
;s=125a.... is a php session id which is contains in the output of StatusbarGetText, thanks to regexp :-)

MouseClick("left"); the famous click !!!!!
send("{F11}")
exit 0
EndFunc

Func My_exit()
    exit 1
EndFunc

Now, choise one practice or find another way ( it's better, you wanted to be teached, now work! :) )

Link to comment
Share on other sites

Look at the helpfile and the _IELinkClickByText - the first example should get you going.

#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com/forum")
_IELinkClickByText($oIE, "General Help and Support")

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Excellent idea :)

we need to do like this configuration in Remote Assistance

as the following code but there is problem

can you please advice me how to fix the problem in the existing code

[size="5"][size="2"]run("C:\windows\system32\rcimlby.exe -LaunchRA")
 Sleep(5000)
 _IELinkClickByText($oIE, "Invite someone to help you")

[/size][/size]

we need after open the link click to Invite someone to help you

Link to comment
Share on other sites

you have not specified what is $oIE ... it must be an object variable of an InternetExplorer

keep in mind that you have to create this object before use it.

But remeber that it's an IE object, so i don't know (and think that's not the case...) if it's realy applicable to rcimlby.exe

Edited by sylvanie
Link to comment
Share on other sites

how about something like this

run("C:\windows\system32\rcimlby.exe -LaunchRA")
;<== or you can use run("C:\WINDOWS\pchealth\helpctr\Vendors\CN=Microsoft Corporation,L=Redmond,S=Washington,C=US\Remote Assistance\Escalation\Common\rcscreen2.htm")
;its the same thing only that in second case it will start ie and the call the help function
;or try to this, i dono will it work run("C:\WINDOWS\pchealth\helpctr\Vendors\CN=Microsoft Corporation,L=Redmond,S=Washington,C=US\Remote Assistance\Escalation\Common\rcscreen3.htm")
WinWaitActive("Help and Support Center")
Sleep(1000)
Send("{tab 27}") ;<== if you use html run then youl need lower number 8 or 9 tabs 
Send("{ENTER}")

edit: i forgot to remove include up there ^^

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

I have this solution but is not accurate ;)

when me wants to do this code in another PC I'll facing some problems is not accurate can you tell me another solution if there

I want the script to go direct to the link :)

I waiting your advice

Link to comment
Share on other sites

we are waiting a Perfect solution

:)

you can try this and i hope its working, i tested it on xp pro sp2 on every resolutio, and its clicking the option number so if your option is on the 1 place he will click it if you enter number 1 or 2 for 2 or 3 for 3.....

$answer = InputBox("Question", "On What Link number to Click")
Select
    Case $answer = ""
        Exit
    Case $answer = 1
        $data = 0
    Case $answer >= 1
        $data = ($answer*38)-38
EndSelect
MsgBox(0,"","Now we will click on "&$answer&" option")
run("C:\windows\system32\rcimlby.exe -LaunchRA")
While 1
    Sleep(100)
    Select
    Case WinActive ( "Help and Support Center" )
        Sleep(500)
        WinSetState( "Help and Support Center", "", @SW_MAXIMIZE)
        Sleep(500)
        $MousePos = PixelSearch(0,200,800,600,"0xB2D8B2", 8)
        MouseMove($MousePos[0],$MousePos[1]+$data,1)
        MouseClick ( "left" )
        Exit
    EndSelect
WEnd

and you can write your text with normal black color and normal size fonts, noone heare is blinde.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Good solution ;)

I want this solution but don't like to ask me any question

I want to click to the first option without any question

Can you please tell me how to modify that in the existing code :)

instead of

$answer = InputBox("Question", "On What Link number to Click")

put

$answer = "1"

or

$answer = "2"
for second link or what ever

and delite line

MsgBox(0,"","Now we will click on "&$answer&" option")

and youl have your click with no question asked.

For the rest of your script (if you need something more)i sugest to read more in help file and redesinge it to your needs. If you get stuck on your codes i think that everyone will b glad to help as loong as you put the part of the code you have problems with on your topic.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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