Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Starting with AutoIt


  • Please log in to reply
74 replies to this topic

#21 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 12:24 AM

I don't read German at all (I don't even speak Enligsh very well...). Can you translate the main lines for me please, if it is so important ?







#22 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,686 posts

Posted 09 May 2008 - 12:29 AM

I don't read German at all (I don't even speak Enligsh very well...). Can you translate the main lines for me please, if it is so important ?

I don't know a word German (ok a few) but even so i don't have Firefox so unfortunately I can't help you with that :)

Edited by AdmiralAlkex, 09 May 2008 - 12:29 AM.


#23 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 12:30 AM

OK, maybe someone who speaks German will, then. And what about my questions @post 19, can't you help me with that either?

Edited by Elishac, 09 May 2008 - 12:44 AM.


#24 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 09 May 2008 - 01:14 AM

OK, maybe someone who speaks German will, then. And what about my questions @post 19, can't you help me with that either?

Something wrong with taking a little initiative and using an online translator like babelfish?

Edited by SmOke_N, 09 May 2008 - 01:14 AM.

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.


#25 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 01:19 AM

Here is another question (normally you can answer that one) :
I have to run a program. An error window might appear when i start this program. I want to treat that error.
What should I do ?
I want to use the winwaitactive function, in order to wait for the program to open, but if the error appears, the program won't open, and i don't know what to do, since the script is stopped during that time.
Let's say that the window's error is called "Error".
actual script (that does not treat the error) :
Run("Program")
WinWaitActive("Program window")
Winclose("ProgramWindow")
(I could use a "if" statement, if it was not for the "winwaitactive" function - this winwaitactive function is the problem)

I hope you have understood my question, as my English is not perfect. If not, please say so, I'll try to explain again.
Thanks

Edited by Elishac, 09 May 2008 - 01:28 AM.


#26 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 01:24 AM

And yet another one :
the window name of the program (which is firefox) has a name, but its name changes after a few milliseconds.
Can i do a command to window wait active for one window name OR (not and, I know how to do that: just use twice the command) another one? (in case the script isnt fast enough to get the first name)

#27 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 09 May 2008 - 01:27 AM

The only thing left is the FF.au3 ProgAndy linked to in post #8

Ha, that's great... I'll have to play with that au3, and their TCP stuff.

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.


#28 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 01:37 AM

