Jump to content

troubleshoot script


Tuna
 Share

Recommended Posts

I was given a script but can't get it to run. Could someone break it down so I can figure out why it doesn't run for me?

Thanks for any help

the lines with the < preceding them do not have that symbol, they have the gray box and bar so I guess they are rem statements?

<#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

<#AutoIt3Wrapper_outfile=One that is scheduled\Evony.exe

<#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Dim $PID = 0

$PID = ProcessExists("iexplore.exe") ; Will return the PID or 0 if the process isn't found.

<Do

< ProcessClose($PID)

< $PID = ProcessExists("iexplore.exe")

Until $PID = 0

Run ("C:\Program Files (x86)\Internet Explorer\iexplore.exe", @SW_MAXIMIZE)

Link to comment
Share on other sites

You forgot the correct second argument for Run(), which is "workingdir", not show_flag.

Anyways, I revised your code a little and tried to comment everything properly. Ask if you got any questions ;)

#AutoIt3Wrapper_outfile=Evony.exe; This tells the compiler to name the finished exe "Evony.exe".

Local $PID = ProcessExists("iexplore.exe"); Will return the PID or 0 if the process isn't found.

While ($PID <> 0); This loop will keep going until $PID equals 0.

    If (ProcessClose($PID) <> 1) Then ContinueLoop; If ProcessClose() returns any other value that 1, it failed to close the process.

    $PID = ProcessExists("iexplore.exe"); If the process was found, $PID should now contain its handle (hWnd).

WEnd; Now we loop up to "While" and check whether $PID is still not 0.

Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE); Now we're going to run Internet Explorer.

Exit; That's it.
Edited by Encoded
Link to comment
Share on other sites

Thanks alot. I got rid of the loop since it doesn't make sense to me. Why continue looking for a file? it's either there or it's not. and with your changes it worked fine.

haven't done stuff like this since I played with basic in the 80's. gonna take awhile to get the hang of it

Link to comment
Share on other sites

Why continue looking for a file? it's either there or it's not.

Your code suggested that their may be multiple instances of IE open, if that could be the case then you are going to need a loop of some sort.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...