Sign in to follow this  
Followers 0
kater

Script will Click to link

27 posts in this topic

#1 ·  Posted (edited)

Hi Guy's

we need to create a new Script to do as the following

> Script Open this site http://www.autoitscript.com/forum

> And it will Click to this link General Help and Support

How to do that by AutoIt v3

Please your advice !!

Edited by kater

Share this post


Link to post
Share on other sites

wat have you tried so far?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


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

Share this post


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

 

Share this post


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


Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Perfect solution ;)

but let me ask you this question

Is there any step to let the script to going direct to the link ? :)

Edited by kater

Share this post


Link to post
Share on other sites

BodQ has suggested _IELinkClickByText, see the sample in the chm help, and you'll have another faster and easier way to do it


Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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.

 

Share this post


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

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

we are waiting a Perfect solution

:)

Edited by kater

Share this post


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

 

Share this post


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

Share this post


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

 

Share this post


Link to post
Share on other sites

I facing some error's :)

I'm very sorry but Can you please modify the code and put it here again to show me

I'm very sorry again

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