Sign in to follow this  
Followers 0
Wolfshare

Wait while text in program exist

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

One thing is the same, and other is not.

Share this post


Link to post
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.

Share this post


Link to post
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

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  
Followers 0