Sign in to follow this  
Followers 0
t0ddie

Script Help Please

10 posts in this topic

i pretty much read the entire help file, and did some searches in it. i think version 3 is a little harder than version 2, but thats just because im not used to it i guess.

i made this code that doesnt work, lol

WinMove("Meet Me at HOT or NOT - Mozilla Firefox","",-2000,-2000)

While $var = 1

ControlLeftClick("Meet Me at HOT or NOT - Mozilla Firefox","","YES")

sleep (5000)

Wend

what i want to do basically, is automate pressing y on the browser window, (hot or not is the site) over and over, but keep that window off of the desktop, or minimized, or just not active. so that i am able to do other things while the script is executing.

i opened the autoit spy window, but there is no control name for clicking yes.. (pressing "y" is a hotkey on the site, and does the same thing as clicking "YES")

i just want to select yes over and over.. and have it not interupt what i am doing on the computer.

thanks for any help in advance.

~T0ddie


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



Hi,

Site is down at the moment for maintenance.

When unp and running i'll have a look at it.

Andre


What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

Site is down at the moment for maintenance.

When unp and running i'll have a look at it.

Andre

<{POST_SNAPBACK}>

hey, thanks alot Andre. i just noticed they shut the site down, heh.. nice timing. anyways...

since i got my new computer, i foolishly forgot to save all the old autoit 2 scripts i created, but i would like to start fresh with autoit 3, and learn the ways of the wise :ph34r:

i was wondering also, since i have no idea where to start, if the script could be made to support more than one browser, like a matchmode or something, where it detects similar window titles, and doesnt have to be exact..

and so that it can detect if the window exists, and if it doesnt, to pause script execution, access the site, and continue.

if this is easily accomplished, i would be grateful for your help. otherwise, i dont want to be too much of a bother. thanks!

~T0ddie

EDIT: ooh! the site is back up.. heh

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

what i want to do basically, is automate pressing y on the browser window, (hot or not is the site) over and over, but keep that window off of the desktop, or minimized, or just not active. so that i am able to do other things while the script is executing.

i opened the autoit spy window, but there is no control name for clicking yes.. (pressing "y" is a hotkey on the site, and does the same thing as clicking "YES")

<{POST_SNAPBACK}>

A web browser uses controls, but the "data" portion of the window (the huge section where the web pages are displayed) is a single control, not seperate controls. This means that if you want to ControlSend to it, you need to send to the whole control; you cannot just send to a particular web page element.

However, if the hotkey is something the web browser assigns, then maybe using a ControlSend to the proper control would do the trick.

If not, you can use the tab key to move between elements in a browser window so that you can tab to the proper button. Then "press" it by using the enter key. Firefox also has some nice hyperlink and text searching features that are activated simply by sending text to the window, so you could send the first few letters of a word near the button, and then tab to it. This method is a good choice if there are ads, or other variable elements to the web site because it will get close to the button before you have to use the tab key (or shift-tab to go backwards.)


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

ok, im getting into this.. pretty cool

the errors are much bigger than version 2.. scary!

anyways, heres what i got.

the problems are..

it does NOT move the window, and then i get an error. whats the deal here?

dim $var = "1"

sleep (5000)

WinActivate ( "Meet Me at HOT or NOT - Mozilla Firefox")

sleep (5000)

WinMove("Meet Me at HOT or NOT - Mozilla Firefox","",-2000,-2000)

While $var = 1

controlsend("Meet Me at HOT or NOT - Mozilla Firefox",, "MozillaWindowClass7", "y" [,1] )

sleep (5000)

Wend

heres what i get

line 6 (my path and script)

WinMove("Meet Me at HOT or NOT - Mozilla Firefox",,-2000,-2000)

WinMove("Meet Me at HOT or NOT - Mozilla Firefox",^ERROR

error: error in expression.

i get the same kind of error when i try to run the controlsend command also. is my syntax wrong?

well, it would be cool to see the error of my ways. what is wrong with this code?

again, i am in need of assisstance... THANKS! the check is in the mail

~T0ddie

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If you don't want to specify the text then enter "" like

WinMove("Meet Me at HOT or NOT - Mozilla Firefox","",-2000,-2000)

not

WinMove("Meet Me at HOT or NOT - Mozilla Firefox",,-2000,-2000)

:ph34r:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

your right, i had it like that the first time, but it didnt move the window. i changed it a little, i was playing around with it.

but i changed it back, to the correct syntax now.i dont get the error anymore, but the window STILL does not move.

the script (suposedly) executes the command (does nothing that i can see) but then goes to the next line and i get the error again, for the controlsend command.

heres what i got for my script so far

dim $var = "1"

sleep (5000)

WinActivate ( "Meet Me at HOT or NOT - Mozilla Firefox")

sleep (5000)

WinMove("Meet Me at HOT or NOT - Mozilla Firefox","",-2000,-2000)

While $var = 1

controlsend("Meet Me at HOT or NOT - Mozilla Firefox","", "MozillaWindowClass7", "y" [,1] )

sleep (5000)

Wend

so yeah, what am i doing wrong? i run xp pro

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

You have [-1] in the ControlSend() statement, which is invalid. Don't include the brackets for optional parameters.

Share this post


Link to post
Share on other sites

i had the brackets removed before, because it didnt work, and i just now removed them , i got it to work.

as for moving the window, i had seen that larry posted the winmove code in a different post in this forum, for moving the window off of the desktop. i just used his example. its supposed to move the window off of the desktop, so that you cant see it.

doesnt matter though, the command works flawlessly while the window is minimized

thanks!

~T0ddie


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

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