An example could be:
berries=berries_on_tree(tree1);
if (berries>=10)
{
harvest_berries(tree1);
}
Of course, some "energy" meter would also be depleted at the same time to stop people "harvesting" all the time.
Avatar! Yes, I created the very first DSi Browser extension! (http://dsiextensions.co.cc)