Skip to content

Client Script Events

Garma edited this page Jun 19, 2013 · 5 revisions

Scripting/Client/Events

Client

  • stepEvent() This event is called every second.
  • clientStartUp() Called when the client connects to a server.
  • clientShutDown() Called just before a client exits from a server.

Players

  • onPlayerReceived(id) Called when the client first detects a player.
  • onPlayerRemoved(id) Called when the client detects a player leaving.
  • onPlayerJoinChan(id, channel) Gets called everytime someone joins a channel you're in. id is the player's id and channel is the channel's id. Unstoppable Event.
  • onPlayerLeaveChan(id, channel) Gets called everytime someone leaves a channel you're in. id is the player's id and channel is the channel's id. Unstoppable Event.

Extended Events

These events have a beforeEvent and afterEvent version.

Channel Messages

  • SendMessage(message, channel) Called when the client is about to send a chat message. Stoppable.
  • ChannelMessage(message, channel, html) Called before the client prints a channel message. Stoppable. This event is even called if the target is ignored. It is also called when using client.printChannelMessage() (be aware of that)
  • NewMessage(message, html) Gets called before a global message is received. message is the message itself and html is a booleon (true/false) representing whether or not it's a html message. Stoppable Event.

Private Messages

  • PMReceived(id, message) Called before the client prints a PM from another user. Stoppable.

Battles

  • ChallengeReceived(challengeId, opponentId, tier, clauses) Gets called before a challenge is sent to you. challengeId is the id of the challenge, opponentId is the id of the person sending the challenge, tier is the name of the tier and clauses is an integer represting the clauses. Stoppable event