On June 19, 1987 at 9:47 am Eastern Standard Time, planet Earth passes through the tail of a rogue comet, Rhea-M, for just over a week. In Wilmington, North Carolina, machines suddenly come to life and attack humans. A marquee sign about a bank displays an insult and an ATM calls a bank customer an "asshole." (The bank client is writer-director Stephen King, in a cameo.) The town's drawbridge suddenly lifts itself, spilling cars and trucks off of it, killing several people much to the shock of the elderly bridgekeeper and his dim-witted assistant..
At the Dixie Boy truck stop outside town, Bill Robinson (Emilio Estevez), a recently paroled prisoner from the state pen, working as the short order cook, meets with his new boss, Hendershot (Pat Hingle), the owner of the truck stop. The nasty redneck Hendershot has a system worked out to make life unbearable for parolees who come to work for him, mostly forcing them to work overtime for no pay (as part of his twisted way to exploit them). Hendershot threatens to send Bill back to prison if he doesn't agree to work for extra hours "off the clock".
A few of the Dixie Boy's regulars drive up in their semi-haulers. One of them is a man, named Handy, who works for Happy Toyz and has a huge green goblin's face mounted on the front of his truck. Some time after he pulls up, his truck starts itself up and moves about 100 feet on it's own. Handy can't believe it since he has the keys.
While filling a vehicle with diesel fuel, mechanic Duncan Keller notices that the flow of diesel from the nozzle has stopped. He looks down the nozzle and it suddenly squirts him in the eyes, temporarily blinding him. Fellow employees, Steve and Joe, tend to him.
In the video game room, a would-be thief is stealing change from the machines and gets electricuted by a huge surge of electricity from one of the video games.
While tending the stove, the truck stop waitress Wanda June gets seriously injured when an electric carving knife turns itself on and cuts a deep cash on her left forearm. Bill runs in to tend to her wound and smashes the electric knife with a hammer.
Meanwhile, at a junior league baseball game, the winning coach wants to buy sodas for his team. The soda machine swallows his money and then shoots the cans at high speed, hitting him first in the crotch, then in the head, killing him. The machine spits more cans at the players, who run from the field. One of the players, Deke, a catcher, quickly puts his catcher's mask over his face when several cans fly toward him. Suddenly, a steamroller breaks through the scoreboard and runs over one of the young players. Deke notices that the steamroller has no driver. He mounts his bicycle and races off.
On a deserted freeway, a female hitchchiker, named Brett Graham (Laura Harrington), is riding with a gross lecherious Bible salesman and con artist, named Loman, who makes inappropriate passes against her. Trying to get a signal on the car radio, Brett briefly hears a vague news announcement, over garbled and static broadcasting, speaking of "unexplained events" being reported, as well as about the local microwave facilities being inoperative, and issuing a urgent message to "get away at once" from all the local roads or major highways. Brett is forced to grab the steering wheel and pull into the Dixie Boy truck stop when Loman does not stop. They argue over this when the Happy Toyz truck starts by itself while Joe is still filling it with fuel and it moves a short distance. Upon checking the inside to the truck's cab, Bill finds the cabin empty. Brett notices that there are no cars on the road at all, something unusual for 10:00 am in the morning.
In town, Duncan's son, Deke, sees that many people have been killed at their homes by machines. He hears another garbled radio broadcast about machines all over the world coming to life and killing people. One of them is a blood-splattered runaway lawnmower, which chases him but he is able to easily outrun it. He then hides from a driverless ice cream truck, which doesn't detect him in the bushes. Deke waits until the truck is gone and rides for the Dixie Boy where his father works.
On another back road, a ditzy redneck newlywed couple, Curtis and Connie, are driving toward their honeymoon destination. They notice that there are many stalled and wrecked cars along the road. They pull into a local garage to find the mechanic dead, and a tow-truck starting up and trying to run them down. Curtis manages to duck out of the way and the tow truck crashes into the garage. Curtis and Connie then drive away.
Back at the Dixie Boy, Duncan attempts to leave to look for his son despite protests from Bill and threats from Hendershot (implying that Duncan is also an ex-con and that Hendershot is exploiting his background for his own gain). But while walking to his truck, one of the sedate trucks starts up and runs over Duncan, killing him. The con-artist Bible salesman, Camp Loman, runs out to insult the "driver" only to realize that no one is driving the truck. The Happy Toyz truck starts up again and chases Loman a short distance and backs up into him, sending him flying and landing in a nearby ditch. Steve and Handy then drag Duncan's dead body back inside and Hendershot orders him to be placed in the basement with the dead body of the video game player. With the phones and CB radios out of order, the group inside the truck stop debates on what to do next when all of the 18-wheeler semi trucks at the truck stop start up and begin to drive in a circle around the truck stop building, trapping the people inside.
Back on the deserted highway, Curtis and Connie spot a long convoy of driverless trucks traveling on the opposite end of the road when one of the trucks, an older model flatbed, notices them and begins to chase them. Curtis is able to maneuver away from the truck and cause it to crash off an embankment, destroying it. He sees the sign for the Dixie Boy and takes the exit.
Upon arrival, Curtis and Connie see the truck stop under siege by the circling trucks and when Curtis attempts to drive through the circle to reach the safety of the inside, their car is hit and gets toppled over by one of the trucks. Bill and Brett run outside and rescue Curtis and Connie and as they run back, Hendershot walks out with a M-72 66mm LAW (light anti-tank) rocket launcher and blows up two of the trucks with anti-tank rockets, saving them.
A little later, Bill asks Joe about the weapons Hendershot has in the basement. Bill and Brett venture to the cellar and discover a huge stash of weapons ranging from assault rifles to rocket launchers to grenades. Hendershot appears and threatens to send Bill back to prison for snooping around, but Bill arms himself and warns Hendershot not to interfere with him. Bill confides in Brett about his criminal past about robbing a grocery store and his predicament and that Hendershot does not seem to take anything seriously.
At nightfall, the power in the truck stop goes out as the trucks continue circling the building. Brett notices a bright green light covering the sky and deducts that the passing comet is responsible. Bill suggests traveling to an island where there are no vehicles or machines and hide out until it is all over.
A little later, when everyone hears the sounds of the injured Camp Loman screaming from the ditch where he landed earlier, Bill and Curtis volunteer to go out to rescue him. Carrying weapons borrowed from Hendershot's arsenal as well as rope, they run to a nearby building past the trucks (many of which are starting to run out of fuel) and lower themselves into a nearby sewer drainpipe to lead to the ditch where Loman is.
In the meantime, Deke has made it to the Dixie Boy and crawls through another drainpipe to the creek where Loman is, but the wounded and near-death Bible salesman, by this time has become insane and tries to kill Deke when he approaches him. Bill and Curtis come by and grab Deke away as a dump truck spots them and attempts to run them down, forcing them leave behind Loman (whom is presumably dead by this point) and back into the drainpipe. They make it back to the showers building and run across the parking lot back to the Dixie Boy, with Bill blowing up another truck with his rocket launcher. Bill at first refuses to tell Deke where his father is until Hendershot blurts out that Duncan was killed earlier by one of the trucks. Deke is devastated, while everyone (Brett most of all) is angry at Hendershot for being so insensitive. Hendershot remains oblivious to his own actions.
The next morning, most of the trucks have stalled, having run out of gas. However, two more trucks arrive, they are a large bulldozer and a small military vehicle with a M-60 machine gun mounted. When the bulldozer crashes into the building, Hendershot (despite the protests from Bill) fires a rocket at it, temporarily disabling it. As a result, the military vehicle opens fire on the Dixie Boy building. In the storm of bullets, Hendershot, Wanda June, and three of the truck drivers are fatally gunned down. Then the military vehicle begins beeping its horn in a morse code message which Deke translates as "Someone must pump fuel. Someone will not be harmed. All fuel must be pumped."
When the power for the building comes on again, Bill decides to turn on the pumps, despite Brett's protests not to trust the trucks. Bill points out that they have to with the military vehicle's presence. Over most of the day, in 100F degree heat, Bill, Brett, Deke, Curtis, and a few others take turns venturing outside and refueling all the trucks, plus hundreds more trucks that arrive at the Dixie Boy to refuel. When the fuel runs out, a driverless tanker truck appears and beckons Bill to refill the truck stop's fuel tanks to continue the refueling.
Exhausted by the hard work and the heat, Bill retires to rest where Brett comforts him. Bill points out a possible explanation for these events as being a race of aliens using the comet to wipe out humanity and having the machines making them work as their slaves.
Handy tells Bill about working on an escape where they will get out through the basement and to a drainage pipe to the outside. Sometime later, Bill walks outside where he talks to another truck driver filling up the trucks where he drops a grenade into the small military vehicle, destroying it. With that, all of the refueled trucks begin circling the Dixie Boy once again.
At nightfall, Bill, Brett, Deke, Curtis, Connie and the rest of the survivors escape through the drainage pipe, armed with various weapons from the late Hendershot's arsenal and decide to make a run for the open ocean and to the island where there are no trucks. When the trucks see that the people inside the Dixie Boy are gone, they all smash into the building, destroying it in a series of spectacular explosions.
Bill leads the survivors across the back roads and fields in the area to make it to the local marina to find a sailboat to take them to the island. They have narrow encounters with numerous machines including the driverless ice cream truck. Upon arrival at the marina, they all head out to a sailboat when one of the truck drivers, named Brad, attempts to steal a diamond ring from the corpse of a woman caught in her car passenger window when the leader of the living trucks, the Green Goblin of Happy Toyz, arrives and runs down Brad, killing him. Bill runs from the docks and quickly destroys the Happy Toyz truck with a rocket launcher.
In the final shot, Bill, Brett and the rest of the dozen survivors sail away from the marina to find help and safety. A disclaimer in the final shot reveals that two days later a Russian "weather satelite" destroyed a large UFO orbiting Earth with nuclear tipped missiles, causing all machines to become sedate. Another two days later, Earth passed through the tail of the comet and everything seemingly returned to normal. It is also implied that the Dixie Boy survivors were the only survivors to the worldwide machine revolt.