It may have been the last 25-cent cigaret machine ever. Huddled in a ramshackle gas station between Springfield and Eugene, Ore., in 1968, it sported the rounded corners and mirrored front characteristic of the '40s and '50s.

There was no power cord, no light-bulbs, no pushbuttons and no question about exact change. The reward for your quarter was a solid 'shing-thunk' and one of eight brands of cigarets. Had I known it was the last specimen, I'd surely have bought an extra pack.

The path of the vending machine has always been marked out in tobacco. The first vending machine appeared in English taverns about 1615, a rectangular brass tobacco box fitted with a handle so the barmaid could carry it to the table. The customer inserted a halfpenny in the slot, pushed a sturdy plunger and up popped the hinged lid. The amount of tobacco or snuff dispensed depended entirely on the buyer's honesty and the barmaid's vigilance, thus giving birth to a tradition of petty larceny that comes down to us today in the form of two-newspapers-for-15-cents from the street vending box.

Three hundred-plus years later, a clever fellow named William Rowe got the idea to build a machine that would sell packs of cigarets for 15 cents. Rowe was the first to vend anything more valuable than a penny stick of gun. Cigaret wholesalers laughed at Rowe - no one would pay an extra four cents just for the sake of convenience. Some of them strangled on that chortle. In 1968, Rowe Manufacturing was sold to Triangle Industries for $30 million. Meanwhile, in 1977, Americans hit the slots for nearly 4 1/2 billion packs.

The cost averaged 65 cents per pack. Even in Oregon.

Richard Carlile had a bright idea. A bookseller specializing in freethinking tracts, Carlile figured out how to beat the strict English censorchip laws. In 1822, in his Temple of Reason bookshop, he set up an ungainly device with a clocklike face. The first book vending machine. The purchaser merely set the dial at the book of his choice, inserted his money and - splat - out dropped the controversial volume. Since no human hands dispensed the book, no person could be arrested for selling it.

Wrong. Slashing through Carlile's obfuscatory maneuver like Ralph Nader through bureaucracy, the English courts held Carlile responsible for the sales, and jailed the employe who loaded the books into the device.

So ended, long before its time, the brief heyday of automated bookselling.

In 1888, Thomas Adams' best-selling gum was an exotic concoction called Tutti-Frutti (an anglicization for "all-fruit"). Adams hired an engineer to design a vending machine for penny pieces of his Tutti-Frutti. He prevailed upon the city of New York to franchise locations on the subway platforms of its transit system. Boing! The machines were an immediate hit and the penny gum vendor was hailed as the wave of the future.

Soon, the French were installing chocolate and wine dispensers; the Germans, cold drink machines; the Americans, weighting scales. In no time, the boom had extended to post cards, postage stamps, peanuts and perfume. Public machines became a fad in gadget-happy America, and cigas, matches, lighter fluid, ice, paper towels and sanitary napkins went up for mechanized grabs. New York's United Cigar store even featured a bank of machines that offered a tinny "thank you" (courtesy of a built-in phonograph) when cigar change was deposited.

In the waning years of the 19th century, in tiny Corinne, Utah, vending reached a peak (or valley) of some sort with a machine that would, for $2.50 in half dollars and the pull of a lever, deliver an entirely legal set of divorce papers, ready to be filled in. Fortunately for the institution of marriage, the exact-change divorce never caught on, though it remains fascinating to consider the possibilities if it it had.

There occurred a black moment in vending history in 1909, when Dr. Emil Luden returned from a visit to Germany with the idea for a coin-operated door lock. Luden patented it and formed the Nik-U-Lok Company to manufacture and sell the locks for washroom doors.

The good news is that Luden's pay toilet idea didn't catch on.

The bad news is that a man named C. C. Van Cleve bought Nik-U-Lok - lock, stock and patents - from Dr. Luden. He proceeded to make a fortune, turning the pay toilet into one of the peculiar irritations of American life.

There are 5 million vending machines in the United States, which means that at least 4.9 million are out there waiting patiently for their chance to steal your last dime at 3:15 in the morning.

Of those, a full third of them dispense soft drinks in bottles, cans, cups and, sometimes, directly through the drain grid. The simple glass-globe bubblegum machines account for an additional 915,000 cigaret machines for 875,000, candy and snack vendors 835,000 and coffee another 265,000. In other words, for all our sneering and jeering, we are hooked. Hooked, in fact, to the tune of nearly $11 billion of loose change a year. Cold drinks come in at $3.5 billion, cigarets at $2.7 billion, candy and snacks at $1.25 billion and coffee at just under a billion. That's an average of $30 million every day or, brace yourself, $20,000 every minute of every day.

Broken down, that means that every 60 seconds, we buy 7,500 packs of cigarets, 25,000 cold drinks, 8,000 cups of coffee and 12,000 packages of candy, taco chips and the like. No wonder movie theater seats grow larger each year.

To open the door of one is to discover a fair imitation of a Rube Goldberg nightmare.

The financial guts of the device, a '30s invention called the rejector mechanism, is nothing but a jumble of slides and weights guarded by a magnet. The magnet detects slugs and depending on their metal content, either sends them spinning down the coin return chute or holds them (jamming the machine and precipitating blue clouds of curse words from subsequent patrons). Once past the magnet trap, the coin slides through a series of weight-and size-gauging levers that direct it down either the quarter, dime or nickel track. Pennies make it down to the dime track, but, just a bit too large, are banished to the reject chute. Nice try, though.

Directly beneath the rejector is another gadget-box called the totalizer. When a nickel falls through, it trips the lever once. A dime trips it twice. A quarter trips a lever that registers five clicks on the totalizer. When the requisite number of clicks has been clocked, the mechanism will operate.

According to a report made to the U.S. Mint by the National Automatic Merchandising Assn., whose purpose it is to collect such minutiae, during 1977, we dumped about 3 million pennies, 14 billion nickels, 37 billion dimes and 25 billion quarters into the slot. The big loser is the penny. Since 1965 alone, penny volume has dropped off by more than 4 billion. Alas, the nickel too is becoming an endangered species (down 5 million), coffee balloons inexorably from 15 to 20 to 25 cents a cup, soda from 20 to 30 cents and candy bars to a quarter. Even the penny bulk vendors are now being supplanted by 25-cents "trinket and capsule" machines. Only 8 percent of the bubbleheads are now penny-activated, while quarter-operated machines account for 36 percent. Sigh.

Most vending machines are fairly simple devices. The money activates the mechanism, the button releases a lever or tray . . . kerplunk, you get the goods.

Cup-vending soda machines are a little trickier, since they mix the contents after your selection. The inside looks like a miniature old fashioned soda-fountain, with shiny vats of syrup, a water tank and a compressor to keep the water carbonated. Another device diverts some of the water to make and shave ice.

Coffee machines are even cuter. Believe it or not, the signs boasting of "Fresh Brewed Coffee" are usually true. When you push the button, a small heap of ground coffee is dispensed onto a filter, a cup of hot water dribbles into a container above it, and a mechanism then pushes the water through the grounds. If "light and sweet" is how you request it, as the coffee runs down a plastic trough toward the cup, doses of powdered cream and sugar are dumped in. All this mechanical magic produces the nearly undrinkable mixture we have learned to love - or at least to drink without gagging. No one seems up to explaining why machine-brewed coffee is so much fouler than home brew but probably has much to do with cheap coffee grounds gone stale, long-standing water, dirty machinery and hurry-up brewing.