Another one :
is there a goto/label function ? (a function that is composed of 2 parts : when the goto function is read, the script goes to the label function, and continues the script from there).
Example :
$n=1000
Label start
$n=$n+1
If (IsPrime $n) then Return($n) else goto start
(I'm not familiar with the autoit functions yet, so I don't know if the "isprime" and "return" functions exist, but i think you've understood that this script is supposed to give the first prime number that is greater than 1000 - which is 1009. Of course this could be done with a "while" function, but it was just an example.)
Does such a function exist, then ?

#29 DarthCookieMonster

DarthCookieMonster

    I ate your mom's cookie. Nom Nom Nom...

  • MVPs
  • 11,896 posts

Posted 09 May 2008 - 01:40 AM

I had to remove that post I put in when I found the FF.au3. That German text will be a pill to figure out.
Has Dale or Bigdaddy seen it?

Edited by Volly, 09 May 2008 - 01:40 AM.

The Vollatran project
_____


msg-108-0-96549500-1409901790.png
Obi didn't believe me when I told him the dark side has milk and cookies....


#30 DarthCookieMonster

DarthCookieMonster

    I ate your mom's cookie. Nom Nom Nom...

  • MVPs
  • 11,896 posts

Posted 09 May 2008 - 01:44 AM

Look here for understanding FF.au3
http://translate.google.com/translate?u=ht...en&ie=UTF-8

The Vollatran project
_____


msg-108-0-96549500-1409901790.png
Obi didn't believe me when I told him the dark side has milk and cookies....


#31 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 01:50 AM

3 more questions, and then i stop until you've answered them all :
- to use the mouse, i need to know its position. how do i know that ? (x and y go from what number to what number?)
- the function that gets the name of the active window is WinGetTitle, right ?
- I want the script to close any unwanted window (such as my firewall's questions) that might appear, during all the script. How can I make the script close it at anytime (not at a particular one) ?

Thanks again for your help.

#32 d2addict4

d2addict4

    Adventurer

  • Banned (NOT IN USE)
  • 107 posts

Posted 09 May 2008 - 01:51 AM

q2=WinActive("") will get the active title

#33 DarthCookieMonster

DarthCookieMonster

    I ate your mom's cookie. Nom Nom Nom...

  • MVPs
  • 11,896 posts

Posted 09 May 2008 - 01:52 AM

MouseGetPos
WinActive
Winclose

The Vollatran project
_____


msg-108-0-96549500-1409901790.png
Obi didn't believe me when I told him the dark side has milk and cookies....


#34 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 01:58 AM

1- when i'm not using the autoit script, i want to know the position of my mouse (in order to program it later on) - how do i do that ?
1- x and y go from what number to what number?.
2- ok for winactive.
3- i know that winclose will close the window at a certain time. but i want it to be closed at anytime, as soon as it appears. How to do that ?

#35 d2addict4

d2addict4

    Adventurer

  • Banned (NOT IN USE)
  • 107 posts

Posted 09 May 2008 - 02:04 AM

autoit window info tool with autoit

use a loop for the winclose

#36 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 02:14 AM

"autoit window info tool with autoit" gives the position of the mouse ?? (can you make full sentences please? it's hard to see what question you're answering to)
what loop ? Can you be more precise ?

#37 d2addict4

d2addict4

    Adventurer

  • Banned (NOT IN USE)
  • 107 posts

Posted 09 May 2008 - 02:16 AM

there is tool that comes with autoit program files\autoit3\autoit3windowinfo.exe it tells you where the mouse is at.

a loop is something that will keep going like this:

while 1
if winexists("") then winclose("")
wend

that will keep every window closed forever until the script is shut down

#38 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 09 May 2008 - 02:18 AM

Check your AutoIt3\Au3Info.exe .

There a bunch of tabs there, with a ton of info, just about everything you can want. I don't think we need to walk you though how to use 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.


#39 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 02:35 AM

- the tool that comes with autoit, program files\autoit3\autoit3windowinfo.exe, only gives me the x position, not the y. How do i get the y one too?
- I don't want all windows to be closed, just a specific one. Besides, I want it to be closed at anytime, whereas your script will only close the window if the "if" instruction is read. If there are 5000 lines of code, the "if instruction" will only work 1 time out of 5000. I want it to be closed during any command.
The example is simple : While using firefox, if a new window pops up (a window that wasnt launched by the script - for example, from another program, such as the firewall), I want the script to close that window, and then to continue as planned. I don't want to have to write, between each line, <<if winexists("") then winclose("")>>.

#40 Elishac

Elishac

    Adventurer

  • Active Members
  • PipPip
  • 126 posts

Posted 09 May 2008 - 02:49 AM

Let me repeat all my questions, and numerate them, so that it's easier for you to answer them :

a. Do you have an idea how to press a link on firefox, using some autoit functions (except : mouse click and tabulation) ?

b. Do you have an idea how to get what is written on Firefox on the bottom-left of the firefox window (where the url appears) ?

c. Do you have an idea how to know if some text is selected ? I want to use ctrl+F to search for a word, but afterwards, how can I access to the string that is selected (I'd want to click the link right above that word). Is there a function or any other way to get the mouse to the selected text ?

d. I have to run a program. An error window might appear when i start this program. I want to treat that error.
What should I do ?
I want to use the winwaitactive function, in order to wait for the program to open, but if the error appears, the program won't open, and i don't know what to do, since the script is stopped during that time.
Let's say that the window's error is called "Error".
actual script (that does not treat the error) :
Run("Program")
WinWaitActive("Program window")
Winclose("ProgramWindow")
(I could use a "if" statement, if it was not for the "winwaitactive" function - this winwaitactive function is the problem)

e. When Firefox starts, its window name changes changes after a few milliseconds.
Is there a command to wait for one window name OR another to appear ?

f. Is there a goto/label function ? (a function that is composed of 2 parts : when the goto function is read, the script goes to the label function, and continues the script from there).
Example :
$n=1000
Label start
$n=$n+1
If (IsPrime $n) then Return($n) else goto start
(I'm not familiar with the autoit functions yet, so I don't know if the "isprime" and "return" functions exist, but i think you've understood that this script is supposed to give the first prime number that is greater than 1000 - which is 1009. Of course this could be done with a "while" function, but it was just an example.)
Does such a function exist, then ?

g. how do i know my mouse position, when I'm not using any script ?

h. The x and y position numbers go from what number to what number?

i. I want my script to close any unwanted window (such as my firewall's questions) that might appear, during all the script. How can I make the script do that, at anytime ?



I hope you have understood all my questions, as my English is not perfect. If not, please say so, I'll try to explain again.
Thanks

Edited by Elishac, 09 May 2008 - 02:50 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users