Jump to content

Setting up CI on GitHub for autoit scripts?


Recommended Posts

Added solution here: 

 

 

Hi all,

I'm attempting to setup CI on github for several of my projects. I've encountered a few issues I've been able to solve (namely tools exiting before they're complete), but my current issue is that I can't seem to get #AutoIt3Wrapper headers to be parsed. Unlike AU3Check and Aut2exe, using the same parameters SciTE shows being used does not seem to work. I'm wondering if I'm doing something wrong? Any advice on the matter is appreciated, and my CI yml is below.

name: lili

on: 
 push:
   paths-ignore:
     - '.github/**'
     - '!.github/workflows/**'
     - '*.md'

jobs:
  build:

    runs-on: windows-latest
    steps:
    - name: Install Autoit
      run: |
           Invoke-WebRequest -Uri https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe -OutFile autoit-v3-setup.exe
           ./autoit-v3-setup.exe /S
    - name: Checkout repo
      run: |
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe
           git clone https://github.com/rcmaehl/LinuxLiveUSBCreator
           cd LinuxLiveUSBCreator
           Move-Item * ..
    - name: Install Autoit Code Stripper
      run: |
           Invoke-WebRequest -Uri https://www.autoitscript.com/autoit3/scite/download/Au3Stripper.zip -OutFile Au3Stripper.zip
           Expand-Archive -Force .\Au3Stripper.zip C:\"Program Files (x86)"\AutoIt3\Aut2Exe\
    - name: Wrap Code
      run: |
           cd C:\"Program Files (x86)"\AutoIt3
           ./AutoIt3.exe "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "C:\Program Files (x86)\AutoIt3\Aut2Exe\sources\LiLi\LiLi USB Creator.au3"
           Start-Sleep -s 10
    - name: Compile
      run: |
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe
           cd LinuxLiveUSBCreator
           $ver= git rev-list --count HEAD
           cd ..
           mkdir build
           ./Aut2exe.exe /in "sources\LiLi\LiLi USB Creator.au3" /out build\LiLiUSBCreator-2.10alpha$ver.exe /nopack /icon tools\img\lili.ico /comp 4 /x64
           Start-Sleep -s 10
           Move-Item tools build
    - name: Upload
      uses: actions/upload-artifact@v2
      with:
       name: LinuxLiveUSBCreator
       path: C:\Program Files (x86)\AutoIt3\Aut2Exe\build
       if-no-files-found: error

TIA!

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites
Posted (edited)
1 minute ago, TheDcoder said:

Cool, GitHub now has Windows VMs for CI?

Yep

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites

Very nice. Sorry for going a bit off-topic, another interesting thing is that LiveLinuxUSB is the reason why I discovered AutoIt, I have no idea where I would be now if it weren't for it :wacko:

Thanks for forking the project and improving it :)

As for your actual question, tagging @Jos so that he can advice you on AutoIt3Wrapper.

EasyCodeIt - A cross-platform AutoIt implementation

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites
Just now, TheDcoder said:

Very nice. Sorry for going a bit off-topic, another interesting thing is that LiveLinuxUSB is the reason why I discovered AutoIt, I have no idea where I would be now if it weren't for it :wacko:

Thanks for forking the project and improving it :)

As for your actual question, tagging @Jos so that he can advice you on AutoIt3Wrapper.

Yeah I remember using LiLi wayyyyy back in the day because it was really easy persistent storage. Sad to see the original dev got busy, but it's understandable. Regardless, some of the original translators saw the thread on r/Linux so hopefully I'll have a 2.10 with updated translations out within a month or so. The original dev's coding style is quite a bit different than how I would code and I'm still getting used to it.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites
23 minutes ago, rcmaehl said:

Yeah I remember using LiLi wayyyyy back in the day because it was really easy persistent storage.

That's cool, I never used that feature personally... I was just trying out various Linux distros.

1 hour ago, rcmaehl said:

