You don't. There is an html5 element called "canvas" which allows for all sorts of opportunity. I presume that jagex is using a mixture of WebGL and JavaScript to integrate their html client.
so, why is it? every other bot I have ever worked with has never had their scripts run a .groovy extension. They have all be made to run compiled java scripts usually extending a script class or something of the sort. Why is this one different?