I unchecked "Show battery status in menu bar" in System Preferences > Energy Saver, because I use coconutBattery instead (and obviously I don't want to just re-check that).

But this means that now my MacBook doesn't alert me when the battery is getting low and just drains itself to 0% then dies on me.

I want to make an automatic AppleScript/cron job/whatever to alert me when the battery is less than 50%, and again when it's less than 20%.

How can I do that?