Re-arranged code

This commit is contained in:
JKetelaar
2014-08-19 03:08:07 +02:00
parent d19933b14f
commit 88050384f8
54 changed files with 2867 additions and 2843 deletions
+4 -6
View File
@@ -22,15 +22,17 @@ import java.io.File;
import java.net.URL; import java.net.URL;
/** /**
*
* @author Everel * @author Everel
*
*/ */
@ServerManifest(author = "Everel & Paradox", name = "Server name here", type = Type.INJECTION, version = 2.1) @ServerManifest(author = "Everel & Paradox", name = "Server name here", type = Type.INJECTION, version = 2.1)
public class Loader extends ServerProvider { public class Loader extends ServerProvider {
private Applet applet; private Applet applet;
private HookFile hookFile = new HookFile(Context.getInstance().getServerProviderInfo().getExtendenHookFile(), HookFile.TYPE_XML); private HookFile hookFile = new HookFile(Context.getInstance().getServerProviderInfo().getExtendenHookFile(), HookFile.TYPE_XML);
public static Client getClient() {
return (Client) Context.getInstance().getClient();
}
@Override @Override
public Applet fetchApplet() { public Applet fetchApplet() {
try { try {
@@ -58,10 +60,6 @@ public class Loader extends ServerProvider {
return WebUtil.toURL(target); return WebUtil.toURL(target);
} }
public static Client getClient() {
return (Client) Context.getInstance().getClient();
}
@Override @Override
public void addMenuItems(JMenuBar bar) { public void addMenuItems(JMenuBar bar) {
new BotMenu(bar); new BotMenu(bar);
@@ -1,9 +1,7 @@
package org.rev317.min.api.events; package org.rev317.min.api.events;
/** /**
*
* @author Matt, Everel * @author Matt, Everel
*
*/ */
public final class GameActionEvent { public final class GameActionEvent {
private int index, cmd1, cmd2, cmd3, cmd4, action; private int index, cmd1, cmd2, cmd3, cmd4, action;
@@ -1,19 +1,16 @@
package org.rev317.min.api.events; package org.rev317.min.api.events;
/** /**
*
* @author Everel, Matt * @author Everel, Matt
*
*/ */
public final class MessageEvent { public final class MessageEvent {
private int type;
private String name;
private String message;
public static final int TYPE_GENERIC = 0; public static final int TYPE_GENERIC = 0;
public static final int TYPE_PLAYER = 2; public static final int TYPE_PLAYER = 2;
public static final int TYPE_TRADE = 4; public static final int TYPE_TRADE = 4;
public static final int TYPE_DUEL = 8; public static final int TYPE_DUEL = 8;
private int type;
private String name;
private String message;
public MessageEvent(final int type, String name, String msg) { public MessageEvent(final int type, String name, String msg) {
this.type = type; this.type = type;
@@ -3,9 +3,7 @@ package org.rev317.min.api.events.listeners;
import org.rev317.min.api.events.GameActionEvent; import org.rev317.min.api.events.GameActionEvent;
/** /**
*
* @author Matt * @author Matt
*
*/ */
public interface GameActionListener { public interface GameActionListener {
@@ -3,20 +3,20 @@ package org.rev317.min.api.interfaces;
import org.rev317.min.api.wrappers.Tile; import org.rev317.min.api.wrappers.Tile;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public interface Locatable { public interface Locatable {
/** /**
* Gets location of this locatable instance * Gets location of this locatable instance
*
* @return location * @return location
*/ */
public Tile getLocation(); public Tile getLocation();
/** /**
* Gets distance to this locatable instance * Gets distance to this locatable instance
*
* @return distance from player to locatable * @return distance from player to locatable
*/ */
public int distanceTo(); public int distanceTo();
+15 -19
View File
@@ -1,8 +1,5 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import java.util.HashMap;
import org.parabot.core.Context; import org.parabot.core.Context;
import org.parabot.environment.api.utils.Time; import org.parabot.environment.api.utils.Time;
import org.parabot.environment.input.Keyboard; import org.parabot.environment.input.Keyboard;
@@ -11,19 +8,27 @@ import org.rev317.min.api.wrappers.Item;
import org.rev317.min.api.wrappers.Npc; import org.rev317.min.api.wrappers.Npc;
import org.rev317.min.api.wrappers.SceneObject; import org.rev317.min.api.wrappers.SceneObject;
import java.util.ArrayList;
import java.util.HashMap;
/** /**
*
* @author Everel * @author Everel
* @author Matt123337 * @author Matt123337
*
*/ */
public class Bank { public class Bank {
public static final int[] BANKERS = new int[]{44, 45, 494, 495, 498, 499,
909, 958, 1036, 2271, 2354, 2355, 3824, 5488, 5901, 4456, 4457,
4458, 4459, 5912, 5913, 6362, 6532, 6533, 6534, 6535, 7605, 8948,
9710, 14367};
public static final int[] BANKS = new int[]{782, 2213, 2995, 5276, 6084,
10517, 11402, 11758, 12759, 14367, 19230, 20325, 24914, 25808,
26972, 29085, 52589, 34752, 35647, 36786, 2012, 2015, 2019, 693,
4483, 12308, 20607, 21301, 27663, 42192};
public static int BANK_INTERFACE = 5292; public static int BANK_INTERFACE = 5292;
public static int ITEM_INTERFACE = 5382; public static int ITEM_INTERFACE = 5382;
public static int BUTTON_DEPOSIT_ALL = 5386; public static int BUTTON_DEPOSIT_ALL = 5386;
public static int INV_PARENT_ID = 5064; public static int INV_PARENT_ID = 5064;
public static int BANK_OPEN_INDEX = 1; public static int BANK_OPEN_INDEX = 1;
static { static {
HashMap<String, String> p = Context.getInstance().getServerProviderInfo().getProperties(); HashMap<String, String> p = Context.getInstance().getServerProviderInfo().getProperties();
if (p.containsKey("bankInterface")) if (p.containsKey("bankInterface"))
@@ -38,15 +43,6 @@ public class Bank {
BANK_OPEN_INDEX = Integer.parseInt(p.get("bankOpenIndex")); BANK_OPEN_INDEX = Integer.parseInt(p.get("bankOpenIndex"));
} }
public static final int[] BANKERS = new int[] { 44, 45, 494, 495, 498, 499,
909, 958, 1036, 2271, 2354, 2355, 3824, 5488, 5901, 4456, 4457,
4458, 4459, 5912, 5913, 6362, 6532, 6533, 6534, 6535, 7605, 8948,
9710, 14367 };
public static final int[] BANKS = new int[] { 782, 2213, 2995, 5276, 6084,
10517, 11402, 11758, 12759, 14367, 19230, 20325, 24914, 25808,
26972, 29085, 52589, 34752, 35647, 36786, 2012, 2015, 2019, 693,
4483, 12308, 20607, 21301, 27663, 42192 };
/** /**
* Gets nearest banker * Gets nearest banker
* *
@@ -146,6 +142,7 @@ public class Bank {
* Gets bank item with given id * Gets bank item with given id
* *
* @param id * @param id
*
* @return bank item * @return bank item
*/ */
public static Item getItem(int id) { public static Item getItem(int id) {
@@ -166,6 +163,7 @@ public class Bank {
* Counts the amount of items with given id in bank * Counts the amount of items with given id in bank
* *
* @param id * @param id
*
* @return count * @return count
*/ */
public static int getCount(int id) { public static int getCount(int id) {
@@ -178,8 +176,7 @@ public class Bank {
/** /**
* Opens the bank * Opens the bank
* *
* @param bank * @param bank booth
* booth
*/ */
public static void open(SceneObject bank) { public static void open(SceneObject bank) {
@@ -209,8 +206,7 @@ public class Bank {
/** /**
* Deposits all items except the given ids * Deposits all items except the given ids
* *
* @param exceptions * @param exceptions the item indexes that will be ignored.
* the item indexes that will be ignored.
*/ */
public static void depositAllExcept(int... exceptions) { public static void depositAllExcept(int... exceptions) {
if (Bank.isOpen()) { if (Bank.isOpen()) {
@@ -3,9 +3,7 @@ package org.rev317.min.api.methods;
import org.rev317.min.api.wrappers.Tile; import org.rev317.min.api.wrappers.Tile;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Calculations { public class Calculations {
@@ -13,6 +11,7 @@ public class Calculations {
* Calculates distance between local player and given tile * Calculates distance between local player and given tile
* *
* @param tile * @param tile
*
* @return distance between local player and given tile * @return distance between local player and given tile
*/ */
public static final double distanceTo(Tile tile) { public static final double distanceTo(Tile tile) {
@@ -21,8 +20,10 @@ public class Calculations {
/** /**
* Calculates distance between two given tiles * Calculates distance between two given tiles
*
* @param a * @param a
* @param b * @param b
*
* @return distance between a and b * @return distance between a and b
*/ */
public static final double distanceBetween(Tile a, Tile b) { public static final double distanceBetween(Tile a, Tile b) {
@@ -38,7 +39,9 @@ public class Calculations {
* @param destX the destX (0 < destX < 104) * @param destX the destX (0 < destX < 104)
* @param destY the destY (0 < destY < 104) * @param destY the destY (0 < destY < 104)
* @param findAdjacent if it's an object, it will find path which touches it. * @param findAdjacent if it's an object, it will find path which touches it.
* @return The distance of the shortest path to the destination; or -1 if no valid path to the destination was found. *
* @return The distance of the shortest path to the destination; or -1 if no valid path to the destination was
* found.
*/ */
public static int dijkstraDist(final int startX, final int startY, final int destX, final int destY, final boolean findAdjacent) { public static int dijkstraDist(final int startX, final int startY, final int destX, final int destY, final boolean findAdjacent) {
try { try {
+8 -2
View File
@@ -3,14 +3,13 @@ package org.rev317.min.api.methods;
import org.rev317.min.Loader; import org.rev317.min.Loader;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Game { public class Game {
/** /**
* Gets BaseX * Gets BaseX
*
* @return baseX * @return baseX
*/ */
public static int getBaseX() { public static int getBaseX() {
@@ -19,6 +18,7 @@ public class Game {
/** /**
* Gets BaseY * Gets BaseY
*
* @return baseY * @return baseY
*/ */
public static int getBaseY() { public static int getBaseY() {
@@ -27,6 +27,7 @@ public class Game {
/** /**
* Gets open interface id * Gets open interface id
*
* @return interface id * @return interface id
*/ */
public static int getOpenInterfaceId() { public static int getOpenInterfaceId() {
@@ -35,6 +36,7 @@ public class Game {
/** /**
* Get open back dialog id * Get open back dialog id
*
* @return back dialog id * @return back dialog id
*/ */
public static int getOpenBackDialogId() { public static int getOpenBackDialogId() {
@@ -43,6 +45,7 @@ public class Game {
/** /**
* Gets loop cycle * Gets loop cycle
*
* @return loop cycle * @return loop cycle
*/ */
public static int getLoopCycle() { public static int getLoopCycle() {
@@ -51,6 +54,7 @@ public class Game {
/** /**
* Get collision flags * Get collision flags
*
* @return collision flags * @return collision flags
*/ */
public static int[][] getCollisionFlags() { public static int[][] getCollisionFlags() {
@@ -59,6 +63,7 @@ public class Game {
/** /**
* Gets current plane * Gets current plane
*
* @return current plane * @return current plane
*/ */
public static int getPlane() { public static int getPlane() {
@@ -67,6 +72,7 @@ public class Game {
/** /**
* Determines whether this client has action 4 hooked * Determines whether this client has action 4 hooked
*
* @return <code>true</code> if action 4 is hooked * @return <code>true</code> if action 4 is hooked
*/ */
public static boolean hasAction4() { public static boolean hasAction4() {
+10 -13
View File
@@ -1,9 +1,5 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.parabot.environment.api.utils.Filter; import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Client; import org.rev317.min.accessors.Client;
@@ -11,14 +7,14 @@ import org.rev317.min.accessors.Deque;
import org.rev317.min.accessors.Node; import org.rev317.min.accessors.Node;
import org.rev317.min.api.wrappers.GroundItem; import org.rev317.min.api.wrappers.GroundItem;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class GroundItems { public class GroundItems {
private static Client client;
private static final Comparator<GroundItem> NEAREST_SORTER = new Comparator<GroundItem>() { private static final Comparator<GroundItem> NEAREST_SORTER = new Comparator<GroundItem>() {
@Override @Override
@@ -27,7 +23,6 @@ public class GroundItems {
} }
}; };
private static final Filter<GroundItem> ALL_FILTER = new Filter<GroundItem>() { private static final Filter<GroundItem> ALL_FILTER = new Filter<GroundItem>() {
@Override @Override
@@ -36,6 +31,7 @@ public class GroundItems {
} }
}; };
private static Client client;
/** /**
* Gets all loaded ground items * Gets all loaded ground items
@@ -66,10 +62,9 @@ public class GroundItems {
/** /**
* Gets a ground item * Gets a ground item
* *
* @param x * @param x - local region x
* - local region x * @param y - local region y
* @param y *
* - local region y
* @return ground item array * @return ground item array
*/ */
public static final GroundItem[] getGroundItemsAt(final int x, final int y) { public static final GroundItem[] getGroundItemsAt(final int x, final int y) {
@@ -113,6 +108,7 @@ public class GroundItems {
* Returns array of GroundItems with the first index to be the nearest * Returns array of GroundItems with the first index to be the nearest
* *
* @param filter * @param filter
*
* @return GroundItems * @return GroundItems
*/ */
public static final GroundItem[] getNearest(Filter<GroundItem> filter) { public static final GroundItem[] getNearest(Filter<GroundItem> filter) {
@@ -134,6 +130,7 @@ public class GroundItems {
* Returns nearest ground items with given id * Returns nearest ground items with given id
* *
* @param ids * @param ids
*
* @return GroundItems * @return GroundItems
*/ */
public static final GroundItem[] getNearest(final int... ids) { public static final GroundItem[] getNearest(final int... ids) {
+17 -4
View File
@@ -1,18 +1,16 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import org.parabot.environment.api.utils.Filter; import org.parabot.environment.api.utils.Filter;
import org.parabot.environment.api.utils.Time; import org.parabot.environment.api.utils.Time;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Interface; import org.rev317.min.accessors.Interface;
import org.rev317.min.api.wrappers.Item; import org.rev317.min.api.wrappers.Item;
import java.util.ArrayList;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Inventory { public class Inventory {
public static final int INVENTORY_INDEX = 3214; public static final int INVENTORY_INDEX = 3214;
@@ -38,6 +36,7 @@ public class Inventory {
/** /**
* Gets inventory interface * Gets inventory interface
*
* @return interface of inventory * @return interface of inventory
*/ */
public static Interface getInterface() { public static Interface getInterface() {
@@ -46,6 +45,7 @@ public class Inventory {
/** /**
* Gets the amount of items in inventory, excludes the stack sizes * Gets the amount of items in inventory, excludes the stack sizes
*
* @return amount of items * @return amount of items
*/ */
public static final int getCount() { public static final int getCount() {
@@ -54,7 +54,9 @@ public class Inventory {
/** /**
* Gets the amount of items with given ids in inventory, excludes the stack sizes * Gets the amount of items with given ids in inventory, excludes the stack sizes
*
* @param ids * @param ids
*
* @return amount of items * @return amount of items
*/ */
public static final int getCount(int... ids) { public static final int getCount(int... ids) {
@@ -63,7 +65,9 @@ public class Inventory {
/** /**
* Gets the amount of items in inventory * Gets the amount of items in inventory
*
* @param includeStack - true for including stack sizes to the counting * @param includeStack - true for including stack sizes to the counting
*
* @return amount of items * @return amount of items
*/ */
public static final int getCount(final boolean includeStack) { public static final int getCount(final boolean includeStack) {
@@ -84,8 +88,10 @@ public class Inventory {
/** /**
* Gets the amount of items with given ids in inventory * Gets the amount of items with given ids in inventory
*
* @param includeStack - true for including stack sizes to the counting * @param includeStack - true for including stack sizes to the counting
* @param ids * @param ids
*
* @return amount of items * @return amount of items
*/ */
public static final int getCount(final boolean includeStack, int... ids) { public static final int getCount(final boolean includeStack, int... ids) {
@@ -112,6 +118,7 @@ public class Inventory {
/** /**
* Gets every item in inventory * Gets every item in inventory
*
* @return items * @return items
*/ */
public static final Item[] getItems() { public static final Item[] getItems() {
@@ -120,7 +127,9 @@ public class Inventory {
/** /**
* Gets all items with given ids * Gets all items with given ids
*
* @param ids * @param ids
*
* @return items * @return items
*/ */
public static final Item[] getItems(final int... ids) { public static final Item[] getItems(final int... ids) {
@@ -141,7 +150,9 @@ public class Inventory {
/** /**
* Gets all items accepted by filter * Gets all items accepted by filter
*
* @param filter * @param filter
*
* @return items * @return items
*/ */
public static final Item[] getItems(final Filter<Item> filter) { public static final Item[] getItems(final Filter<Item> filter) {
@@ -168,6 +179,7 @@ public class Inventory {
/** /**
* Determines if inventory is full * Determines if inventory is full
*
* @return <b>true</b> if inventory is full, otherwise <b>false</b> * @return <b>true</b> if inventory is full, otherwise <b>false</b>
*/ */
public static final boolean isFull() { public static final boolean isFull() {
@@ -176,6 +188,7 @@ public class Inventory {
/** /**
* Determines if inventory is empty * Determines if inventory is empty
*
* @return <b>true</b> if inventory is empty, otherwise <b>false</b> * @return <b>true</b> if inventory is empty, otherwise <b>false</b>
*/ */
public static final boolean isEmpty() { public static final boolean isEmpty() {
+13 -9
View File
@@ -1,7 +1,5 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.HashMap;
import org.parabot.core.Context; import org.parabot.core.Context;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Client; import org.rev317.min.accessors.Client;
@@ -10,10 +8,10 @@ import org.rev317.min.api.wrappers.GroundItem;
import org.rev317.min.api.wrappers.Item; import org.rev317.min.api.wrappers.Item;
import org.rev317.min.api.wrappers.SceneObject; import org.rev317.min.api.wrappers.SceneObject;
import java.util.HashMap;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Menu { public class Menu {
public static final int ACTION_CLICK_BUTTON = 646; public static final int ACTION_CLICK_BUTTON = 646;
@@ -24,6 +22,7 @@ public class Menu {
/** /**
* Interacts with a sceneobject * Interacts with a sceneobject
*
* @param object * @param object
* @param actionIndex * @param actionIndex
*/ */
@@ -55,6 +54,7 @@ public class Menu {
/** /**
* Interacts with a character * Interacts with a character
*
* @param character * @param character
* @param actionIndex * @param actionIndex
*/ */
@@ -81,11 +81,8 @@ public class Menu {
} }
/** /**
* Interacts with an item when it has the following menu * Interacts with an item when it has the following menu Transform-1 Transform-5 Transform-10 etc..
* Transform-1 *
* Transform-5
* Transform-10
* etc..
* @param item * @param item
* @param actionIndex * @param actionIndex
* @param interfaceParentId * @param interfaceParentId
@@ -116,6 +113,7 @@ public class Menu {
/** /**
* Takes grounditem from the ground * Takes grounditem from the ground
*
* @param item * @param item
*/ */
public static void take(GroundItem item) { public static void take(GroundItem item) {
@@ -124,6 +122,7 @@ public class Menu {
/** /**
* Interacts with a ground item * Interacts with a ground item
*
* @param item * @param item
* @param action * @param action
*/ */
@@ -151,6 +150,7 @@ public class Menu {
/** /**
* Drops an item * Drops an item
*
* @param item * @param item
*/ */
public static void drop(Item item) { public static void drop(Item item) {
@@ -160,6 +160,7 @@ public class Menu {
/** /**
* Clicks a button * Clicks a button
*
* @param id * @param id
*/ */
public static void clickButton(int id) { public static void clickButton(int id) {
@@ -168,6 +169,7 @@ public class Menu {
/** /**
* Sends an action to the client * Sends an action to the client
*
* @param action * @param action
* @param cmd1 * @param cmd1
* @param cmd2 * @param cmd2
@@ -179,6 +181,7 @@ public class Menu {
/** /**
* Sends an action to the client * Sends an action to the client
*
* @param action * @param action
* @param cmd1 * @param cmd1
* @param cmd2 * @param cmd2
@@ -191,6 +194,7 @@ public class Menu {
/** /**
* Sends an action to the client * Sends an action to the client
*
* @param action * @param action
* @param cmd1 * @param cmd1
* @param cmd2 * @param cmd2
+11 -6
View File
@@ -1,18 +1,16 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.parabot.environment.api.utils.Filter; import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Client; import org.rev317.min.accessors.Client;
import org.rev317.min.api.wrappers.Npc; import org.rev317.min.api.wrappers.Npc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Npcs { public class Npcs {
@@ -38,6 +36,7 @@ public class Npcs {
* Gets all Npcs except local Npc * Gets all Npcs except local Npc
* *
* @param filter * @param filter
*
* @return all Npcs * @return all Npcs
*/ */
public static final Npc[] getNpcs(final Filter<Npc> filter) { public static final Npc[] getNpcs(final Filter<Npc> filter) {
@@ -67,7 +66,9 @@ public class Npcs {
/** /**
* Gets the closest npc which matches the given filter * Gets the closest npc which matches the given filter
*
* @param filter * @param filter
*
* @return closest npc * @return closest npc
*/ */
public static final Npc getClosest(final Filter<Npc> filter) { public static final Npc getClosest(final Filter<Npc> filter) {
@@ -80,7 +81,9 @@ public class Npcs {
/** /**
* Gets the closest npc which matches the given ids * Gets the closest npc which matches the given ids
*
* @param ids * @param ids
*
* @return closest npc * @return closest npc
*/ */
public static final Npc getClosest(int... ids) { public static final Npc getClosest(int... ids) {
@@ -95,6 +98,7 @@ public class Npcs {
* Returns array with the first index to be the nearest Npc * Returns array with the first index to be the nearest Npc
* *
* @param filter * @param filter
*
* @return nearest Npcs * @return nearest Npcs
*/ */
public static final Npc[] getNearest(final Filter<Npc> filter) { public static final Npc[] getNearest(final Filter<Npc> filter) {
@@ -107,6 +111,7 @@ public class Npcs {
* Gets nearest npcs which hold given id(s) * Gets nearest npcs which hold given id(s)
* *
* @param ids * @param ids
*
* @return array of npcs with the first index to be the nearest * @return array of npcs with the first index to be the nearest
*/ */
public static final Npc[] getNearest(final int... ids) { public static final Npc[] getNearest(final int... ids) {
+11 -6
View File
@@ -1,18 +1,16 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import org.parabot.environment.api.utils.Filter; import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Client; import org.rev317.min.accessors.Client;
import org.rev317.min.api.wrappers.Player; import org.rev317.min.api.wrappers.Player;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Players { public class Players {
@@ -36,7 +34,9 @@ public class Players {
/** /**
* Gets all players except local player * Gets all players except local player
*
* @param filter * @param filter
*
* @return all players * @return all players
*/ */
public static final Player[] getPlayers(final Filter<Player> filter) { public static final Player[] getPlayers(final Filter<Player> filter) {
@@ -57,6 +57,7 @@ public class Players {
/** /**
* Gets all players except local player * Gets all players except local player
*
* @return all players * @return all players
*/ */
public static final Player[] getPlayers() { public static final Player[] getPlayers() {
@@ -65,7 +66,9 @@ public class Players {
/** /**
* Returns array with the first index to be the nearest player * Returns array with the first index to be the nearest player
*
* @param filter * @param filter
*
* @return nearest players * @return nearest players
*/ */
public static final Player[] getNearest(final Filter<Player> filter) { public static final Player[] getNearest(final Filter<Player> filter) {
@@ -76,6 +79,7 @@ public class Players {
/** /**
* Returns array with the first index to be the nearest player * Returns array with the first index to be the nearest player
*
* @return nearest players * @return nearest players
*/ */
public static final Player[] getNearest() { public static final Player[] getNearest() {
@@ -84,6 +88,7 @@ public class Players {
/** /**
* Gets local player * Gets local player
*
* @return local player * @return local player
*/ */
public static Player getMyPlayer() { public static Player getMyPlayer() {
@@ -1,20 +1,18 @@
package org.rev317.min.api.methods; package org.rev317.min.api.methods;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import org.parabot.environment.api.utils.Filter; import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Ground; import org.rev317.min.accessors.Ground;
import org.rev317.min.accessors.SceneObjectTile; import org.rev317.min.accessors.SceneObjectTile;
import org.rev317.min.api.wrappers.SceneObject; import org.rev317.min.api.wrappers.SceneObject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class SceneObjects { public class SceneObjects {
@@ -37,7 +35,9 @@ public class SceneObjects {
}; };
/** /**
* Gets the most important scene objects in game which can be interacted with, filters out: 'walls, wall decorations, ground decorations' * Gets the most important scene objects in game which can be interacted with, filters out: 'walls, wall
* decorations, ground decorations'
*
* @return scene objects * @return scene objects
*/ */
public static final SceneObject[] getSceneObjects(Filter<SceneObject> filter) { public static final SceneObject[] getSceneObjects(Filter<SceneObject> filter) {
@@ -56,6 +56,7 @@ public class SceneObjects {
/** /**
* Gets the most important scene objects in game which can be interacted with * Gets the most important scene objects in game which can be interacted with
*
* @return scene objects * @return scene objects
*/ */
public static final SceneObject[] getSceneObjects() { public static final SceneObject[] getSceneObjects() {
@@ -64,7 +65,9 @@ public class SceneObjects {
/** /**
* Returns array of sceneobjects with the first index to be the nearest * Returns array of sceneobjects with the first index to be the nearest
*
* @param filter * @param filter
*
* @return sceneobjects * @return sceneobjects
*/ */
public static final SceneObject[] getNearest(Filter<SceneObject> filter) { public static final SceneObject[] getNearest(Filter<SceneObject> filter) {
@@ -75,6 +78,7 @@ public class SceneObjects {
/** /**
* Returns array of sceneobjects with the first index to be the nearest * Returns array of sceneobjects with the first index to be the nearest
*
* @return sceneobjects * @return sceneobjects
*/ */
public static final SceneObject[] getNearest() { public static final SceneObject[] getNearest() {
@@ -83,7 +87,9 @@ public class SceneObjects {
/** /**
* Returns nearest objects with given id * Returns nearest objects with given id
*
* @param ids * @param ids
*
* @return sceneobjects * @return sceneobjects
*/ */
public static final SceneObject[] getNearest(final int... ids) { public static final SceneObject[] getNearest(final int... ids) {
@@ -145,6 +151,7 @@ public class SceneObjects {
/** /**
* Gets every loaded scene object in game * Gets every loaded scene object in game
*
* @return every loaded scene object in game * @return every loaded scene object in game
*/ */
public static final SceneObject[] getAllSceneObjects() { public static final SceneObject[] getAllSceneObjects() {
@@ -162,9 +169,11 @@ public class SceneObjects {
/** /**
* Gets all sceneobjects at a tile * Gets all sceneobjects at a tile
*
* @param x * @param x
* @param y * @param y
* @param useCached * @param useCached
*
* @return array of sceneobjects, or null if there aren't any * @return array of sceneobjects, or null if there aren't any
*/ */
public static final Collection<SceneObject> getSceneObjectsAtTile(int x, int y, boolean useCached) { public static final Collection<SceneObject> getSceneObjectsAtTile(int x, int y, boolean useCached) {
+100 -108
View File
@@ -3,17 +3,11 @@ package org.rev317.min.api.methods;
import org.rev317.min.Loader; import org.rev317.min.Loader;
/** /**
*
* @author Dane * @author Dane
*
*/ */
public enum Skill { public enum Skill {
ATTACK, DEFENSE, STRENGTH, HITPOINTS, CONSTITUTION, RANGE, PRAYER ATTACK, DEFENSE, STRENGTH, HITPOINTS, CONSTITUTION, RANGE, PRAYER, MAGIC, COOKING, WOODCUTTING, FLETCHING, FISHING, FIREMAKING, CRAFTING, SMITHING, MINING, HERBLORE, HERBLAW, AGILITY, THIEVING, SLAYER, FARMING, RUNECRAFTING, HUNTER, CONSTRUCTION, SUMMONING, DUNGEONEERING;
, MAGIC, COOKING, WOODCUTTING, FLETCHING, FISHING, FIREMAKING
, CRAFTING, SMITHING, MINING, HERBLORE, HERBLAW
, AGILITY, THIEVING, SLAYER, FARMING, RUNECRAFTING
, HUNTER, CONSTRUCTION, SUMMONING, DUNGEONEERING;
private static final int[] EXPERIENCE = {0, 0, 83, 174, 276, 388, 512, private static final int[] EXPERIENCE = {0, 0, 83, 174, 276, 388, 512,
650, 801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 650, 801, 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115,
@@ -33,8 +27,103 @@ public enum Skill {
77474828, 85539082, 94442737, 104273167}; 77474828, 85539082, 94442737, 104273167};
/** /**
* @Deprecated use Skill.ordinal() instead * Returns the experience of the provided skill.
* Returns the skill's index. *
* @param index the skill index.
*
* @return the experience.
*/
public static final int getCurrentExperience(int index) {
return Loader.getClient().getCurrentExp()[index];
}
/**
* Returns the real level of the provided skill.
*
* @param index the skill index.
*
* @return the real skill level.
*/
public static final int getRealLevel(int index) {
return getLevelByExperience(getCurrentExperience(index));
}
/**
* Returns the current level of the provided skill. (Will return de-buffed/buffed levels)
*
* @param index the skill index.
*
* @return the current skill level. Done by Bears
*/
public static final int getCurrentLevel(int index) {
//return Loader.getClient().getCurrentStats()[index];
return getRealLevel(index); //TODO fix this method, it invokes a method not in the client accessor.
}
/**
* Returns the exact experience at the provided level.
*
* @param level the level.
*
* @return the experience at the provided level.
*/
public static final int getExperienceByLevel(int level) {
if (level > 99 || level < 1) {
return 0;
}
return EXPERIENCE[level];
}
/**
* Returns the exact level with the provided experience.
*
* @param experience the experience.
*
* @return the level at the provided experience.
*/
public static final int getLevelByExperience(int experience) {
for (int i = EXPERIENCE.length - 1; i > 0; i--) {
if (experience > EXPERIENCE[i]) {
return i;
}
}
return 1;
}
/**
* Returns the remaining experience for the provided skill to level up.
*
* @param index the skill index.
*
* @return the remaining experience.
*/
public static final int getRemainingExperience(int index) {
int level = getLevelByExperience(getCurrentExperience(index));
if (level >= 99 || level < 1) {
return 0;
}
return EXPERIENCE[(level + 1)] - getCurrentExperience(index);
}
/**
* Returns the percentage to the next level for the provided skill.
*
* @param index the skill index.
*
* @return the remaining percentage.
*/
public static final int getPercentToNextLevel(int index) {
int currentLevel = getLevelByExperience(getCurrentExperience(index));
int nextLevel = currentLevel + 1;
if (currentLevel == 99 || nextLevel > 99 || currentLevel < 1
|| nextLevel < 1) {
return 0;
}
return (int) (100f * ((float) getCurrentExperience(index) / (float) EXPERIENCE[nextLevel]));
}
/**
* @Deprecated use Skill.ordinal() instead Returns the skill's index.
*/ */
public int getIndex() { public int getIndex() {
return ordinal(); return ordinal();
@@ -63,8 +152,8 @@ public enum Skill {
} }
/** /**
* Returns the current level. (For example, if you've been de-buffed by a spell, or drank a beer that buffs the stat; it will return the buffed level.) * Returns the current level. (For example, if you've been de-buffed by a spell, or drank a beer that buffs the
* Done by Bears * stat; it will return the buffed level.) Done by Bears
*/ */
public final int getLevel() { public final int getLevel() {
return Skill.getCurrentLevel(this.getIndex()); return Skill.getCurrentLevel(this.getIndex());
@@ -92,101 +181,4 @@ public enum Skill {
return "Skill: [" + this.getName() + ": " + this.getLevel() + " / " return "Skill: [" + this.getName() + ": " + this.getLevel() + " / "
+ this.getRealLevel() + "]"; + this.getRealLevel() + "]";
} }
/**
* Returns the experience of the provided skill.
*
* @param index
* the skill index.
* @return the experience.
*/
public static final int getCurrentExperience(int index) {
return Loader.getClient().getCurrentExp()[index];
}
/**
* Returns the real level of the provided skill.
*
* @param index
* the skill index.
* @return the real skill level.
*/
public static final int getRealLevel(int index) {
return getLevelByExperience(getCurrentExperience(index));
}
/**
* Returns the current level of the provided skill. (Will return de-buffed/buffed levels)
*
* @param index
* the skill index.
* @return the current skill level.
* Done by Bears
*/
public static final int getCurrentLevel(int index) {
//return Loader.getClient().getCurrentStats()[index];
return getRealLevel(index); //TODO fix this method, it invokes a method not in the client accessor.
}
/**
* Returns the exact experience at the provided level.
*
* @param level
* the level.
* @return the experience at the provided level.
*/
public static final int getExperienceByLevel(int level) {
if (level > 99 || level < 1) {
return 0;
}
return EXPERIENCE[level];
}
/**
* Returns the exact level with the provided experience.
*
* @param experience
* the experience.
* @return the level at the provided experience.
*/
public static final int getLevelByExperience(int experience) {
for (int i = EXPERIENCE.length - 1; i > 0; i--) {
if (experience > EXPERIENCE[i]) {
return i;
}
}
return 1;
}
/**
* Returns the remaining experience for the provided skill to level up.
*
* @param index
* the skill index.
* @return the remaining experience.
*/
public static final int getRemainingExperience(int index) {
int level = getLevelByExperience(getCurrentExperience(index));
if (level >= 99 || level < 1) {
return 0;
}
return EXPERIENCE[(level + 1)] - getCurrentExperience(index);
}
/**
* Returns the percentage to the next level for the provided skill.
*
* @param index
* the skill index.
* @return the remaining percentage.
*/
public static final int getPercentToNextLevel(int index) {
int currentLevel = getLevelByExperience(getCurrentExperience(index));
int nextLevel = currentLevel + 1;
if (currentLevel == 99 || nextLevel > 99 || currentLevel < 1
|| nextLevel < 1) {
return 0;
}
return (int) (100f * ((float) getCurrentExperience(index) / (float) EXPERIENCE[nextLevel]));
}
} }
+4 -3
View File
@@ -5,14 +5,13 @@ import org.rev317.min.api.wrappers.Tile;
import org.rev317.min.api.wrappers.TilePath; import org.rev317.min.api.wrappers.TilePath;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Walking { public class Walking {
/** /**
* Walks from tile to tile * Walks from tile to tile
*
* @param from * @param from
* @param to * @param to
*/ */
@@ -21,8 +20,8 @@ public class Walking {
} }
/** /**
*
* @param tilePath * @param tilePath
*
* @return <b>true</b> if destination reached, otherwise <b>false</b> * @return <b>true</b> if destination reached, otherwise <b>false</b>
*/ */
public static boolean walkDown(TilePath tilePath) { public static boolean walkDown(TilePath tilePath) {
@@ -35,7 +34,9 @@ public class Walking {
/** /**
* Gets nearest reachable tile on minimap to given tile * Gets nearest reachable tile on minimap to given tile
*
* @param tile * @param tile
*
* @return nearest reachable tile on minimap * @return nearest reachable tile on minimap
*/ */
public static Tile getNearestTileTo(Tile tile) { public static Tile getNearestTileTo(Tile tile) {
@@ -9,9 +9,7 @@ import org.rev317.min.api.methods.Menu;
import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Players;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Character implements Locatable { public class Character implements Locatable {
@@ -157,6 +155,7 @@ public class Character implements Locatable {
/** /**
* Gets the accessor class * Gets the accessor class
*
* @return RefClass of accessor * @return RefClass of accessor
*/ */
public RefClass getRefClass() { public RefClass getRefClass() {
@@ -7,9 +7,7 @@ import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Menu; import org.rev317.min.api.methods.Menu;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class GroundItem implements Locatable { public class GroundItem implements Locatable {
private org.rev317.min.accessors.Item accessor; private org.rev317.min.accessors.Item accessor;
@@ -24,6 +22,7 @@ public class GroundItem implements Locatable {
/** /**
* Gets location of this ground item * Gets location of this ground item
*
* @return location * @return location
*/ */
public Tile getLocation() { public Tile getLocation() {
@@ -32,6 +31,7 @@ public class GroundItem implements Locatable {
/** /**
* Gets region X * Gets region X
*
* @return x * @return x
*/ */
public int getX() { public int getX() {
@@ -40,6 +40,7 @@ public class GroundItem implements Locatable {
/** /**
* Gets region Y * Gets region Y
*
* @return y * @return y
*/ */
public int getY() { public int getY() {
@@ -48,6 +49,7 @@ public class GroundItem implements Locatable {
/** /**
* Interacts with this ground item * Interacts with this ground item
*
* @param actionIndex * @param actionIndex
*/ */
public void interact(int actionIndex) { public void interact(int actionIndex) {
@@ -63,6 +65,7 @@ public class GroundItem implements Locatable {
/** /**
* Gets distance between you and this ground item * Gets distance between you and this ground item
*
* @return distance * @return distance
*/ */
public int distanceTo() { public int distanceTo() {
@@ -71,6 +74,7 @@ public class GroundItem implements Locatable {
/** /**
* Get's ID of this item * Get's ID of this item
*
* @return ID * @return ID
*/ */
public int getId() { public int getId() {
@@ -79,6 +83,7 @@ public class GroundItem implements Locatable {
/** /**
* Gets the accessor class * Gets the accessor class
*
* @return RefClass of accessor * @return RefClass of accessor
*/ */
public RefClass getRefClass() { public RefClass getRefClass() {
+4 -2
View File
@@ -3,9 +3,7 @@ package org.rev317.min.api.wrappers;
import org.rev317.min.api.methods.Menu; import org.rev317.min.api.methods.Menu;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Item { public class Item {
private int id, stackSize; private int id, stackSize;
@@ -19,6 +17,7 @@ public class Item {
/** /**
* Get id of this item * Get id of this item
*
* @return id * @return id
*/ */
public int getId() { public int getId() {
@@ -27,6 +26,7 @@ public class Item {
/** /**
* Gets quantity of this item * Gets quantity of this item
*
* @return stack size * @return stack size
*/ */
public int getStackSize() { public int getStackSize() {
@@ -35,6 +35,7 @@ public class Item {
/** /**
* Item slot * Item slot
*
* @return slot * @return slot
*/ */
public int getSlot() { public int getSlot() {
@@ -50,6 +51,7 @@ public class Item {
/** /**
* Interacts with this item * Interacts with this item
*
* @param i * @param i
*/ */
public void interact(int i) { public void interact(int i) {
+2 -2
View File
@@ -3,9 +3,7 @@ package org.rev317.min.api.wrappers;
import org.parabot.core.reflect.RefClass; import org.parabot.core.reflect.RefClass;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public final class Npc extends Character { public final class Npc extends Character {
private org.rev317.min.accessors.Npc accessor; private org.rev317.min.accessors.Npc accessor;
@@ -18,6 +16,7 @@ public final class Npc extends Character {
/** /**
* Gets the definition of this npc * Gets the definition of this npc
*
* @return npc definitions * @return npc definitions
*/ */
public final NpcDef getDef() { public final NpcDef getDef() {
@@ -26,6 +25,7 @@ public final class Npc extends Character {
/** /**
* Gets the accessor class * Gets the accessor class
*
* @return RefClass of accessor * @return RefClass of accessor
*/ */
public RefClass getRefClass() { public RefClass getRefClass() {
+2 -2
View File
@@ -3,9 +3,7 @@ package org.rev317.min.api.wrappers;
import org.parabot.core.reflect.RefClass; import org.parabot.core.reflect.RefClass;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class NpcDef { public class NpcDef {
private org.rev317.min.accessors.NpcDef accessor; private org.rev317.min.accessors.NpcDef accessor;
@@ -16,6 +14,7 @@ public class NpcDef {
/** /**
* Gets id of this item * Gets id of this item
*
* @return id of this item * @return id of this item
*/ */
public int getId() { public int getId() {
@@ -24,6 +23,7 @@ public class NpcDef {
/** /**
* Gets the accessor class * Gets the accessor class
*
* @return RefClass of accessor * @return RefClass of accessor
*/ */
public RefClass getRefClass() { public RefClass getRefClass() {
@@ -1,9 +1,7 @@
package org.rev317.min.api.wrappers; package org.rev317.min.api.wrappers;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class Player extends Character { public class Player extends Character {
@@ -8,9 +8,7 @@ import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Menu; import org.rev317.min.api.methods.Menu;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class SceneObject implements Locatable { public class SceneObject implements Locatable {
public static final int TYPE_WALL = 0; // object1 public static final int TYPE_WALL = 0; // object1
@@ -38,6 +36,7 @@ public class SceneObject implements Locatable {
/** /**
* Gets location of this tile * Gets location of this tile
*
* @return location * @return location
*/ */
public final Tile getLocation() { public final Tile getLocation() {
@@ -46,6 +45,7 @@ public class SceneObject implements Locatable {
/** /**
* Gets region X * Gets region X
*
* @return region X * @return region X
*/ */
public final int getLocalRegionX() { public final int getLocalRegionX() {
@@ -54,6 +54,7 @@ public class SceneObject implements Locatable {
/** /**
* Gets region Y * Gets region Y
*
* @return region Y * @return region Y
*/ */
public final int getLocalRegionY() { public final int getLocalRegionY() {
@@ -80,6 +81,7 @@ public class SceneObject implements Locatable {
/** /**
* Calculates distance to this object * Calculates distance to this object
*
* @return distance * @return distance
*/ */
public final int distanceTo() { public final int distanceTo() {
@@ -88,6 +90,7 @@ public class SceneObject implements Locatable {
/** /**
* Interacts with this object * Interacts with this object
*
* @param actionIndex * @param actionIndex
*/ */
public void interact(int actionIndex) { public void interact(int actionIndex) {
@@ -96,6 +99,7 @@ public class SceneObject implements Locatable {
/** /**
* Gets the accessor class * Gets the accessor class
*
* @return RefClass of accessor * @return RefClass of accessor
*/ */
public RefClass getRefClass() { public RefClass getRefClass() {
+7 -2
View File
@@ -8,11 +8,9 @@ import org.rev317.min.api.methods.Players;
import org.rev317.min.api.methods.Walking; import org.rev317.min.api.methods.Walking;
/** /**
*
* Class which holds a world location * Class which holds a world location
* *
* @author Everel * @author Everel
*
*/ */
public final class Tile implements TileFlags, Locatable { public final class Tile implements TileFlags, Locatable {
private int x; private int x;
@@ -50,6 +48,7 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Gets region x * Gets region x
*
* @return region x * @return region x
*/ */
public final int getRegionX() { public final int getRegionX() {
@@ -58,6 +57,7 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Gets region y * Gets region y
*
* @return region y * @return region y
*/ */
public final int getRegionY() { public final int getRegionY() {
@@ -128,6 +128,7 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Determines if this tile is walkable * Determines if this tile is walkable
*
* @return <code>true</code> if this tile is walkable, otherwise <code>false</code> * @return <code>true</code> if this tile is walkable, otherwise <code>false</code>
*/ */
public boolean isWalkable() { public boolean isWalkable() {
@@ -136,7 +137,9 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Determines if this tile is reachable * Determines if this tile is reachable
*
* @param isObject whether this tile is an object tile * @param isObject whether this tile is an object tile
*
* @return <code>true</code> if this tile is reachable, otherwise <code>false</code> * @return <code>true</code> if this tile is reachable, otherwise <code>false</code>
*/ */
public boolean isReachable(boolean isObject) { public boolean isReachable(boolean isObject) {
@@ -146,6 +149,7 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Determines if this tile is reachable * Determines if this tile is reachable
*
* @return <code>true</code> if this tile is reachable, otherwise <code>false</code> * @return <code>true</code> if this tile is reachable, otherwise <code>false</code>
*/ */
public boolean isReachable() { public boolean isReachable() {
@@ -154,6 +158,7 @@ public final class Tile implements TileFlags, Locatable {
/** /**
* Determines if this tile is an object tile * Determines if this tile is an object tile
*
* @return <code>true</code> if this tile is an object tile, otherwise <code>false</code> * @return <code>true</code> if this tile is an object tile, otherwise <code>false</code>
*/ */
public boolean isObjectTile() { public boolean isObjectTile() {
@@ -1,9 +1,7 @@
package org.rev317.min.api.wrappers; package org.rev317.min.api.wrappers;
/** /**
*
* @author Everel * @author Everel
*
*/ */
public class TilePath { public class TilePath {
+1 -3
View File
@@ -2,16 +2,14 @@ package org.rev317.min.callback;
import org.rev317.min.Loader; import org.rev317.min.Loader;
import org.rev317.min.accessors.Client; import org.rev317.min.accessors.Client;
import org.rev317.min.debug.DActions;
import org.rev317.min.api.events.GameActionEvent; import org.rev317.min.api.events.GameActionEvent;
import org.rev317.min.api.methods.Game; import org.rev317.min.api.methods.Game;
import org.rev317.min.debug.DActions;
import org.rev317.min.script.ScriptEngine; import org.rev317.min.script.ScriptEngine;
/** /**
*
* @author Everel * @author Everel
* @author Matt123337 * @author Matt123337
*
*/ */
public class MenuAction { public class MenuAction {
@@ -1,7 +1,6 @@
package org.rev317.min.callback; package org.rev317.min.callback;
import org.rev317.min.api.events.MessageEvent; import org.rev317.min.api.events.MessageEvent;
import org.rev317.min.script.ScriptEngine; import org.rev317.min.script.ScriptEngine;
+6 -6
View File
@@ -1,12 +1,16 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import java.awt.*;
public class DActions extends AbstractDebugger { public class DActions extends AbstractDebugger {
private static boolean enabled; private static boolean enabled;
public static boolean debugActions() {
return enabled;
}
@Override @Override
public void paint(Graphics g) { public void paint(Graphics g) {
} }
@@ -21,8 +25,4 @@ public class DActions extends AbstractDebugger {
enabled = !enabled; enabled = !enabled;
} }
public static boolean debugActions() {
return enabled;
}
} }
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.Context; import org.parabot.core.Context;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Players;
import java.awt.*;
public class DAnimation extends AbstractDebugger { public class DAnimation extends AbstractDebugger {
private boolean enabled; private boolean enabled;
+2 -2
View File
@@ -1,10 +1,10 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.rev317.min.api.methods.Bank; import org.rev317.min.api.methods.Bank;
import java.awt.*;
public class DBank extends AbstractDebugger { public class DBank extends AbstractDebugger {
@Override @Override
@@ -1,7 +1,5 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.Context; 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;
@@ -9,6 +7,8 @@ import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Players;
import org.rev317.min.api.wrappers.Tile; import org.rev317.min.api.wrappers.Tile;
import java.awt.*;
public class DCollisionFlags extends AbstractDebugger { public class DCollisionFlags extends AbstractDebugger {
private boolean enabled; private boolean enabled;
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.rev317.min.api.methods.GroundItems; import org.rev317.min.api.methods.GroundItems;
import org.rev317.min.api.wrappers.GroundItem; import org.rev317.min.api.wrappers.GroundItem;
import java.awt.*;
public class DGroundItems extends AbstractDebugger { public class DGroundItems extends AbstractDebugger {
@Override @Override
+2 -2
View File
@@ -1,12 +1,12 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.Context; 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.rev317.min.api.methods.Game; import org.rev317.min.api.methods.Game;
import java.awt.*;
public class DInterfaces extends AbstractDebugger { public class DInterfaces extends AbstractDebugger {
private boolean enabled; private boolean enabled;
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.rev317.min.api.methods.Inventory; import org.rev317.min.api.methods.Inventory;
import org.rev317.min.api.wrappers.Item; import org.rev317.min.api.wrappers.Item;
import java.awt.*;
public class DInventory extends AbstractDebugger { public class DInventory extends AbstractDebugger {
@Override @Override
+2 -2
View File
@@ -1,13 +1,13 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.Context; 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.rev317.min.api.methods.Game; import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Players;
import java.awt.*;
public class DMap extends AbstractDebugger { public class DMap extends AbstractDebugger {
private boolean enabled; private boolean enabled;
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.Context; import org.parabot.core.Context;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.parabot.environment.input.Mouse; import org.parabot.environment.input.Mouse;
import java.awt.*;
public class DMouse extends AbstractDebugger { public class DMouse extends AbstractDebugger {
private boolean enabled; private boolean enabled;
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
import org.rev317.min.api.methods.Npcs; import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.wrappers.Npc; import org.rev317.min.api.wrappers.Npc;
import java.awt.*;
public class DNpcs extends AbstractDebugger { public class DNpcs extends AbstractDebugger {
@Override @Override
+2 -2
View File
@@ -1,11 +1,11 @@
package org.rev317.min.debug; package org.rev317.min.debug;
import java.awt.Graphics;
import org.parabot.core.paint.AbstractDebugger; import org.parabot.core.paint.AbstractDebugger;
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;
import java.awt.*;
public class DSceneObjects extends AbstractDebugger { public class DSceneObjects extends AbstractDebugger {
@Override @Override
+9 -11
View File
@@ -1,25 +1,23 @@
package org.rev317.min.script; package org.rev317.min.script;
import java.awt.AWTEvent; import org.parabot.core.Context;
import org.parabot.environment.api.interfaces.Paintable;
import org.parabot.environment.scripts.Script;
import org.rev317.min.api.events.GameActionEvent;
import org.rev317.min.api.events.MessageEvent;
import org.rev317.min.api.events.listeners.GameActionListener;
import org.rev317.min.api.events.listeners.MessageListener;
import java.awt.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener; import java.awt.event.MouseMotionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import org.parabot.core.Context;
import org.parabot.environment.api.interfaces.Paintable;
import org.parabot.environment.scripts.Script;
import org.rev317.min.api.events.MessageEvent;
import org.rev317.min.api.events.listeners.MessageListener;
import org.rev317.min.api.events.GameActionEvent;
import org.rev317.min.api.events.listeners.GameActionListener;
/** /**
*
* @author Everel * @author Everel
* @author matt123337 * @author matt123337
*
*/ */
public class ScriptEngine { public class ScriptEngine {
private static HashMap<Context, ScriptEngine> instances = new HashMap<Context, ScriptEngine>(); private static HashMap<Context, ScriptEngine> instances = new HashMap<Context, ScriptEngine>();
+5 -9
View File
@@ -1,16 +1,12 @@
package org.rev317.min.ui; package org.rev317.min.ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import org.rev317.min.debug.*;
import org.parabot.core.Context; import org.parabot.core.Context;
import org.parabot.core.paint.PaintDebugger; import org.parabot.core.paint.PaintDebugger;
import org.rev317.min.debug.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class BotMenu implements ActionListener { public class BotMenu implements ActionListener {