Jump to content

Wait while text in program exist


Recommended Posts

Hey, i would like to make my bot sucessfully work, now i have done it with sleep option:

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <FF.au3>
Opt("WinTitleMatchMode", 2)
sleep(15000)
WinActivate("StrongVPN Client - 1.2.2+35c10f")
    Send("{ENTER}")
 sleep(50000)
WinActivate("StrongVPN Client - 1.2.2+35c10f")
ControlClick("StrongVPN Client - 1.2.2+35c10f", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d]")
  sleep(3000)
  run("C:\Documents and Settings\Administrator\Desktop\SCRIPT.exe")
after it clicks enter, then it sleeps 50 seconds because afteter i run this script internet sometimes not working sucessfully, so after 50 seconds it activating StrongVPN and clicks on connect, but sometimes i am keep getting this error: gk8w.png
 
because of internet connection, i dont know how to make this part work sucessfully...This error appear after 
ControlClick("StrongVPN Client - 1.2.2+35c10f", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d]")

But not every time! And other thing is after it clicks connect sometimes its stucks on Connecting, to solve it it have just click disconnect and click connect again using same control click command..

 

So those two things which i dont know how to make untill my program will work propertly! 

post-59586-0-55646700-1373743339_thumb.p

Edited by Wolfshare
Link to comment
Share on other sites

Wolfshare,

is this the same problem as you already posted here?

" title="View Topic">Solve problem without problem title"

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thank you for posting your IP for us all to see :)

You might want to edit your pics in the future. Some less than savory folks might try to do something to you for being so careless.

Check if the window exists before calling that function. Use WinExists function to do that.

Link to comment
Share on other sites

Okay i have tried this:

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <FF.au3>
Opt("WinTitleMatchMode", 2)
sleep(15000)
WinActivate("StrongVPN Client - 1.2.2+35c10f")
    Send("{ENTER}")
   sleep(30000)
WinActivate("StrongVPN Client - 1.2.2+35c10f")
ControlClick("StrongVPN Client - 1.2.2+35c10f", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d]")
if NOT WinActivate("","An error in the VPN connection has occured.") Then
  sleep(3000)
  run("C:\Documents and Settings\Administrator\Desktop\SCRIPT.exe")
  ElseIf WinActivate("StrongVPN Client - 1.2.2+35c10f") Then
  Send("{ENTER}")
   endIf

It just once check if this error exist, and solve them if it is, but only once, it could appear few times.. and i dont know how to make run SCRIPT.exe after VPN status is connected... 

 

  

post-59586-0-80727000-1373873981_thumb.p

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