[TASK] Added System.out debug

This commit is contained in:
Jeroen Ketelaar
2019-05-23 04:36:48 +02:00
parent fa39956ef0
commit 89316455ff
12 changed files with 36 additions and 22 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ notifications:
env: env:
global: global:
- PROVIDER_VERSION=1.21.4 - PROVIDER_VERSION=1.21.5
cache: cache:
directories: directories:
+2 -2
View File
@@ -6,7 +6,7 @@
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>317-api-minified</artifactId> <artifactId>317-api-minified</artifactId>
<version>1.21.4</version> <version>1.21.5</version>
<name>Parabot 317-API-Minified</name> <name>Parabot 317-API-Minified</name>
<licenses> <licenses>
@@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>client</artifactId> <artifactId>client</artifactId>
<version>2.6.1</version> <version>2.8.1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>*</artifactId> <artifactId>*</artifactId>
@@ -22,5 +22,9 @@ public class DAnimation extends AbstractDebugger {
@Override @Override
public void toggle() { public void toggle() {
enabled = !enabled; enabled = !enabled;
if (enabled) {
Players.getMyPlayer().getAnimation();
}
} }
} }
@@ -14,13 +14,13 @@ public class DCollisionFlags extends AbstractDebugger {
@Override @Override
public void paint(Graphics g) { public void paint(Graphics g) {
PaintDebugger p = Context.getInstance().getPaintDebugger(); PaintDebugger p = Context.getInstance().getPaintDebugger();
Tile location = Players.getMyPlayer().getLocation(); Tile location = Players.getMyPlayer().getLocation();
Tile north = new Tile(location.getX(), location.getY() + 1); Tile north = new Tile(location.getX(), location.getY() + 1);
Tile south = new Tile(location.getX(), location.getY() - 1); Tile south = new Tile(location.getX(), location.getY() - 1);
Tile west = new Tile(location.getX() - 1, location.getY()); Tile west = new Tile(location.getX() - 1, location.getY());
Tile east = new Tile(location.getX() + 1, location.getY()); Tile east = new Tile(location.getX() + 1, location.getY());
int flag = Game.getCollisionFlags()[location.getRegionX()][location.getRegionY()]; int flag = Game.getCollisionFlags()[location.getRegionX()][location.getRegionY()];
p.addLine("Collision flag: 0x" + String.format("%X", flag)); p.addLine("Collision flag: 0x" + String.format("%X", flag));
p.addLine("Reachable: [ cur: " + location.isReachable() + ", north: " + north.isReachable() + ", south: " + south.isReachable() + ", east: " + east.isReachable() + ", west: " + west.isReachable() + " ]"); p.addLine("Reachable: [ cur: " + location.isReachable() + ", north: " + north.isReachable() + ", south: " + south.isReachable() + ", east: " + east.isReachable() + ", west: " + west.isReachable() + " ]");
p.addLine("Walkable: [ cur: " + location.isWalkable() + ", north: " + north.isWalkable() + ", south: " + south.isWalkable() + ", east: " + east.isWalkable() + ", west: " + west.isWalkable() + " ]"); p.addLine("Walkable: [ cur: " + location.isWalkable() + ", north: " + north.isWalkable() + ", south: " + south.isWalkable() + ", east: " + east.isWalkable() + ", west: " + west.isWalkable() + " ]");
@@ -5,7 +5,6 @@ import org.parabot.core.paint.AbstractDebugger;
import org.parabot.core.paint.PaintDebugger; import org.parabot.core.paint.PaintDebugger;
import org.parabot.core.ui.Logger; import org.parabot.core.ui.Logger;
import org.rev317.min.api.methods.GroundItems; import org.rev317.min.api.methods.GroundItems;
import org.rev317.min.api.methods.Interfaces;
import org.rev317.min.api.wrappers.GroundItem; import org.rev317.min.api.wrappers.GroundItem;
import java.awt.*; import java.awt.*;
@@ -25,5 +25,10 @@ public class DInterfaces extends AbstractDebugger {
@Override @Override
public void toggle() { public void toggle() {
enabled = !enabled; enabled = !enabled;
if (enabled) {
System.out.println("Open interface: " + Interfaces.getOpenInterfaceId());
System.out.println("Open back dialog: " + Interfaces.getBackDialogId());
}
} }
} }
@@ -36,8 +36,11 @@ public class DInventory extends AbstractDebugger {
@Override @Override
public void toggle() { public void toggle() {
enabled = !enabled; enabled = !enabled;
for (Item i : Inventory.getItems()) {
System.out.println("ID: " + i.getId() + " Stack: " + i.getStackSize() + " Slot: " + i.getSlot()); if (enabled) {
for (Item i : Inventory.getItems()) {
System.out.println("ID: " + i.getId() + " Stack: " + i.getStackSize() + " Slot: " + i.getSlot());
}
} }
} }
+5 -2
View File
@@ -26,7 +26,10 @@ public class DMap extends AbstractDebugger {
@Override @Override
public void toggle() { public void toggle() {
enabled = !enabled; enabled = !enabled;
System.out.println("Location: " + Players.getMyPlayer().getLocation());
System.out.println("Plane: " + Game.getPlane()); if (enabled) {
System.out.println("Location: " + Players.getMyPlayer().getLocation());
System.out.println("Plane: " + Game.getPlane());
}
} }
} }
@@ -23,5 +23,9 @@ public class DMouse extends AbstractDebugger {
@Override @Override
public void toggle() { public void toggle() {
enabled = !enabled; enabled = !enabled;
if (enabled) {
System.out.println("Mouse: " + Mouse.getInstance().getPoint().toString());
}
} }
} }
@@ -5,7 +5,6 @@ import org.parabot.core.paint.AbstractDebugger;
import org.parabot.core.paint.PaintDebugger; import org.parabot.core.paint.PaintDebugger;
import org.parabot.core.ui.Logger; import org.parabot.core.ui.Logger;
import org.rev317.min.api.methods.Npcs; import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.methods.Players;
import org.rev317.min.api.wrappers.Npc; import org.rev317.min.api.wrappers.Npc;
import java.awt.*; import java.awt.*;
@@ -34,7 +33,7 @@ public class DNpcs extends AbstractDebugger {
return; return;
} }
for (Npc n : Npcs.getNearest()) { for (Npc n : Npcs.getNearest()) {
System.out.println("ID: " + n.getDef().getId() + " Distance: " + n.distanceTo() + " Location: " + n.getLocation().toString()); System.out.println("ID: " + n.getDef().getId() + " Distance: " + n.distanceTo() + " Location: " + n.getLocation().toString() + " Index: " + n.getIndex());
} }
} }
} }
@@ -4,7 +4,6 @@ import org.parabot.core.Context;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.parabot.core.paint.PaintDebugger; import org.parabot.core.paint.PaintDebugger;
import org.parabot.core.ui.Logger; import org.parabot.core.ui.Logger;
import org.rev317.min.api.methods.GroundItems;
import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Players;
import org.rev317.min.api.wrappers.Player; import org.rev317.min.api.wrappers.Player;
@@ -4,7 +4,6 @@ import org.parabot.core.Context;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.parabot.core.paint.PaintDebugger; import org.parabot.core.paint.PaintDebugger;
import org.parabot.core.ui.Logger; import org.parabot.core.ui.Logger;
import org.rev317.min.api.methods.GroundItems;
import org.rev317.min.api.methods.SceneObjects; import org.rev317.min.api.methods.SceneObjects;
import org.rev317.min.api.wrappers.SceneObject; import org.rev317.min.api.wrappers.SceneObject;
@@ -13,14 +12,13 @@ import java.util.Comparator;
public class DSceneObjects extends AbstractDebugger { public class DSceneObjects extends AbstractDebugger {
private boolean enabled;
public static final Comparator<SceneObject> SCENE_OBJECT_COMPARATOR_DISTANCE = new Comparator<SceneObject>() { public static final Comparator<SceneObject> SCENE_OBJECT_COMPARATOR_DISTANCE = new Comparator<SceneObject>() {
@Override @Override
public int compare(SceneObject o1, SceneObject o2) { public int compare(SceneObject o1, SceneObject o2) {
return o1.distanceTo() > o2.distanceTo() ? 1 : o1.distanceTo() == o2.distanceTo() ? 0 : -1; return Integer.compare(o1.distanceTo(), o2.distanceTo());
} }
}; };
private boolean enabled;
@Override @Override
public void paint(Graphics g) { public void paint(Graphics g) {