This article is from the ZTerm FAQ, by Les Jones firstname.lastname@example.org with numerous contributions by others.
This is the login script I used to use for my university's
wait prompt "Local>"
send "c vax^M"
wait prompt "Username:"
send $account "^M"
wait prompt "Password:"
send $password "^M"
Note that $account and $password are NOT inside quotation marks.
For this script to work, the values for $account and $password must
be entered into the Connection dialog.