How to debug TWCore using Eclipse

Debugging in Eclipse is fairly easy and straightforward if you get the hang of it.

In a nutshell:

  1. Set a breakpoint somewhere in the code where you want to check the variables or to see the flow of the executing code.
  2. Switch to the debug perspective when the breakpoint is passed
  3. Examine the variables in the debug perspective
  4. Use the debug buttons (Step Into, Step Over, Step Out) to see the code that's being executed, line by line.



As an example, I will debug the following modified (and simplified) ultrabot as I need to know the value of the variable messagesCount on line 18 :

package twcore.bots.ultrabot;

import twcore.core.*;
import twcore.core.command.*;

public class ultrabot extends SubspaceBot {

    private int messagesCount;

    /** Creates a new instance of ultrabot */
    public ultrabot(BotAction botAction) {

    public void handleEvent(Message event) {
        if(messagesCount == 70) {

    public void handleEvent(LoggedOn event) {

... More to come :)