Jump to content

Run function if other function is complete


Recommended Posts

Hello guys,

 

I'm trying to create a following loop:

- Run Function 1

-If function 1 = completed (i.e. image is found) then i want to run function 2.

-After function 1 i want the script to repeat itself and start at function 1 again.

How can i accompish this? Wait function? Function return values?

Looking forward to your help

 

kr,

 

stefan

Link to comment
Share on other sites

Function one can return a True if successful, and do an If statement based on that return to then logically call function 2.

Then you have while loops.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Thank you for your respons. I've made it work.

Now i got the following issue however:

The script works fine as long as i use it as .au3 file.

However when i compile it to an .exe file it does not retrieve the images any longer.

note: NOTHING has changed (not the image or the position of the image) when comparing the .au3 file execution to the .exe's.

I included the following path: #include <D:\Program files\AutoIt3\2dehands\ImageSearch.au3>

Link to comment
Share on other sites

;Example 1

While 1
    Sleep(10)
    Function1()
WEnd

Func Function1()
    If FileExisits() Then
        ;Do Stuff
        Function2()
    EndIf
EndFunc();End Func1

Func Function2()
    ;Do More Stuff
EndFunc();End Func2

;Example 2

While 1
    Sleep(10)
    If Function1() = True Then Function2()
EndIf

Func Function1()
    If FileExisits() Then
        ;Do Stuff   
        Return True
    EndIf
EndFunc();End Func1

Func Function2()
    ;Do More Stuff
EndFunc();End Func2

 

Link to comment
Share on other sites

1 hour ago, stefan654 said:

However when i compile it to an .exe file it does not retrieve the images any longer.
 

#AutoIt3Wrapper_UseX64=y

maybe the way you compiled it?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers
3 hours ago, stefan654 said:

However when i compile it to an .exe file it does not retrieve the images any longer.

Show the current code when you want any valid response.

1 hour ago, careca said:

#AutoIt3Wrapper_UseX64=y

maybe the way you compiled it?

This only works when the full SciTE4AutoIt3 is installed and really do not understand how this would make a difference.

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 comment
Share on other sites

I was under the impression that some functions only work on either 32 or 64 bit. So i thought it might make a difference in the sense that if the application is compiled as 32 bit, and the imgsearch dll only runs on 64.. the application wouldn't find any image for example.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers

True, but the same bits version will be used for running and compiling, so when running works I would assume that a compiled version also works as far as the 32/64 bits potential issues.

Agree?

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 comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...