    { netlogon.mt - perform logon to the infonet network videotex center }

    { send CRs until we get a response from the network }
    loop 8
        type CR
        wait 8
            case '#'
                break
            case '*'
                branch reqService
        endwait

        at_end_do
            message 'PAD not responding with #'
            quit
    endloop

    { request X.3 pad service }
    type 'x' CR
    wait 100
        case '*'                        { success }
            { do nothing }
        failure
            message 'PAD not responding with *'
            quit
    endwait

reqService:                             { request connection to VCC }
    type '.vmt' CR          

    { wait for connection }
    wait 600
        case '^_IS^Q'                   { wait till the userid prompt }
            { send userid if present }
            if userid then
                type userid NEXT            { send network userid/password }

                { send password if present }
                if password then
                    { wait for password prompt }
                    wait 100 case '^_MS' endwait

                    { switch to graphics mode to hide password }
                    type '^_MW^N^SG^SG^SG^SG' password SEND
                endif
            endif
        case 'CLR', 'ERR'
            message 'Unable to connect to network service'
        failure                         { timeout or line dropped }
            message 'User ID prompt not received'
    endwait
    end

