Jump to content

Avoid script pausing


Recommended Posts

I made a little script that opens an ie browser. While waiting for the window to show up i show a little labe saying something to the effect of "Wait please..."

Problem is sometime the script pauses on its on, show the little labe is stuck in the screen. I dont want it to be the user that has to go to the taskbar icon and unpause the script.

Anyone know how i can totally avoid the script pausing? or detect the script pause event, and override it to just continue processing?

Link to comment
Share on other sites

  • Moderators

I would use Smoke_N's metode but here is another function which can be used, break()

That's a good point, that actually would be easier if you are only wanting to do it periodically throughout your script... Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

first of all thank you for your quick reply

from my investigation what that does is remove the default options from the menu.

my question is wether its stops the script from pausing for any strange reason

What sort of strange reasons? Sorry, completely misread your initial post. You mean your script is actually paused itself, not waiting on some stalled connection or something? Meaning, if you unpause it through the systraay autoit icon, you see it continue in some way? Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

What sort of strange reasons? Sorry, completely misread your initial post. You mean your script is actually paused itself, not waiting on some stalled connection or something? Meaning, if you unpause it through the systraay autoit icon, you see it continue in some way?

i wasnt able to identify the reason it does that, but fact is the script is pausing and if the user clicks the unpasue on the systray it will continue working

Link to comment
Share on other sites

here is the source if you think it can help

#include <IE.au3>
#include <GUIConstants.au3>

;Remove Tray Icon
#NoTrayIcon
;Server Port
$port = "8080"

;Service Name 
$service = "Tomcat5";

;Mensagens
$msgAguarde = "Por favor aguarde..."
$msgErroGeral = "Ocorreu um erro que impediu que o SCoT Iniciasse. Por favor contacte um Administrador."
$msgErroServicoIndisponivel = "Serviço Indisponível, por favor reinicie a máquina."
$msgErroServicoStartPend = "Serviço Indisponível, por favor tente de novo. Se o problema persistir por favor reinicie a máquina."
;;PATH SCoT
$pathSCoT = "C:/Tomcat/server/webapps/SCoTLocal"
$pathTmpFile = $pathSCoT & "/logArranque.txt"

;;POPUP INICIAL
GUICreate("SCOT", 125, 40,-1,-1,$WS_POPUP,$WS_EX_TOPMOST); will create a dialog box that when displayed is centered

Opt("GUICoordMode",2)
$widthCell=125
GUICtrlCreateLabel ($msgAguarde,  20, 15, $widthCell); first cell 70 width

GUISetState (@SW_SHOW)  ; will display an empty dialog box
GUISetState (@SW_LOCK)  ; will display an empty dialog box

;Query service for status
RunWait(@ComSpec & " /c " & "sc query " & $service & " > " & $pathTmpFile, "", @SW_HIDE)
$file = FileOpen($pathTmpFile, 0)
If $file = -1 Then
    MsgBox(0, "Alerta", $msgErroGeral)
    Exit
EndIf

    $line = FileReadLine($file,4)

    If $line = "        STATE             : 3  STOP_PENDING " Then
        GUIDelete()
        MsgBox(32, "SCoT", $msgErroServicoIndisponivel)
        Exit
    ElseIf $line = "        STATE             : 1  STOPPED " Then
        GUIDelete()
        MsgBox(32, "SCoT", $msgErroServicoIndisponivel)
        Exit
    ElseIf $line = "        STATE             : 1  START_PENDING " Then
        GUIDelete()
        MsgBox(32, "SCoT", $msgErroServicoStartPend)
        Exit
    EndIf

;Abrir o IE e o SCoT
$oIE = _IECreate ("about:blank",0,0)
        
_IEPropertySet ( $oIE , "height", "50" )
_IEPropertySet ( $oIE , "width", "100" )
_IEPropertySet ( $oIE ,"resizable","true")
_IEPropertySet ( $oIE ,"statusbar","false")
_IEPropertySet ( $oIE ,"addressbar","false")
_IEPropertySet ( $oIE ,"menubar","false")


_IENavigate ($oIE, "http://localhost:" & $port & "/SCoTLocal/SCoT.html")

_IELoadWait ($oIE)
GUIDelete()

_IEQuit($oIE)
Edited by masterperas
Link to comment
Share on other sites

  • Moderators

There's no way to test this, but the only 2 places I can see where you'd have this issue is RunWait() and _IELoadWait(), those would pause for whatever period of time it took for them to finish completing their task.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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