Asgarnia is based on RuneSource and has Python. I don't even know Python but it's incredibly similar to Java and I was able to learn it in a few minutes. It's nice because it keeps all the clickingobjects, iteminteractions etc out of the main files.
Code:
def objectOptionOne_chest(player):
if player.getClickId() == 10284:
Barrows.openChest(player)
Where "chest" is literally the name of the object we're clicking. Obviously, there's lots of chests so we want to open the one with a specific id. Boom. It's done.