[comp.sys.atari.st] Macros in Uniter V2.0e

BRIGHT@AC.DAL.CA (BOB BRIGHT) (03/27/89)

Jeff Long (jlong@blackbird.afit.af.mil) writes:

>I want to make an autologin macro using uniterm
>I thought the following should work, but it doesn't!
>
>if(get('login: ',2)) send('myloginname\r')
>
>this doesn't work and I can't see why eadng the documentation.
>Could someone who has a sucessful  login macro working, please send

Jeff,
     The only potential problem I can see in your example is that a timeout
of two seconds when waiting for the 'login: ' prompt isn't very long; try a
higher value.  Here's a copy of the macro I use to log on to the local vax
via a develswitch.  The ! in front of the get statements in lines 2, 4, and
6 is logical negation, so those lines jump to the routine at :1 if I _don't_
get a prompt, and otherwise fall through to the next line in the macro.
The routine at :1 simply rings the bell and flashes the screen 3 times.

wait(10) send('\r')
if(!get('What system?',5)) jump(1)
send('dal1\r') wait(20) send('\r') wait(10) send('\r')
if(!get('Username:',5)) jump(1)
send('bright\r')
if(!get('Password:',5)) jump(1)
send('mypassword\r')
exit(0)
:1
set(1,2)
:2
echo('\007\033[?5h') wait(2) echo('\007\033[?5l')
set(1,add(@1,-1))
if(@1) jump(2)

Following is a somewhat longish autodialing macro that I wrote to illustrate
Uniterm macros for our local user's group; you may find something useful in
it. BBB

Bob Bright <BRIGHT@DALAC.BITNET>
Philosophy Dept.
Dalhousie University
Halifax, NS  B3H 3J5  (902) 424-3810

---------CUT HERE---------
##################################################################
#    UNITERM DIALING MACRO (for versions 2.0c and higher!!!)     #
#                by Bob Bright -- 4 August 1988                  #
#                                                                #
#       This macro will continuously cycle through a selected    #
#  group of numbers in a Uniterm .TEL file, dialing each one in  #
#  turn until it gets a connection.  It will come in handy if    #
#  you get a lot of busy signals when calling your favorite      #
#  BBS's.                                                        #
#       The macro begins by loading a .TEL file, which may       #
#  contain up to ten entries.  Edit the tables as indicated      #
#  below to reflect the contents of the .TEL file you will be    #
#  using.                                                        #
##################################################################
     loadtel('uniterm.tel')
# INITIALIZE VARIABLES.  The integer variables @1 through @10
# are set to 1 if you wish to dial the corresponding entry in
# your .TEL file, and 0 if you don't.  The way you set them
# here determines what your default dialing list will be.
     set(1,0) set(2,1) set(3,0) set(4,1) set(5,1)
     set(6,0) set(7,0) set(8,0) set(9,0) set(10,0)
# CLEAR SCREEN, DISPLAY DIALING LIST, AND PROMPT FOR CHANGES.
# Edit the list below so that it contains descriptions of the
# entries in your .TEL file.
:1
     echo('\033\[f\033[2JDIALING LIST:')
     echo('\r\n      1: DAL1     ') if(@1) echo('yes')
     echo('\r\n      2: BAUD     ') if(@2) echo('yes')
     echo('\r\n      3: LAIR     ') if(@3) echo('yes')
     echo('\r\n      4: XEST     ') if(@4) echo('yes')
     echo('\r\n      5: SECTOR   ') if(@5) echo('yes')
     echo('\r\n      6: I-NET    ') if(@6) echo('yes')
     echo('\r\n      7: BIOMEL   ') if(@7) echo('yes')
     echo('\r\n      8:          ') if(@8) echo('yes')
     echo('\r\n      9:          ') if(@9) echo('yes')
     echo('\r\n     10: AARDVARK ') if(@10) echo('yes')
     echo('\r\n\nEnter number of item to change, or <Return> to exit: ')
     inline(1) set(20,10)
:2
     if(compare("@20,$T)) if(@@20) set(@20,0) jump(1)
     if(compare("@20,$T)) if(!@@20) set(@20,1) jump(1)
     set(20,add(@20,-1)) if(@20) jump(2)
     if(!compare('',$T)) jump(1)
# START DIALING!!!
     send('ATZ\r') get('OK',5) set(19,0)
:3
     set(20,1) set(19,add(@19,1))
     echo('\033\[f\033[2JCycle ') echo("@19) echo('.\r\n')
     echo('You may abort the macro at any time by pressing\r\n')
     echo('CTRL-C.  Hitting any other key will cancel the\r\n')
     echo('current number and take you to the next one.\r\n')
:4
     if(@@20) drop() wait(10) assert() if(dial(@20)) exit(0)
     set(20,add(@20,1)) if(!compare("@20,'11')) jump(4)
     jump(3)
----------END OF MACRO----------