I made a recovery script for my clan's buff bot, and now the bot sometimes casts buffs on its self instead of on the intended target.
The scenario goes something like this:
Person A requests a buff
x out of y casts are made on Person A
bot runs out of mp and runs the recovery script
y-x casts...