AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Browser + Mouse Script

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Mon Nov 02, 2009 12:53 pm    Post subject: Help with Browser + Mouse Script Reply with quote

Hello everyone,

I tried to use search and wiki too but no one exactly matches this request,
since I'm not used to AHK plus in time hurry I decided to make a new tread


Ok here my problem:

I want AHK to simply click between 3 positions in an 60s time interval.
But it needs to be based on Coordination not simply record and click.
So how do I figure out how to actually set the coords? It's kinda hard
to understand if you never used this progam lol...

The Program is internet Explorer

Thank you very much for help guys
regards
Back to top
View user's profile Send private message
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Mon Nov 02, 2009 1:41 pm    Post subject: Reply with quote

anyone? Crying or Very sad
Back to top
View user's profile Send private message
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Mon Nov 02, 2009 1:43 pm    Post subject: Reply with quote

If you use the Window Spy tool that comes installed with AHK, that will tell you the position of the mouse both relative to the screen, and also relative to the window.

This should give you the co-ords you need to click
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Nov 02, 2009 1:45 pm    Post subject: Reply with quote

Are you wanting to click on specific elements on a webpage?
Back to top
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Mon Nov 02, 2009 3:55 pm    Post subject: Reply with quote

Yes Actually its something like this


show pages:


<1-60> <61-120> etc...


the Script should loop between the content on a 60s base.

so what Ive got so far is:


#IfWinActive Site XYZ - Windows Internet Explorer
ControlClick, x818 y931,
return
(delay??)
ControlClick, x855 y931,
return
(delay??)
(loop??)

The (??) means I dont know yet how to set this command how it should

Thanks to Ocean alleady the Spy tool is really good
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Mon Nov 02, 2009 4:06 pm    Post subject: Reply with quote

OceanMachine's answer is going to be the easiest to understand. However, the most effective way is going to be using COM (since you're using IE) or Javascript. For example, if your at Google.com and you navigate to the following code, you will click on the Google Search button:
Code:
javascript: document.all.btnG.click()

_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Tue Nov 03, 2009 7:05 am    Post subject: Reply with quote

Yea cool, but how do I know the source of the buttons I need to click?
Back to top
View user's profile Send private message
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Tue Nov 03, 2009 8:43 am    Post subject: Reply with quote

maybe some one some time is going to help me instead of reffering to help file...


Code:
CoordMode, Mouse
loop
{
Sleep, 10000
Click x827, y955
Sleep, 10000
Click x855, y955
Sleep, 10000
}


What am I doing wrong... it doesnt work like this it simply clicks but
without the coords...


[/quote]
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Tue Nov 03, 2009 1:44 pm    Post subject: Reply with quote

Rizzit wrote:
Yea cool, but how do I know the source of the buttons I need to click?
Perhaps learn a little javascript. Here are some tools that could help as well (1,2)

Rizzit wrote:
What am I doing wrong... it doesnt work like this it simply clicks but
without the coords...
Are your coords based on the screen, or based on the active window? If you haven't changed them to be relative to the screen, they are relative to the active window by default.
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Rizzit



Joined: 02 Nov 2009
Posts: 19

PostPosted: Tue Nov 03, 2009 2:23 pm    Post subject: Reply with quote

Actually my fault was that i first started for screen coords, then changed
on active window and didnt see the syntax change, as those have 2
different parameters. It is very difficult to get sorted with this tool but
thanks for your advice friend it helped me to find my error.


My script is working very well now, it launches Internet explorer logs in to
the verification website, logs in automatically and swaps between sites as I want it.


Code:
#NoEnv

F4::
MsgBox, 1,, Start VideoControl (Cancel to stop)
IfMsgBox OK
    MsgBox Launching VideoControl Monitoring
    run iexplore
    Sleep, 10000
    Send, username{TAB}
    Send, password{ENTER} ; Auto Login Sequence
    Sleep, 6000
    Click 63, 240
    Sleep, 60000 ; Thumbview actualizing time

loop
{
Sleep, 60000
Click 855, 955
Sleep, 60000
Click 825, 955
}



Now I would like to implement a Stop and/or Pause function.
Also I would like to implement a function to maximize the window if its not.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group