Jump to content

Waiting for strings in login script


Recommended Posts

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
Link to comment
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 :)

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