The original dev's coding style is quite a bit different than how I would code and I'm still getting used to it.

Yeah, he also doesn't use the usual Hungarian notation to denote the type of the variable :tv_horror:

EasyCodeIt - A cross-platform AutoIt implementation

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites
  • Developers
Posted (edited)
4 hours ago, rcmaehl said:

I can't seem to get #AutoIt3Wrapper headers to be parsed. Unlike AU3Check and Aut2exe, using the same parameters SciTE shows being used does not seem to work.

Not sure I understand the question as I only see the input (CI)  which I guess I can interpret, but have no idea what you mean with "headers to be parsed". 
Could you explain please and maybe add the log of "what you do see" ?

... and arn't you missing the download for AutoIt3Wrapper from that Script?  (Maybe you could start explaining what that CI exactly should accomplish for this noob when it comes to Github CI's) 

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
Posted (edited)
5 hours ago, Jos said:

... and arn't you missing the download for AutoIt3Wrapper from that Script?  (Maybe you could start explaining what that CI exactly should accomplish for this noob when it comes to Github CI's) 

Jos 

I'm not seeing in under https://www.autoitscript.com/site/autoit/downloads/ or https://www.autoitscript.com/site/autoit-script-editor/downloads/ so I thought it came by default. I must have installed it a while ago on my own system without realizing. Let me see if I can add that

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites
5 hours ago, Jos said:

