Sign in to follow this  
Followers 0
slugger415

Waiting for strings in login script

4 posts in this topic

#1 ·  Posted (edited)

Hi all, uber-newbie here. I have a simple au3 file I'm using to login to Perforce, where I want it to wait for the pass: prompt before entering the password. I'm probably doing this wrong (couldn't find anything in the documentation about waiting for strings), but it looks something like this:

Run("p4 -p server -u client-name login")

Send("tXpassword{ENTER}")

The strange thing is when this is run from the command line, the first two characters of the password "tX" appear on the command line after the script is run, and sometimes the login doesn't work. At one point the script was actually working though....

How can I tell the script to wait for a string such as "pass:"? And what's going on with the tX appearing?

thanks

Scott

Edited by slugger415

Share this post


Link to post
Share on other sites



maybe the WinWaitActive could be of use to you

Share this post


Link to post
Share on other sites

Give it some time before sending the password; if you don't it will try to send it a.s.a.p.

A Sleep(1000) before sending the password should be enough; you can experiment also with different sleep times (I don't think that a couple seconds more can hurt).


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

As the other two said, you could either use WinActive() to check if the window you want is active, which will be the more reliable choice of the two, or you can add one simple Sleep() line...

Edited by rabbitkillrun

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