po-devs/pokemon-online — pull request #309 by TheUnknownOne (2013-07-04 14:22:54+00:00)
Title: BattleMessage event

Fully tested.

One thing I'd like though is the ability to send messages to the battlers and spectators (which would truly make server battle commands a possibility). BattleBase's battleChat crashes both clients if called with an id of -1, and there doesn't seem to be much else to try.

---

Test script:
```javascript
({
beforeBattleMessage: function (src, message, battleId, spectator) {
print(src, message, battleId, spectator);
}
})
```

Gives me this (with a setup of 2 battlers (obvious) and one spectator):
`
src message battleId isSpectator
1 Message from battler #1 2 false
2 Message from battler #2 2 false
4 Message from spectator 2 true
`