Just use sts (Skull torcha scriptable).
You can make or download any scripts, they do almost anything because there are alot of commands. It supports java scripts and also textscripting. You should join www.wartnet.org/forums.php (www.wartnet.org is slower) for more information on STS as that used to be the homepage, altho it kind of died the topics are still findable.