Added more logic and a new event to listener, imported new API:
http://pastebin.com/rscFbS1f (IDAPI.java)
random