Update botlib.py with calc function.