An ethnoprimatology paper by Riley and Priston (2010) on the American Journal of Primatology, Macaques in farms and folklore: exploring the human-nonhuman primate interface in Sulawesi, Indonesia (free abstract) explores the complex interaction between macaques and humans through overlapping resource use and cultural perceptions of macaques. If you do not have access to the paper, I can send you a copy of the pdf.
Macaca tonkeana, one of the endemic macaque species of Sulawesi. Photo from Wikipedia.
There are six species of macaques endemic to the island of Sulawesi. Macaca nigra, Macaca nigrescens, Macaca maura, Macaca tonkeana, Macaca hecki and Macaca ochreata. Despite constant crop raiding by macaques, farmers in Sulawesi show considerable tolerance to this behavior. This tolerance can be explained by a positive reinforcement in the farmer's local culture, folklore and religion. Two types of farming subsistence exists in Sulawesi: dryland crops and wet-rice agriculture.
Most dryland crops farmers are Muslim. They abstain from killing and/or eating these macaques (which Balinese Hindus would have no problem doing) as it is considered haram. In the Lindu highlands, the macaques are considered kin by the To Lindu people. In Buton, certain places in the forest are considered sacred, thus these places are protected by the locals. Macaques and other animals benefits from this protection, making these pockets of forest their refuge.