(Maybe you could start explaining what that CI exactly should accomplish for this noob when it comes to Github CI's) 

It's just basically a task which is done for each commit/revision to the code, people use it to run syntax checks, build errors etc. These checks are ran in a VM in the cloud, GitHub provides this feature for free (for public repositories).

10 minutes ago, rcmaehl said:

I'm not seeing

It's included in the full version of the SciTE4AutoIt3 editor I think :)

EasyCodeIt - A cross-platform AutoIt implementation

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites
Posted (edited)

I was able to get it to work. I didn't realize running the wrapper actually compiled the script instead of having to manually run Aut2Exe. I'll post my new CI yml in case anyone else ever experiences this issue (Yes, the sleeps ARE needed).

name: lili

on: 
 push:
   paths-ignore:
     - '.github/**'
     - '!.github/workflows/**'
     - '*.md'

jobs:
  build:

    runs-on: windows-latest
    steps:
    - name: Install Autoit
      run: |
           Invoke-WebRequest -Uri https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe -OutFile autoit-v3-setup.exe
           ./autoit-v3-setup.exe /S
           Start-Sleep -s 10
    - name: Checkout repo
      run: |
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe
           git clone https://github.com/rcmaehl/LinuxLiveUSBCreator
    - name: Install Full Editor tools
      run: |
           Invoke-WebRequest -Uri https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe -OutFile SciTE4AutoIt3.exe
           ./SciTE4AutoIt3.exe /S
           Start-Sleep -s 10 
    - name: Wrap Code
      run: |
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe\LinuxLiveUSBCreator\sources\LiLi\
           ../../../../AutoIt3.exe "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /NoStatus /prod /in "C:\Program Files (x86)\AutoIt3\Aut2Exe\LinuxLiveUSBCreator\sources\LiLi\LiLi USB Creator.au3"
           Start-Sleep -s 10
    - name: Rename and Aggregate Files
      run: |
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe
           mkdir build
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe\LinuxLiveUSBCreator
           $ver= git rev-list --count HEAD
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe\LinuxLiveUSBCreator\Sources\LiLi
           Move-Item "LiLi USB Creator.exe" C:\"Program Files (x86)"\AutoIt3\Aut2Exe\build
           cd C:\"Program Files (x86)"\AutoIt3\Aut2Exe
           Move-Item LinuxLiveUSBCreator\tools build
           cd build
           Rename-Item -Path "LiLi USB Creator.exe" -NewName LiLiUSBCreator-2.10alpha$ver.exe
    - name: Upload
      uses: actions/upload-artifact@v2
      with:
       name: LinuxLiveUSBCreator
       path: C:\Program Files (x86)\AutoIt3\Aut2Exe\build
       if-no-files-found: error

 

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites

Hello, I'm the guy who made initial CI and I think using chocolatey to install autoit3 could be better, would look much cleaner. Has anyone here worked with autoit3 installing from chocolatey?

I don't use Windows so every change that was needed to do was (almost) a blind guess and I'm honestly surprised that it works (more or less). Rcmaehl has been a big help with his Windows expertise (and it's his project after all).

Link to post
Share on other sites
  • 2 months later...
Posted (edited)

@rcmaehl 
Please consider to change Title
from:

Quote

Setting up CI for autoit scripts?

to:

Quote

Setting up CI on GitHub for autoit scripts?

 

And add tag  GitHub to yours OP

Edited by mLipok

Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Link to post
Share on other sites
  • rcmaehl changed the title to Setting up CI on GitHub for autoit scripts?

As requested, the current, efficient CI setup for AutoIt is as such:

name: wnw11

on: [push, pull_request, workflow_dispatch]

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Cache tools
        uses: actions/cache@v2
        id: cache
        with:
          path: |
            autoit-v3-setup.exe
            SciTE4AutoIt3.exe
            C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper
          key: v2
      - name: Download tools
        if: steps.cache.outputs.cache-hit != 'true'
        run: |
          curl -sSfLO https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe `
            -sSfLO https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe `
            -sSfLO https://www.autoitscript.com/autoit3/scite/download/Au3Stripper.zip
          Expand-Archive Au3Stripper.zip "${env:ProgramFiles(x86)}\AutoIt3\SciTE\Au3Stripper"
      - name: Install tools
        run: |
          Start-Process autoit-v3-setup.exe -ArgumentList /S -NoNewWindow -Wait
          Start-Process SciTE4AutoIt3.exe -ArgumentList /S -NoNewWindow -Wait
      - name: Compile
        run: |
          Start-Process "${env:ProgramFiles(x86)}\AutoIt3\AutoIt3.exe" "`"${env:ProgramFiles(x86)}\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3`" /NoStatus /prod /in WhyNotWin11.au3" -NoNewWindow -Wait
          sha256sum -b WhyNotWin*.exe > checksums.sha256
      - uses: actions/upload-artifact@v2
        with:
          name: WNW11
          path: |
            WhyNotWin11*.exe
            checksums.sha256
          if-no-files-found: error
      - name: Zip package
        if: startsWith(github.ref, 'refs/tags/')
        run: 7z a WhyNotWin11.zip WhyNotWin11*.exe checksums.sha256
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            WhyNotWin11*.exe
            WhyNotWin11.zip
            checksums.sha256
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

 
It only needs slight modification for your au3 input, output exe, and output zip file names

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to post
Share on other sites
Posted (edited)

Today I ran into a problem with TIDY implementation in your CI workflows exactly here:
https://github.com/rcmaehl/WhyNotWin11/pull/411

I was trying to use:

#AutoIt3Wrapper_Run_Tidy=Y
#Tidy_Parameters=/reel /portable /showconsoleinfo=9 /proper=1


@rcmaehl could you explain how this CI works on GitHub ?

Question 1:
Do this CI workflows each time download:

Quote


          curl -sSfLO https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe `
            -sSfLO https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe `
            -sSfLO https://www.autoitscript.com/autoit3/scite/download/Au3Stripper.zip

?


Question 2:
How they are unpaced/installed ?

Question 3:
Could you try to use:
https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3_Portable.zip

instead:
https://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe

?

Edited by mLipok

Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Link to post
Share on other sites

@mLipok

Quote

Question 1:
Do this CI workflows each time download:

No, there is this function before in CI which caches the files. If you want to download again, you'd have to change the key. for example v3 or something. Then I think that you can also go back to old caches when you change number to old one.

- name: Cache tools
        uses: actions/cache@v2
        id: cache
        with:
          path: |
            autoit-v3-setup.exe
            SciTE4AutoIt3.exe
            C:\Program Files (x86)\AutoIt3\SciTE\Au3Stripper
          key: v2
Quote

Question 2:
How they are unpaced/installed ?

This is done in this step, just a standard install as you would do in command line on Windows.

- name: Install tools
        run: |
          Start-Process autoit-v3-setup.exe -ArgumentList /S -NoNewWindow -Wait
          Start-Process SciTE4AutoIt3.exe -ArgumentList /S -NoNewWindow -Wait

Au3stripper is unpacked in previous step

`Expand-Archive Au3Stripper.zip "${env:ProgramFiles(x86)}\AutoIt3\SciTE\Au3Stripper"`

 

Quote

Question 3:
Could you try to use:

I mean, it can be done, but what would be the benefit of using it instead of the installer?

 

 

I will post this code with comments, what's necessary and not etc. here soon, so will be easier to understand.

Link to post
Share on other sites
4 minutes ago, micwoj92 said:

I will post this code with comments, what's necessary and not etc. here soon, so will be easier to understand.

Thanks.

Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mLipok
      Recently I was working on TeamVierwer API .
      I had a little break, and wanted to check out another platform.
      Here is the result of my attempt:
      #include "GHAPI.au3" _GHAPI_AccessToken('b3e8.....de..........bdc3a0c.....bd27c6f') _GHAPI_GetUser("users/mLipok") _GHAPI_GetUserOrganizations("users/mLipok") _GHAPI_RootEndpoints() and GHAPI.au3
      #include-once #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #Tidy_Parameters=/sort_funcs /reel #Region GHAPI.au3 - Header ; #INDEX# ======================================================================================================================= ; Title .........: GHAPI UDF ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: This is an UDF for for communicate with https://api.github.com via GitHub RESTful API ; Author(s) .....: mLipok ; Modified ......: ; =============================================================================================================================== #cs Title: GHAPI UDF Filename: GHAPI.au3 Description: This is an UDF for for communicate with https://api.github.com via GitHub RESTful API Author: mLipok Modified: Last Update: 2017/05/23 Requirements: AutoIt 3.3.10.2 or higher #ce #EndRegion GHAPI.au3 - Header #Region GHAPI.au3 - Include #include <array.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #EndRegion GHAPI.au3 - Include #Region GHAPI.au3 - Declarations Global $oErrorHandler = ObjEvent("AutoIt.Error", "_GHAPI_ErrFunc") Global $__g_sGitHubAPI_BaseUrl = "https://api.github.com" ; URL of the GitHub API Global $__g_sGitHubAPI_Version = "v3" ; Put the current API version in here Global Enum _ $GHAPI_ERR_SUCCESS, _ $GHAPI_ERR_GENERAL, _ $GHAPI_ERR_COMERROR, _ $GHAPI_ERR_STATUS, _ $GHAPI_ERR_COUNTER Global Enum _ $GHAPI_EXT_DEFAULT, _ $GHAPI_EXT_PARAM1, _ $GHAPI_EXT_PARAM2, _ $GHAPI_EXT_PARAM3, _ $GHAPI_EXT_COUNTER Global Enum _ $GHAPI_RET_SUCCESS, _ $GHAPI_RET_FAILURE, _ $GHAPI_RET_COUNTER #EndRegion GHAPI.au3 - Declarations #Region GHAPI.au3 - API Functions Func _GHAPI_ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_GHAPI_ErrFunc Func _GHAPI_AccessToken($sParam = Default) ; https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/ ; https://github.com/settings/tokens Local Static $sAccessToken = '' If $sParam <> Default Then $sAccessToken = $sParam Return $sAccessToken EndFunc ;==>_GHAPI_AccessToken Func _GHAPI_GetUser($sUser) Local $oHTTP = __GHAPI_HTTP_Open("GET", $sUser) Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_GetUser Func _GHAPI_GetUserOrganizations($sUser) Local $oHTTP = __GHAPI_HTTP_Open("GET", $sUser & '/orgs') Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_GetUserOrganizations Func _GHAPI_RootEndpoints() Local $oHTTP = __GHAPI_HTTP_Open("GET", '') Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_RootEndpoints #EndRegion GHAPI.au3 - API Functions #Region GHAPI.au3 - INTERNAL Functions Func __GHAPI_HTTP_Open($sMethod, $sCommand, $sURLParameters = '') Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") Local $sURL = $__g_sGitHubAPI_BaseUrl & "/" & $sCommand & $sURLParameters ;~ __GHAPI_DebugOut("> $sURL=" & $sURL & @CRLF) $oHTTP.Open($sMethod, $sURL, False) If @error Then Return SetError(@error, @extended, Null) $oHTTP.setRequestHeader("Authorization", "Bearer " & _GHAPI_AccessToken()) ; Accept: application/vnd.github.v3+json $oHTTP.setRequestHeader("Accept", "application/vnd.github." & $__g_sGitHubAPI_Version & "+json") ; User-Agent: Awesome-Octocat-App $oHTTP.setRequestHeader("User-Agent", "AutoIt UDF") Return $oHTTP EndFunc ;==>__GHAPI_HTTP_Open Func __GHAPI_HTTP_Send(ByRef $oHTTP, $sSendParameter = Default) If $sSendParameter = Default Then $oHTTP.Send() Else $oHTTP.Send($sSendParameter) EndIf ConsoleWrite('+' & $oHTTP.Status & @CRLF) ConsoleWrite('>' & $oHTTP.StatusText & @CRLF) ConsoleWrite($oHTTP.ResponseText & @CRLF) ConsoleWrite(@CRLF) If @error Then Return SetError(@error, @extended, $GHAPI_RET_FAILURE) ;~ Return SetError($GHAPI_ERR_SUCCESS, $oJSON.Size, $oJSON) EndFunc ;==>__GHAPI_HTTP_Send #EndRegion GHAPI.au3 - INTERNAL Functions #Region GHAPI.au3 - HOWTO / DOCS / HELP #CS https://developer.github.com/v3/ https://developer.github.com/v3/guides/ https://developer.github.com/program/ https://github.com/contact?form%5Bsubject%5D=New+GitHub+Integration https://developer.github.com/ http://stackoverflow.com/questions/28796941/github-api-authentication-with-msxml2-xmlhttp #CE #EndRegion GHAPI.au3 - HOWTO / DOCS / HELP  
      REMARKS:
      This is just a modest start up and not a whole fully workable UDF, just so for a try, but maybe someone will be useful
      Regards,
      mLipok
       
      EDIT 1:
      If you need to make it workable just ask about specyfic feature.
      EDIT 2:
      Some changes in using word "GitHub" - to meet this rules: https://github.com/logos
    • By ur
      I have a github repository and when I run the below command it will retrieve a json file.
      curl --user "user:password" https://api.github.com/repos/ukreddy-erwin/Build-war/commits > Desktop/uday.html The output json file will be of the below format.
      [ { "sha": "525ddee5f25628f89c04980d7f683e9cd8f56b7a", "commit": { "author": { "name": "ukreddy", "email": "ukreddy@erwin.com", "date": "2016-12-26T12:27:14Z" }, "committer": { "name": "ukreddy", "email": "ukreddy@erwin.com", "date": "2016-12-26T12:27:14Z" }, "message": "changed gwt and gxt folder structure to build.xml", "tree": { "sha": "8d4f2cbca93efec18be8a17f25f78ad168e65347", "url": "https://api.github.com/repos/ukreddy-erwin/Build-war/git/trees/8d4f2cbca93efec18be8a17f25f78ad168e65347" }, "url": "https://api.github.com/repos/ukreddy-erwin/Build-war/git/commits/525ddee5f25628f89c04980d7f683e9cd8f56b7a", "comment_count": 0 }, "url": "https://api.github.com/repos/ukreddy-erwin/Build-war/commits/525ddee5f25628f89c04980d7f683e9cd8f56b7a", "html_url": "https://github.com/ukreddy-erwin/Build-war/commit/525ddee5f25628f89c04980d7f683e9cd8f56b7a", "comments_url": "https://api.github.com/repos/ukreddy-erwin/Build-war/commits/525ddee5f25628f89c04980d7f683e9cd8f56b7a/comments", "author": { "login": "ukreddy-erwin", "id": 21240709, "avatar_url": "https://avatars.githubusercontent.com/u/21240709?v=3", "gravatar_id": "", "url": "https://api.github.com/users/ukreddy-erwin", "html_url": "https://github.com/ukreddy-erwin", "followers_url": "https://api.github.com/users/ukreddy-erwin/followers", "following_url": "https://api.github.com/users/ukreddy-erwin/following{/other_user}", "gists_url": "https://api.github.com/users/ukreddy-erwin/gists{/gist_id}", "starred_url": "https://api.github.com/users/ukreddy-erwin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ukreddy-erwin/subscriptions", "organizations_url": "https://api.github.com/users/ukreddy-erwin/orgs", "repos_url": "https://api.github.com/users/ukreddy-erwin/repos", "events_url": "https://api.github.com/users/ukreddy-erwin/events{/privacy}", "received_events_url": "https://api.github.com/users/ukreddy-erwin/received_events", "type": "User", "site_admin": false }, "committer": { "login": "ukreddy-erwin", "id": 21240709, "avatar_url": "https://avatars.githubusercontent.com/u/21240709?v=3", "gravatar_id": "", "url": "https://api.github.com/users/ukreddy-erwin", "html_url": "https://github.com/ukreddy-erwin", "followers_url": "https://api.github.com/users/ukreddy-erwin/followers", "following_url": "https://api.github.com/users/ukreddy-erwin/following{/other_user}", "gists_url": "https://api.github.com/users/ukreddy-erwin/gists{/gist_id}", "starred_url": "https://api.github.com/users/ukreddy-erwin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ukreddy-erwin/subscriptions", "organizations_url": "https://api.github.com/users/ukreddy-erwin/orgs", "repos_url": "https://api.github.com/users/ukreddy-erwin/repos", "events_url": "https://api.github.com/users/ukreddy-erwin/events{/privacy}", "received_events_url": "https://api.github.com/users/ukreddy-erwin/received_events", "type": "User", "site_admin": false }, "parents": [ { "sha": "db4d61c5bbef555e6cc9f2e852aaf9d75772475c", "url": "https://api.github.com/repos/ukreddy-erwin/Build-war/commits/db4d61c5bbef555e6cc9f2e852aaf9d75772475c", "html_url": "https://github.com/ukreddy-erwin/Build-war/commit/db4d61c5bbef555e6cc9f2e852aaf9d75772475c" } ] } ] So, I need to parse above file and get the number of opening and closing brackets {} .
      So that would be the number of commits in the repository.
      Any suggestion on how to parse this file of json format.
    • By James
      Hey all,
      I've been away for a while, working on one thing or another... Recently it's been StyleCI, The PHP Coding Style Service.
      StyleCI connects to your GitHub repositories and watches for commits or pull requests, with the ability of automatically fixing the code standards if it hasn't matched your settings.
      The likes of Laravel and Graze are using StyleCI now, among many other projects. Yesterday we hit a massive milestone, we analysed the 100,000 commit!
      I'd love to hear your feedback
      Cheers,
      James
    • By perfaram
      ... is a GitHub Organization for you all, who help the AutoIT Community with you valuable tools. Nobody's in yet, but feel free to apply in this thread !
      Here's the link.
      PS : If anybody has a good logo for the organization, then just post it here :-)
×
×
  • Create New...