Trumpet login.cmd for NetRunner
#========================================
---------------------Begin Cut Here----------------------
# NetRunner LOGIN.CMD File
# Version 2.0
# This login file dials the MIAMI PHONE NUMBER.  It uses PPP and will
# attempt to redial if no connection is made.
#
# trace on
#
# set up some strings for dialling up
#
display \n
display \n
display \n
#
if ![load $number]
  if [query $number "Enter your dial up phone number"]
    save $number
  end
end
if ![load $username]
  if [username "Enter your login username"]
    save $username
  end
end
if ![load $password]
  if [password "Enter your login password"]
    save $password
  end
end
$modemsetup = "z"
$prompt = ">"
$userprompt = "ogin:"
$passprompt = "assword:"
$slipcmd = "slip"
$addrtarg = "Your address is"
$pppcmd = "ppp"
#
#
#----------------------------------------------------------
#
# initialize modem
#
display NetRunner - Initializing the modem...\n
output "atz"\13
display \n
if ! [input 10 OK\n]
  display "Modem is not responding"\n
  abort
end
#
# setup our modem commands
#
output "at"$modemsetup\13
input 10 OK\n
#
# send phone number
#
# %n = 0
display NetRunner - dialing the phone....\n
%attempts = 0
repeat
   %attempts = %attempts + 1
   display "Attempt number "%attempts\n
   outputecho 60 atdt$number\r
   %output = [read 30 $result]
   if ! %output
      display "Dial up timed out."\n
   end
   if len($result) > 7                 
      $result = copy($result,1,7)      
   end
until $result = "CARRIER" | $result = "CONNECT" | %attempts = 99 | ! %output
input 30 \n
display \n
#
#
#  now prod the terminal server
#
#  output \13
#
#  wait for the username prompt
#
display NetRunner - Logging into NetRunner with Username and Password.....\n
input 30 $userprompt
output P$username\13
#
# and the password
#
input 30 $passprompt
output $password\13
display \n
#
# we are now logged in
#
display \13
display NetRunner - Login sucessful, starting PPP mode.....\n
if %ppp
  #
  # jump into ppp mode
  #
  output $pppcmd\13
  #
  input 30 \n
  #
  display PPP mode selected.\n
  display \n
  display Congratulations, you are logged into NetRunner!\n
  display MINIMIZE Trumpet and start surfing...\n
  display \n
  display Remember to do the "Dailer" "Bye" before you close Trumpet\n
  display \n
  #
else
  #
  # jump into slip mode
  #
  output $slipcmd\13
  #
  # wait for the address string
  #
  input 30 $addrtarg
  #
  # parse address
  #
  address 30
  input 30 \n
  #
  # we are now connected, logged in and in slip mode.
  #
  display \n
  display NetRunner - Connected.  Your IP address is \i.\n
end
#
# now we are finished.
#
---------------------Quit End Here--------------------