Angry Anne Carson, from Auchinleck, East Ayrshire, climbed out a window at her home in the village's Old Avenue and fired shots at kids as they walked past on their lunch break.
Two 14-year-olds were struck by the gun's plastic pellets as they tried to escape Carson's potshots on May 21 last year.
Ayr Sheriff Court heard Carson, 40, kept the gun in a cupboard next to her cereal box and decided to take matters into her own hands because she thought her daughter's school were not dealing adequately with bullies
Procurator fiscal Mr Sheeran said: "On Monday, May 21, 2018, the two school pupils were returning to school on their lunch break.
"They were walking along Old Avenue in Auchinleck.
"They saw the accused hanging out the window of her home shouting she was coming to get them."
Mr Sheeran described Carson using the gun to fire at the kids, with pellets striking one of the children on the arm and another on the leg.
He added: "She climbed out the window and started running after them.
"Once in the school it was reported to staff."
The court heard police attended Carson's home and she showed officers the gun.
Defence counsel Tony Currie told the court: "This background has been going on for a number of years.
"She has a daughter ages with the pupils involved.
"Half way through primary her child was subject of bullying.
"She moved school for the last two years of primary but she was in high school with the pupils again.
"The bullying involved assaults. When she reported it it caused issues within the school.
"She was regularly assaulted in her street.
"As far as Ms Carson was concerned nothing was getting done about this.
"A group came past, verbally abused her and she reacted in the most inappropriate way."
Carson at the time was ordered not to leave her house during the day in order to avoid any conflict with school kids.
Mr Currie added: "She has since moved and her daughter now lives in Ipswich with her father to get away from the problems.
Sheriff Desmond Leslie ordered Carson to complete 200 hours of unpaid work and told her: "This is not the Wild West."
He said: "Quite rightly you anticipated a custodial sentence with what have been the consequences of your actions.
"If you arm yourself of any weapon and fire projectiles at children there needs to be significant consequences.
"Having heard all the facts now I think I can step back from a custodial sentence.
"You are a woman who has had problems and continue to deal with issues but not terribly successfully I have to say.
"This is not the Wild West we live in.
"Fortunately this problem you encountered looks to have terminated because you moved away but you cannot lose your composure in such a way that you arm yourself and fire at children."