Jump to content
Sign in to follow this  
pecha

Script stops

Recommended Posts

pecha

I think that he must be simple but

script stops in line 19, can somebody help me

AutoItSetOption ("TrayIconDebug", 1)

Run             (@ScriptFullPath & '\..\Prog\acad.exe')
WinWait("AutoCAD 2006", "")

;~ Espera até ao proximo passo
While WinExists("AutoCAD 2006", "")
   Sleep(100)
WEnd

;- Termina os processos que ficaram pendentes
While 1
    If ProcessExists('AdskScSrv.exe') Then
        ProcessClose('AdskScSrv.exe')
    ElseIf ProcessExists('AdsKCleanup.0001') Then 
        ProcessClose('AdsKCleanup.0001')
    ElseIf ProcessExists('WSCommCntr1.exe') Then 
        ProcessClose('WSCommCntr1.exe')
    ElseIf ProcessExists('acad.exe') Then  ;- Line 19
        ProcessClose('acad.exe')
    EndIf
WEnd

Exit

thanks

Share this post


Link to post
Share on other sites
Triblade

While 1

If ProcessExists('AdskScSrv.exe') Then

ProcessClose('AdskScSrv.exe')

ElseIf ProcessExists('AdsKCleanup.0001') Then

ProcessClose('AdsKCleanup.0001')

ElseIf ProcessExists('WSCommCntr1.exe') Then

ProcessClose('WSCommCntr1.exe')

ElseIf ProcessExists('acad.exe') Then ;- Line 19

ProcessClose('acad.exe')

EndIf

WEnd

This While WEnd loop never ends. If every process is closed the loop goes into overdrive and makes ur CPU mad.

Try something like this just above the WEnd: Sleep(500)

This should be much better. This doesn't end your loop, so the program still tries to close the processes indefinetly.

Greetz,

Tri

Edit: typo

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

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
Sign in to follow this  

×