isitchristmas/web — pull request #93 by RnbwNoise (2014-12-20 22:01:25+00:00)
Title: API: Added support for user-defined event listeners to facilitate the development of responsive bots.

## Documentation

### array IIC.addEventListener(string event, function(data) listener)

Sets a handler for a given event. Returns the handler's identifier.

### void IIC.removeEventListener(array listenerId)

Removes an event handler with a given identifier.

### array IIC.onChat(function(string userId, string message) listener)

Sets a chat message handler and returns its identifier.

### array IIC.onMovement(function(string userId, int newX, int newY) listener)

Sets a flag movement handler and returns its identifier.

### array IIC.onRotation(function(string userId, float newAngle) listener)

Sets a flag rotation handler and returns its identifier. The handler will receive an angle in radians.

### array IIC.onWave(function(string userId, int waveX, int waveY) listener)

Sets a wave (left mouse click) handler and returns its identifier.

### array IIC.onGhost(function(string userId, int ghostX, int ghostY) listener)

Sets a ghost (right mouse click) handler and returns its identifier.

### boolean IIC.isConnected(string userId)

Returns true if a user with given id is still connected.

### string IIC.getCountry([string userId])

Returns the current country, or that of another user if his id is provided.