Jump to content

Need input and suggestion to work loop more faster .


Recommended Posts

Hi All,

I have created small function i.e Error  .I guess you may be knowing when we are configuring the lotus notes that time Id file may get different errors  .

i.e 

Account lockout 

Id file password expire 

You are not authorized etc ..

I have developed the lotus notes auto config script ,I will be calling this error function before launch the lotus notes  and checking the error msg of id files and taking action accordingly  .

Its seems this loop taking lot of time  and some time it will hung the lotus notes. .Do you have any suggestion how to make this loop more faster . 

func Error1()
      Do

           ;Password Expired
                        Sleep(2000)
                        Opt("WinTextMatchMode",2)
                        $sText = WinGetText("IBM Notes")
                     If StringInStr($sText, "You must change your password. It expired on") Then
                        MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                        Exit
                        Sleep(1000)
                     EndIf

                        ;Controlclick("Notes Single Logon Password Synchronization","","Button1")
                        sleep(9000)
                     ;Server not responding
            If  WinExists ("IBM Notes","The server is not responding. The server may be down or you may be experiencing network problems. Contact your system administrator if this problem persists.")or WinActivate("IBM Notes","The server is not responding. The server may be down or you may be experiencing network problems. Contact your system administrator if this problem persists.")Then
                     Sleep(2000)
                     MsgBox(16,"Error","Lotus notes client is not connecting to server please check if the local area network is proper !!! ")
                      WEnd
            EndIf

            If  WinExists ("Notes Single Logon Password Synchronization","")or WinActivate("Notes Single Logon Password Synchronization","")Then
                        sleep(1000)
                        send("{Space}")
                        TrayTip("Lotus Notes Auto Config ", "Please Enter the lotus notes password and hit enter  ", 10)
                        WinWaitActive("IBM Notes","")
                        ;Controlclick("Notes Single Logon Password Synchronization","","Button1")
                    sleep(2000)
            EndIf

            If WinExists("IBM Notes","Server Error: You are not authorized to use the server" )or WinActivate ("IBM Notes","Server Error: You are not authorized to use the server" )Then
                        sleep(2000)
                        MsgBox(16,"Error","ID file has issue contact IT team  ")
                           Exit
            EndIf
                        ; ID file is not select
            If WinExists("Enter New User ID File Name") or WinActivate("Enter New User ID File Name")Then
                      Sleep(2000)
                      MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                     
            EndIf
                    ; Could not open id file
            If  WinExists("IBM Notes","Could not open the ID file")or WinActivate("IBM Notes","Could not open the ID file")Then
                     sleep(2000)
                     MsgBox(16,"Error","ID file has issue contact IT team  ")
                     
                     Exit
            EndIf
                    ; User name not found in Domino Directory
            IF  WinExists("IBM Notes","User name not found in Domino Directory")or WinActivate("IBM Notes","User name not found in Domino Directory")Then
                    Sleep(2000)
                    Controlclick("IBM Notes", "","Button1")
                    MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                       Exit
            EndIf
            If   WinExists("Choose file to be used as current User ID","")or WinActivate("Choose file to be used as current User ID","")Then
                     sleep(2000)
                     MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                     
                     Exit
            EndIf
            If WinExists("IBM Notes","IBM Notes is not currently set as your default email program.  Would you like to set it now?")or WinActivate("IBM Notes","IBM Notes is not currently set as your default email program.  Would you like to set it now?")Then
                send("!y")
                sleep(1000)
            EndIf
            If  WinExists("IBM Notes","Could not open the ID file")or WinActivate("IBM Notes","Could not open the ID file")Then
                     Controlclick("IBM Notes", "","Button1")
                     Sleep(2000)
                     MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                      
                     Exit
            EndIf
            If WinExists ("IBM Notes","You are not authorized to access that database")or WinActivate("IBM Notes","You are not authorized to access that database")Then
                     sleep(2000)
                     MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                                
                    Exit
            EndIf
            If WinExists ("IBM Notes","Error updating local ID file: The information in the supplied certificates from the Address Book entry is out of date .")or WinActivate("IBM Notes","Error updating local ID file: The information in the supplied certificates from the Address Book entry is out of date .")Then
                      sleep(1000)
                      send("{Space}")
            EndIf
            If WinExists("Execution Security Alert","") or WinActivate("Execution Security Alert","")Then
                        Sleep(1000)
                        send("!s")
                        sleep(1000)
                        send("{Tab}")
                        send("{Space}")
                        Sleep(2000)
                     EndIf

                ;Account lockout
            If  WinExists("IBM Notes","Server Error: Your account is locked out; see your system administrator to reset it")or WinActivate("IBM Notes","Server Error: Your account is locked out; see your system administrator to reset it")Then
                     Sleep(2000)
                     MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                     $sProcName = "cmd.exe"
                        While ProcessExists($sProcName)
                        ProcessClose($sProcName)
                        WEnd
                     Exit
            EndIf
                    ;different password on another copy of your ID file
            If  WinExists("IBM Notes","You have a different password on another copy of your ID file and you must change the password on this copy to match") or WinActivate("IBM Notes","You have a different password on another copy of your ID file and you must change the password on this copy to match")Then
                     Sleep(2000)
                     Controlclick("IBM Notes", "","Button1")
                     MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                      $sProcName = "cmd.exe"
                        Exit
            EndIf
                    ; Certificate Expire
            if WinExists("IBM Notes","Server Error: Your certificate has expired") or WinActivate("IBM Notes","Server Error: Your certificate has expired")Then
                    Sleep(2000)
                    Controlclick("IBM Notes", "","Button1")
                    MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                     Exit
            EndIf

                If  WinActive("IBM Notes Social Edition Client Configuration")or WinExists("IBM Notes Social Edition Client Configuration")Then
                     Sleep(1000)
                     send("!n")
                    ;Controlclick("IBM Notes Social Edition Client Configuration", "","IRIS.bmpbutton1")
                    if WinExists ("Notes Single Logon Password Synchronization","")or WinActivate("Notes Single Logon Password Synchronization","")Then
                        sleep(1000)
                        send("{Space}")
                        MsgBox(16,"Error","Setup Cannot be Continue Lotus notes ID File has issue  Please Contact IT Team ")
                        Exit
                     EndIf
                  EndIf


         Until WinExists("Discover - IBM Notes")
               WinWaitActive("Discover - IBM Notes")
            EndFunc
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...