Nareshm

Help for create autoit script

11 posts in this topic

#1 ·  Posted

Please Somebody Help me i am trying to create new script but, i don't know how to create it.

I am Creating script like this :
; My script here [First Script]
Check the internet connection, if internet connected then
; My Script here [Second Script]
If internet not connected, wait for connect, after connected run my second script
If Control id/windows/title matched do nothing and end/exit autoit script
If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched

match with :

>>>> Window <<<<
Title:    PS :: Version - 2.8.0.0  - [PS Bill]
Class:    WindowsForm734a
Position:    -8, -8
Size:    1382, 744
Style:    0x17CD0000
ExStyle:    0x00050100
Handle:    0x0000000000130572

>>>> Control <<<<
Class:    WindowsForm734a
Instance:    15
ClassnameNN:    WindowsForm34a15
Name:    BillPrint
Advanced (Class):    [NAME:BillPrint]
ID:    7875
Text:    
Position:    39, 310
Size:    1221, 306
ControlClick Coords:    745, 20
Style:    0x56010000
ExStyle:    0x00000000
Handle:    0x00000000000C0468

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

How much can you pay for your problem to be solved?

No code, no help!

Search and try, just ask when necessary!

- Check the internet connection:

#include <WinAPIDiag.au3>

ConsoleWrite('Internet connected: ' & (_WinAPI_IsNetworkAlive() <> 0) & @CRLF)


- Check  windows:

WinExists("PS :: Version - 2.8.0.0  - [PS Bill]")

 

If...ElseIf...Else...EndIf Conditionally run statements:

