Jump to content

Recommended Posts

Posted
Hey, i this is part of my script, and i do not know how to make it to wait few sec, and if there is no such text as i wrote "C", then continue.
 
 
Do 
$text=ControlGetText("[CLASS:tooltips_class32]","","")
$strtxt = StringMid($text, 1, 1)
Until $strtxt = "C"

I have tried this.. But does not work

 

Do 
$text=ControlGetText("[CLASS:tooltips_class32]","","")
$strtxt = StringMid($text, 1, 1)
Until $strtxt = "C", "", 180)
 
 
 
 
Thanls for helping!
Posted (edited)
  On 6/12/2014 at 7:13 AM, Geir1983 said:

Sleep(2000) will pause for 2 seconds :P

Dude, it's not about sleep, my command waiting for a text, and it's keep waiting, and if text does not exist, this is keep waiting, so can't start what is bellow this command, probabbly you havent understand what i mean.

Edited by Wolfshare
Posted (edited)
  On 6/12/2014 at 7:34 AM, flyingmarsii said:

Maybe you need use  StringRegExp() 

While 1

$text=ControlGetText("[CLASS:tooltips_class32]","","")
$strtxt = StringMid($text, 1, 1)


$var = StringRegExp($strtxt,'\bc',1)
If $var = 1 Then 
$Strtxt ='C'
Exit
EndIf

Wend

My suggestion

Mhh, could you tell me where i can set a time how much to wait? Because i can't understand script you writed above.

Edited by Wolfshare
Posted

try something like this
 

Do
    sleep(10)
    $text = ControlGetText("[CLASS:tooltips_class32]", "", "")
    $strtxt = StringMid($text, 1, 1)
Until StringInStr($strtxt, "C") <> 0

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 6/12/2014 at 7:35 AM, Wolfshare said:

Mhh, could you tell me where i can set a time how much to wait? Because i can't understand script you writed above.

Much quicker than 2 seconds,but you can add sleep(2000)  before Wend.

But I think  Geir1983's opinion is  more effective

Posted
  On 6/12/2014 at 8:01 AM, Geir1983 said:

Isnt that what you wanted? It searches for 2 seconds, if not found it will abort the search and continue your script..

Oh, allright, i just need to make 2 seconds for like 15 sec, thanks alot.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...