If <expression> Then
statements
...
[ElseIf expression-n Then
[elseif statements ... ]]
...
[Else
[else statements]
...
EndIf

 

- Loop Script:

While <expression>
statements
...
WEnd
Do
statements
...
Until <expression>
For <variable> = <start> To <stop> [Step <stepval>]
statements
...
Next

 


Regards,
 

Share this post


Link to post
Share on other sites

#3 ·  Posted

7 minutes ago, VIP said:

How much can you pay for your problem to be solved?

No code, no help!

Uh? ...  Why do you feel you have the rights to make that statement ....  and then still provide some code?

Jos


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

#4 ·  Posted

9 minutes ago, VIP said:

How much can you pay for your problem to be solved?

No code, no help!

Search and try, just ask when necessary!

- Check the internet connection:

#include <WinAPIDiag.au3>

ConsoleWrite('Internet connected: ' & (_WinAPI_IsNetworkAlive() <> 0) & @CRLF)


- Check  windows:

WinExists("PS :: Version - 2.8.0.0  - [PS Bill]")

 

If...ElseIf...Else...EndIf Conditionally run statements:

If <expression> Then
statements
...
[ElseIf expression-n Then
[elseif statements ... ]]
...
[Else
[else statements]
...
EndIf

 

- Loop Script:

While <expression>
statements
...
WEnd
Do
statements
...
Until <expression>
For <variable> = <start> To <stop> [Step <stepval>]
statements
...
Next

 

I don't Understand this please explain how to do it ?

Share this post


Link to post
Share on other sites

#5 ·  Posted

Just now, Nareshm said:

I don't Understand this please explain how to do it ?

See my post in the other thread! Stop begging for code and study the Helpfile/ answers given in an effort to comprehent then. 
It can't be you have actually spent time trying to understand this!

Jos


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

#6 ·  Posted

4 minutes ago, Jos said:

See my post in the other thread! Stop begging for code and study the Helpfile/ answers given in an effort to comprehent then. 
It can't be you have actually spent time trying to understand this!

Jos

@Jos
I tried but every time i am fail, I am finished i can't try more

Share this post


Link to post
Share on other sites

#7 ·  Posted

Ok, let me make myself very clear: 

It can't be that you get that extensive answer from @VIP and you answer within 10 minutes that you can't get it to work. This simply means you have tried hard enough to understand, open the helpfile and read, open SciTE and try ... etc ....  There is no way this is possible!
So again: Try harder!

Jos


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

#8 ·  Posted

1 minute ago, Jos said:

Ok, let me make myself very clear: 

It can't be that you get that extensive answer from @VIP and you answer within 10 minutes that you can't get it to work. This simply means you have tried hard enough to understand, open the helpfile and read, open SciTE and try ... etc ....  There is no way this is possible!
So again: Try harder!

Jos

@Jos
i try to make script before then i post my question and main problem is i can't understand english very well

Share this post


Link to post
Share on other sites

#9 ·  Posted

Jos

16 minutes ago, Jos said:

Uh? ...  Why do you feel you have the rights to make that statement ....  and then still provide some code?

Jos

Why do I need power when declaring anything?
If anything I say violates regulations and rules of the forum please behave as prescribed!

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

Nareshm

2 minutes ago, Nareshm said:

@Jos
i try to make script before then i post my question and main problem...

You want to be helped, you need to show others your efforts!
I do not see any of your code here!

Your difficult problem it looks like this:

#include <WinAPIDiag.au3> ; for function check internet connect

While 1 ; repeat your script!
    If WinExists("PS :: Version - 2.8.0.0  - [PS Bill]") Then ExitLoop
    ;===> Your first script here
    If _WinAPI_IsNetworkAlive() Then
        ;===>  Your second scrip here
    Else
        ContinueLoop 
    EndIf
    Sleep(1000) ; delay 1s for internet chekc
WEnd
;===>  End your script here

 


Regards,
 

Share this post


Link to post
Share on other sites

#10 ·  Posted

Just now, VIP said:

Why do I need power when declaring anything?

You don't, but you are acting like you are a longtimer on this forum, which you aren't ...right? 
We do always appreciate people trying to help out, which you clearly are! 

Jos 

 


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

#11 ·  Posted

@Jos
please give a some time i trying to make script

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

  • Similar Content

    • sree161
      By sree161
      Hi,
      i have a code which generates two numeric outputs.i have to save them in excel.
      Is there any way to export them to specific cells in excel???
    • TotalAuto
      By TotalAuto
      Howdy All
      I've gone around and around in circles wasting hours trying to fix this problem to no avail so I thought I would try posting for help given there are some real smart people in this forum.
      Background
      I have 5 separate .au3 scripts that all do different basic tasks. For example:
      1.au3 = opens Chrome browser to obtain information from a specific website then closes
      2.au3 = opens an Excel workbook to run a macro then saves and closes
      3.au3 = Open two seperate workbooks and transfers data from one to the other then saves and closes
      4.au3 = .......etc
      5.au3 = .......etc
      These 5 separate scripts, doing completely different tasks, need to each run once per day at 5 different designated times within a day and then close. For example:
      1.au3 = 10am
      2.au3 = 12pm
      3.au3 = 2pm
      4.au3 = 4pm
      5.au3 = 5pm
      Problem
      I can not get these different scripts to reliably run at their designated times. When I manually run these scripts individually by using 'Go F5' they work perfectly. If I convert these scripts to an .exe and manually run each one they work about 98% of time.
      How can I schedule these different .au3 files or associated .exe files to reliably run each day at different times?
      Attempts To Fix The Issue
      1. I have tried converting each .au3 script into their own .exe file and use Window's Task Scheduler to run these .exe files at their designated time but the success rate  of running each .exe in full, to completion, without error is very low at about 30%. Things that commonly go wrong include a browser not opening but movement still continues on the desk top. Other times things just do not happen at all.
      2. I have Windows 7 64 bit and have tried creating and running both (x86) and (x64) .exe files but again reliability problems exist;
      3. I have also tried moving each .exe file to the My Documents folder as I read someone that keeping your files on your desktop ties your files to individual Windows user profiles which can cause AutoIt operating errors. Not sure if this is correct but thought I would try it anyway. It did not fix my issue.
      4. I installed a program called AlwaysUp which supposedly always reliably runs in the background and will reliably execute your AutoIt script or .exe files. Still have significant reliability issues.
      Therefore, can someone please provide advice on how I can get my 5 different .au3 files to run at 5 designated times through the day, every day, without fail? Overtime I will be creating more and more different .au3 files to run certain tasks throughout the day and do not want to create one large AutoIt file that continually runs and attempts to do all the different tasks itself.
      Any help is very appreciated.
      Thanks
      Dan
       
       
    • hugomito
      By hugomito
      Hi all,
      I built an AutoIt application that interacts with several other applications/software. Now, it's turn to interfact with Visual Studio Team Services (VSTS).
      Does anyone has a blog, demo, script to share?
      Thanks!
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone
      I worked a bit on a little project of mine, and I managed to do what I was trying to do, or, automate a quiz in AutoIt.
      Now, everything works fine but, in order to achieve what I'm trying to achive, I'd like to make this script run faster.
      I'll attach a portion of the code in order to let you understand what my script does.
      $objIE_h1 = _IETagNameGetCollection($objIE, "h1") ; Take the text of the answer If @error Then ConsoleWrite("Errore durante la lettura degli h1 nella pagina. - Errore: " & @error & @CRLF) Else For $objElement In $objIE_h1 $strInnerText = $objElement.innerText Next Select Case StringInStr($strInnerText, "QUESTION") ; Here is the question ; PS4 PRO $objSpans = _IETagNameGetCollection($objIE, "span") ; Answers are stored here For $objElement In $objSpans If $i >= 4 Then $strAnswer = $objElement.innerText ; Take the text of the answer n° 0, 1, 2, 3 If StringInStr($strAnswer, "CORRECT ANSWER") Then ; If I match the correct answer, then, I have to click on the input with answer id = answer_i $j = $i - 4 $objInput = _IEGetObjById($objIE, "answer_" & $j) If @error Then ConsoleWrite("Errore durante la lettura della risposta #" & $i & " - Errore: " & @error & @CRLF) Else _IEAction($objInput, "click") If @error Then ConsoleWrite("Errore durante il click sull'elemento. - Errore: " & @error) Else ConsoleWrite($j & ") Risposta: " & $strAnswer & @CRLF) ExitLoop EndIf EndIf EndIf $i+=1 Else $i+=1 EndIf Next $i = 0 $j = 0 This is what my script does.
      Questions are 20, in which I have 15 multiple choice question, 2 images ( on which I use _IEImgClick() ), and 3 text inputs ( a simple send with the text I have to enter ).
      How can I make all of these, faster?
      If I reach this goal, I've probably done one of my best goals in life, and I'd like to share my happiness with you, giving a huge donation to this fantastic community!
      Thanks for your help
    • Viki
      By Viki
      This is my first time here so please dont bombard me that what a silly question I am asking!!
      I have 500 rows (A1:A500) in a spreadsheet and I just want to copy one by one row and then paste into another application and then press enter, loop should repeat this until finishes all 500 rows.
      I have looked at clipget(), clip(put() but dont know how to select next row in next turn. I also looked at Array to store but again no luck. Can some guide me please..