Merge pull request #78 from Parabot/task/settings

[TASK] Moved settings to the api
This commit is contained in:
Jeroen Ketelaar
2017-03-20 09:10:34 +01:00
committed by GitHub
37 changed files with 472 additions and 246 deletions
@@ -1,6 +1,5 @@
package org.rev317.min.accessors;
public interface CollisionMap {
int[][] getFlags();
@@ -2,7 +2,6 @@ package org.rev317.min.api.events.listeners;
import org.rev317.min.api.events.MessageEvent;
public interface MessageListener {
void messageReceived(MessageEvent event);
@@ -5,6 +5,7 @@ import org.parabot.environment.api.utils.Time;
import org.parabot.environment.input.Keyboard;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.Loader;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Item;
import org.rev317.min.api.wrappers.Npc;
import org.rev317.min.api.wrappers.SceneObject;
@@ -16,14 +17,14 @@ import java.util.HashMap;
* @author Everel, Matt123337, JKetelaar
*/
public class Bank {
public static final int[] BANKERS = new int[]{44, 45, 494, 495, 498, 499,
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,
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};
4483, 12308, 20607, 21301, 27663, 42192 };
private static HashMap<String, Integer> settings = Context.getInstance().getServerProviderInfo().getSettings();
/**
@@ -85,7 +86,7 @@ public class Bank {
* Deposits all items
*/
public static void depositAll() {
Menu.clickButton(settings.get("button_deposit_all"));
Menu.clickButton(Settings.getActionByName("button_deposit_all"));
}
/**
@@ -105,15 +106,15 @@ public class Bank {
}
if (amount == 1) {
b.transform(Items.Option.TRANSFORM_ONE, settings.get("item_interface_id"));
b.transform(Items.Option.TRANSFORM_ONE, Settings.getActionByName("item_interface_id"));
} else if (amount == 5) {
b.transform(Items.Option.TRANSFORM_FIVE, settings.get("item_interface_id"));
b.transform(Items.Option.TRANSFORM_FIVE, Settings.getActionByName("item_interface_id"));
} else if (amount == 10) {
b.transform(Items.Option.TRANSFORM_TEN, settings.get("item_interface_id"));
b.transform(Items.Option.TRANSFORM_TEN, Settings.getActionByName("item_interface_id"));
} else if (amount == 0) {
b.transform(Items.Option.TRANSFORM_ALL, settings.get("item_interface_id"));
b.transform(Items.Option.TRANSFORM_ALL, Settings.getActionByName("item_interface_id"));
} else {
b.transform(Items.Option.TRANSFORM_X, settings.get("item_interface_id"));
b.transform(Items.Option.TRANSFORM_X, Settings.getActionByName("item_interface_id"));
Time.sleep(1500 + sleep);
Keyboard.getInstance().sendKeys("" + amount);
}
@@ -123,6 +124,7 @@ public class Bank {
* Gets bank item with given id
*
* @param id
*
* @return bank item
*/
public static Item getItem(int id) {
@@ -146,6 +148,7 @@ public class Bank {
* Counts the amount of items with given id in bank
*
* @param id
*
* @return count
*/
public static int getCount(int id) {
@@ -180,7 +183,6 @@ public class Bank {
bank.interact(SceneObjects.Option.USE);
}
/**
* Closes the bank interface
*/
@@ -189,7 +191,7 @@ public class Bank {
return;
}
Menu.sendAction(200, -1, -1, settings.get("button_close_bank"));
Menu.sendAction(200, -1, -1, Settings.getActionByName("button_close_bank"));
}
/**
@@ -207,7 +209,7 @@ public class Bank {
for (Item i : Inventory.getItems()) {
if (!ignored.contains(i.getId())) {
while (Bank.isOpen() && Inventory.getCount(i.getId()) > 0) {
i.transform(Items.Option.TRANSFORM_ALL, settings.get("inventory_parent_id"));
i.transform(Items.Option.TRANSFORM_ALL, Settings.getActionByName("inventory_parent_id"));
ignored.add(i.getId());
final int previous = Inventory.getCount(true);
Time.sleep(new SleepCondition() {
@@ -232,7 +234,7 @@ public class Bank {
return null;
}
return Loader.getClient().getInterfaceCache()[settings.get("item_interface_id")].getItems();
return Loader.getClient().getInterfaceCache()[Settings.getActionByName("item_interface_id")].getItems();
}
/**
@@ -245,7 +247,7 @@ public class Bank {
return null;
}
return Loader.getClient().getInterfaceCache()[settings.get("item_interface_id")].getStackSizes();
return Loader.getClient().getInterfaceCache()[Settings.getActionByName("item_interface_id")].getStackSizes();
}
/**
@@ -258,7 +260,7 @@ public class Bank {
return null;
}
ArrayList<Item> items = new ArrayList<Item>();
ArrayList<Item> items = new ArrayList<>();
int[] ids = getBankItemIDs();
int[] stacks = getBankStacks();
if (ids != null && stacks != null) {
@@ -292,6 +294,6 @@ public class Bank {
* @return <b>true</b> if bank is open
*/
public static boolean isOpen() {
return Loader.getClient().getOpenInterfaceId() == settings.get("bank_interface_id");
return Loader.getClient().getOpenInterfaceId() == Settings.getActionByName("bank_interface_id");
}
}
@@ -12,6 +12,7 @@ public class Calculations {
* Calculates distance between local player and given tile
*
* @param tile
*
* @return distance between local player and given tile
*/
public static final double distanceTo(Tile tile) {
@@ -23,6 +24,7 @@ public class Calculations {
*
* @param a
* @param b
*
* @return distance between a and b
*/
public static final double distanceBetween(Tile a, Tile b) {
@@ -32,13 +34,13 @@ public class Calculations {
return Math.sqrt((x * x) + (y * y));
}
/**
* @param startX the startX (0 < startX < 104)
* @param startY the startY (0 < startY < 104)
* @param destX the destX (0 < destX < 104)
* @param destY the destY (0 < destY < 104)
* @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.
*/
@@ -158,6 +160,7 @@ public class Calculations {
*
* @param from Start Tile.
* @param to Destination Tile.
*
* @return True if Path is found.
*/
public static boolean foundPath(Tile from, Tile to) {
@@ -170,6 +173,7 @@ public class Calculations {
* @param from Start Tile.
* @param to Destination Tile.
* @param isObject Is destination an Object.
*
* @return True if Path is found.
*/
public static boolean foundPath(Tile from, Tile to, boolean isObject) {
@@ -181,6 +185,7 @@ public class Calculations {
*
* @param from Start Tile.
* @param to Destination Tile.
*
* @return Shortest Path distance between two tiles using Dijkstra algorithm, returns -1 if path isn't found.
*/
public static int pathDistanceBetween(Tile from, Tile to) {
@@ -197,6 +202,7 @@ public class Calculations {
* @param from Start Tile.
* @param to Destination Tile.
* @param isObject Is destination an Object.
*
* @return Shortest Path distance between two tiles using Dijkstra algorithm, returns -1 if path isn't found.
*/
public static int pathDistanceBetween(Tile from, Tile to, boolean isObject) {
@@ -211,6 +217,7 @@ public class Calculations {
* Gets the shortest distance to a tile.
*
* @param tile Destination Tile.
*
* @return Shortest distance to tile.
*/
public static int pathDistanceTo(Tile tile) {
@@ -222,6 +229,7 @@ public class Calculations {
*
* @param tile Destination Tile.
* @param isObject Is destination an Object.
*
* @return Shortest distance to tile.
*/
public static int pathDistanceTo(Tile tile, boolean isObject) {
@@ -233,6 +241,7 @@ public class Calculations {
*
* @param first First tile.
* @param second Second tile.
*
* @return True if Coordinate data from first and second tiles match.
*/
public static boolean isSameTile(Tile first, Tile second) {
@@ -243,6 +252,7 @@ public class Calculations {
* Checks if player is at the destination tile.
*
* @param destination destination tile.
*
* @return true if players location equals destination tile.
*/
public static boolean atTile(Tile destination) {
@@ -254,6 +264,7 @@ public class Calculations {
*
* @param start Starting value.
* @param current Current value.
*
* @return difference between start and current.
*/
public static int gained(int start, int current) {
@@ -266,6 +277,7 @@ public class Calculations {
* @param runtime Timer used for calculating hourly difference.
* @param start Starting value.
* @param current Current value.
*
* @return Hourly difference between start and current.
*/
public static int gainedPerHour(Timer runtime, int start, int current) {
@@ -61,6 +61,7 @@ public class Equipment {
* Check if the Player is Wearing an Item based on the ID.
*
* @param id ID of the item to check for.
*
* @return True if the Player is wearing the Item.
*/
public static boolean isWearing(int id) {
@@ -77,6 +78,7 @@ public class Equipment {
* Get's the item ID in slot.
*
* @param slot Slot to get the item ID from.
*
* @return Item ID from given slot.
*/
public static int getItemId(Slot slot) {
@@ -87,6 +89,7 @@ public class Equipment {
* Check's if there is an item in the given slot.
*
* @param slot Slot to check for Item.
*
* @return True if there is an Item in the given slot.
*/
public static boolean hasItem(Slot slot) {
@@ -97,6 +100,7 @@ public class Equipment {
* Check's if the given slot is empty.
*
* @param slot Slot to check for Item.
*
* @return True if the given slot is empty.
*/
public static boolean isEmpty(Slot slot) {
@@ -32,6 +32,7 @@ public class Game {
* Gets open interface id
*
* @return interface id
*
* @deprecated Use {@link Interfaces #getOpenInterfaceId()} instead
*/
@Deprecated
@@ -39,11 +40,11 @@ public class Game {
return Loader.getClient().getOpenInterfaceId();
}
/**
* Get open back dialog id
*
* @return back dialog id
*
* @deprecated Use {@link Interfaces #getBackDialogId()} instead
*/
@Deprecated
@@ -105,6 +106,7 @@ public class Game {
* Returns the settings within the client
*
* @param index The index of the setting you want to gather
*
* @return The specific setting for the given index
*/
public static int getSetting(int index) {
@@ -6,6 +6,7 @@ import org.rev317.min.Loader;
import org.rev317.min.accessors.Client;
import org.rev317.min.accessors.Deque;
import org.rev317.min.accessors.Node;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.GroundItem;
import org.rev317.min.api.wrappers.Tile;
@@ -67,6 +68,7 @@ public class GroundItems {
*
* @param x - local region x
* @param y - local region y
*
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
*/
public static final GroundItem[] getGroundItemsAt(final int x, final int y) {
@@ -102,6 +104,7 @@ public class GroundItems {
* Gets GroundItems at a specific tile using x and y location.
*
* @param tile Tile to get the GroundItems from.
*
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
*/
public static final GroundItem[] getGroundItemsAt(final Tile tile) {
@@ -121,6 +124,7 @@ public class GroundItems {
* Gets the closest GroundItem which matches the given filter.
*
* @param filter Filter that should be applied to the GroundItem.
*
* @return closest GroundItem
*/
public static final GroundItem getClosest(final Filter<GroundItem> filter) {
@@ -136,6 +140,7 @@ public class GroundItems {
* Gets the closest GroundItems which matches the given ids.
*
* @param ids ID's of the GroundItems to look for.
*
* @return closest GroundItems
*/
public static final GroundItem getClosest(int... ids) {
@@ -151,6 +156,7 @@ public class GroundItems {
* Returns Array of GroundItems with the first index to be the nearest.
*
* @param filter Filter that should be applied to the GroundItem.
*
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
*/
public static final GroundItem[] getNearest(Filter<GroundItem> filter) {
@@ -173,6 +179,7 @@ public class GroundItems {
* Returns Array of GroundItems with the first index to be the nearest.
*
* @param ids GroundItem ID's to look for.
*
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
*/
public static final GroundItem[] getNearest(final int... ids) {
@@ -191,18 +198,18 @@ public class GroundItems {
}
public enum Option {
FIRST(settings.get("menu_ground_item_first_interaction")),
FIRST(Settings.getActionByName("menu_ground_item_first_interaction")),
SECOND(settings.get("menu_ground_item_second_interaction")),
SECOND(Settings.getActionByName("menu_ground_item_second_interaction")),
THIRD(settings.get("menu_ground_item_third_interaction")),
TAKE(settings.get("menu_ground_item_third_interaction")),
THIRD(Settings.getActionByName("menu_ground_item_third_interaction")),
TAKE(Settings.getActionByName("menu_ground_item_third_interaction")),
FOURTH(settings.get("menu_ground_item_fourth_interaction")),
FOURTH(Settings.getActionByName("menu_ground_item_fourth_interaction")),
FIFTH(settings.get("menu_ground_item_fifth_interaction")),
FIFTH(Settings.getActionByName("menu_ground_item_fifth_interaction")),
EXAMINE(settings.get("menu_ground_item_examine_interaction"));
EXAMINE(Settings.getActionByName("menu_ground_item_examine_interaction"));
private int actionId;
@@ -24,6 +24,7 @@ public class Interfaces {
* Get's the Interface from the Interface Cache using the given ID.
*
* @param id Interface ID.
*
* @return Interface from the cache by the given ID.
*/
public static Interface getInterface(int id) {
@@ -79,6 +80,7 @@ public class Interfaces {
* Checks if the Interface or Back Dialog by the given ID is Open.
*
* @param id ID of the Interface or Back Dialog to check for.
*
* @return True is the Interface or Back Dialog is Open else will return false.
*/
public static boolean isOpen(int id) {
@@ -90,6 +92,7 @@ public class Interfaces {
*
* @param id ID of the Interface or Back Dialog to check for depending on the backDialog boolean.
* @param backDialog When tru it will check the Bank Dialog ID else it will check for the Interface ID.
*
* @return True is the Interface or Back Dialog is Open else will return false.
*/
public static boolean isOpen(int id, boolean backDialog) {
@@ -6,12 +6,12 @@ import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.Loader;
import org.rev317.min.accessors.Interface;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Item;
import java.util.ArrayList;
import java.util.HashMap;
/**
* @author Everel, JKetelaar, Fryslan
*/
@@ -58,7 +58,7 @@ public class Inventory {
* @return interface of inventory
*/
public static Interface getInterface() {
return Loader.getClient().getInterfaceCache()[settings.get("inventory_index")];
return Loader.getClient().getInterfaceCache()[Settings.getActionByName("inventory_index")];
}
/**
@@ -74,6 +74,7 @@ public class Inventory {
* Gets the amount of items with given ids in inventory, excludes the stack sizes
*
* @param ids
*
* @return amount of items
*/
public static int getCount(int... ids) {
@@ -84,6 +85,7 @@ public class Inventory {
* Gets the amount of items in inventory
*
* @param includeStack - true for including stack sizes to the counting
*
* @return amount of items
*/
public static int getCount(final boolean includeStack) {
@@ -107,6 +109,7 @@ public class Inventory {
*
* @param includeStack - true for including stack sizes to the counting
* @param ids
*
* @return amount of items
*/
public static int getCount(final boolean includeStack, int... ids) {
@@ -144,6 +147,7 @@ public class Inventory {
* Gets all items with given ids
*
* @param ids
*
* @return items
*/
public static Item[] getItems(final int... ids) {
@@ -166,6 +170,7 @@ public class Inventory {
* Gets all items accepted by filter
*
* @param filter
*
* @return items
*/
public static Item[] getItems(final Filter<Item> filter) {
@@ -212,6 +217,7 @@ public class Inventory {
* Checks if an item exists in the inventory
*
* @param id The item id that will be looked for
*
* @return True if the item exists in the inventory
*/
public static boolean contains(int... id) {
@@ -227,6 +233,7 @@ public class Inventory {
* Returns the item in the inventory based on the given id
*
* @param id The item id that will be used to find the item in the inventory
*
* @return First found item in the inventory
*/
public static Item getItem(int id) {
@@ -243,6 +250,7 @@ public class Inventory {
*
* @param itemOne The first item id that will be used to combine
* @param itemTwo The second item id that will be used to combine
*
* @return True if nothing unexpected happened
*/
public static boolean combine(int itemOne, int itemTwo) {
@@ -267,6 +275,7 @@ public class Inventory {
* @param itemOne The first item id that will be used to combine
* @param itemTwo The second item id that will be used to combine
* @param sleepCondition The sleep condition that will be used to check and wait until the condition is valid
*
* @return True if the condition was true and nothing unexpected happened
*/
public static boolean combine(int itemOne, int itemTwo, SleepCondition sleepCondition) {
@@ -7,6 +7,7 @@ import org.json.simple.parser.ParseException;
import org.parabot.core.Configuration;
import org.parabot.core.Context;
import org.parabot.environment.api.utils.WebUtil;
import org.rev317.min.api.methods.utils.Settings;
import java.net.MalformedURLException;
import java.util.HashMap;
@@ -73,6 +74,7 @@ public class Items {
* Returns an int array based on the string it starts with. getIdsStart(dragon) will return an int array with all items starting with dragon
*
* @param name
*
* @return
*/
public static int[] getIdsStart(String name) {
@@ -100,6 +102,7 @@ public class Items {
* Returns an int array based on the string it contains. getIdsContain(dragon) will return an int array with all items containingdragon
*
* @param name
*
* @return
*/
public static int[] getIdsContain(String name) {
@@ -146,49 +149,49 @@ public class Items {
}
public enum Option {
TRANSFORM_FIRST(settings.get("menu_transform_one_interaction")),
VALUE(settings.get("menu_transform_one_interaction")),
TRANSFORM_ONE(settings.get("menu_transform_one_interaction")),
TRANSFORM_FIRST(Settings.getActionByName("menu_transform_one_interaction")),
VALUE(Settings.getActionByName("menu_transform_one_interaction")),
TRANSFORM_ONE(Settings.getActionByName("menu_transform_one_interaction")),
TRANSFORM_SECOND(settings.get("menu_transform_five_interaction")),
TRANSFORM_FIVE(settings.get("menu_transform_five_interaction")),
TRANSFORM_SECOND(Settings.getActionByName("menu_transform_five_interaction")),
TRANSFORM_FIVE(Settings.getActionByName("menu_transform_five_interaction")),
TRANSFORM_THIRD(settings.get("menu_transform_ten_interaction")),
TRANSFORM_TEN(settings.get("menu_transform_ten_interaction")),
TRANSFORM_THIRD(Settings.getActionByName("menu_transform_ten_interaction")),
TRANSFORM_TEN(Settings.getActionByName("menu_transform_ten_interaction")),
TRANSFORM_FOURTH(settings.get("menu_transform_all_interaction")),
TRANSFORM_ALL(settings.get("menu_transform_all_interaction")),
TRANSFORM_FOURTH(Settings.getActionByName("menu_transform_all_interaction")),
TRANSFORM_ALL(Settings.getActionByName("menu_transform_all_interaction")),
TRANSFORM_FIFTH(settings.get("menu_transform_x_interaction")),
TRANSFORM_X(settings.get("menu_transform_x_interaction")),
TRANSFORM_HUNDRED(settings.get("menu_transform_x_interaction")),
TRANSFORM_FIFTH(Settings.getActionByName("menu_transform_x_interaction")),
TRANSFORM_X(Settings.getActionByName("menu_transform_x_interaction")),
TRANSFORM_HUNDRED(Settings.getActionByName("menu_transform_x_interaction")),
TRANSFORM_SIXTH(settings.get("menu_transform_all_but_one_interaction")),
TRANSFORM_ALL_BUT_ONE(settings.get("menu_transform_all_but_one_interaction")),
TRANSFORM_SIXTH(Settings.getActionByName("menu_transform_all_but_one_interaction")),
TRANSFORM_ALL_BUT_ONE(Settings.getActionByName("menu_transform_all_but_one_interaction")),
TRANSFORM_EXAMINE(settings.get("menu_transform_examine_interaction")),
TRANSFORM_EXAMINE(Settings.getActionByName("menu_transform_examine_interaction")),
FIRST(settings.get("menu_item_first_interaction")),
WEAR(settings.get("menu_item_first_interaction")),
FIRST(Settings.getActionByName("menu_item_first_interaction")),
WEAR(Settings.getActionByName("menu_item_first_interaction")),
SECOND(settings.get("menu_item_second_interaction")),
CONSUME(settings.get("menu_item_second_interaction")),
DRINK(settings.get("menu_item_second_interaction")),
SECOND(Settings.getActionByName("menu_item_second_interaction")),
CONSUME(Settings.getActionByName("menu_item_second_interaction")),
DRINK(Settings.getActionByName("menu_item_second_interaction")),
THIRD(settings.get("menu_item_third_interaction")),
USE(settings.get("menu_item_third_interaction")),
THIRD(Settings.getActionByName("menu_item_third_interaction")),
USE(Settings.getActionByName("menu_item_third_interaction")),
FOURTH(settings.get("menu_item_fourth_interaction")),
EMPTY(settings.get("menu_item_fourth_interaction")),
FOURTH(Settings.getActionByName("menu_item_fourth_interaction")),
EMPTY(Settings.getActionByName("menu_item_fourth_interaction")),
FIFTH(settings.get("menu_item_fifth_interaction")),
DROP(settings.get("menu_item_fifth_interaction")),
FIFTH(Settings.getActionByName("menu_item_fifth_interaction")),
DROP(Settings.getActionByName("menu_item_fifth_interaction")),
SIXTH(settings.get("menu_item_sixth_interaction")),
EXAMINE(settings.get("menu_item_sixth_interaction")),
SIXTH(Settings.getActionByName("menu_item_sixth_interaction")),
EXAMINE(Settings.getActionByName("menu_item_sixth_interaction")),
SEVENTH(settings.get("menu_item_seventh_interaction")),
USE_WITH(settings.get("menu_item_seventh_interaction"));
SEVENTH(Settings.getActionByName("menu_item_seventh_interaction")),
USE_WITH(Settings.getActionByName("menu_item_seventh_interaction"));
private int actionId;
@@ -3,6 +3,7 @@ package org.rev317.min.api.methods;
import org.parabot.core.Context;
import org.rev317.min.Loader;
import org.rev317.min.accessors.Client;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Character;
import org.rev317.min.api.wrappers.*;
@@ -34,6 +35,7 @@ public class Menu {
*
* @param object
* @param actionIndex
*
* @deprecated
*/
public static void interact(SceneObject object, int actionIndex) {
@@ -87,6 +89,7 @@ public class Menu {
*
* @param character
* @param actionIndex
*
* @deprecated
*/
public static void interact(Character character, int actionIndex) {
@@ -129,6 +132,7 @@ public class Menu {
* @param item
* @param actionIndex
* @param interfaceParentId
*
* @deprecated
*/
public static void transformItem(Item item, int actionIndex, int interfaceParentId) {
@@ -160,7 +164,7 @@ public class Menu {
* @param item
*/
public static void take(GroundItem item) {
sendAction(settings.get("button_take_item"), item.getId(), item.getX(), item.getY());
sendAction(Settings.getActionByName("button_take_item"), item.getId(), item.getX(), item.getY());
}
/**
@@ -178,6 +182,7 @@ public class Menu {
*
* @param item
* @param action
*
* @deprecated
*/
public static void interact(GroundItem item, int action) {
@@ -262,7 +267,7 @@ public class Menu {
* @param item
*/
public static void drop(Item item) {
sendAction(settings.get("button_drop_item"), item.getId() - 1, item.getSlot(), settings.get("inventory_index"));
sendAction(Settings.getActionByName("button_drop_item"), item.getId() - 1, item.getSlot(), Settings.getActionByName("inventory_index"));
}
/**
@@ -271,7 +276,7 @@ public class Menu {
* @param id
*/
public static void clickButton(int id) {
sendAction(settings.get("button_action_click"), 0, 0, id);
sendAction(Settings.getActionByName("button_action_click"), 0, 0, id);
}
/**
@@ -4,6 +4,7 @@ import org.parabot.core.Context;
import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader;
import org.rev317.min.accessors.Client;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Npc;
import java.util.ArrayList;
@@ -39,6 +40,7 @@ public class Npcs {
* Gets all Npcs except local Npc
*
* @param filter
*
* @return all Npcs
*/
public static final Npc[] getNpcs(final Filter<Npc> filter) {
@@ -71,6 +73,7 @@ public class Npcs {
* Gets the closest npc which matches the given filter
*
* @param filter
*
* @return closest npc
*/
public static final Npc getClosest(final Filter<Npc> filter) {
@@ -86,6 +89,7 @@ public class Npcs {
* Gets the closest npc which matches the given ids
*
* @param ids
*
* @return closest npc
*/
public static final Npc getClosest(int... ids) {
@@ -101,6 +105,7 @@ public class Npcs {
* Returns array with the first index to be the nearest Npc
*
* @param filter
*
* @return nearest Npcs
*/
public static final Npc[] getNearest(final Filter<Npc> filter) {
@@ -114,6 +119,7 @@ public class Npcs {
* Gets nearest npcs which hold given id(s)
*
* @param ids
*
* @return array of npcs with the first index to be the nearest
*/
public static final Npc[] getNearest(final int... ids) {
@@ -148,31 +154,31 @@ public class Npcs {
}
public enum Option {
FIRST(settings.get("menu_character_first_interaction")),
ATTACK(settings.get("menu_character_first_interaction")),
FIRST(Settings.getActionByName("menu_character_first_interaction")),
ATTACK(Settings.getActionByName("menu_character_first_interaction")),
SECOND(settings.get("menu_character_second_interaction")),
TALK_TO(settings.get("menu_character_second_interaction")),
INTERACT(settings.get("menu_character_second_interaction")),
BAIT(settings.get("menu_character_second_interaction")),
CAGE(settings.get("menu_character_second_interaction")),
NET(settings.get("menu_character_second_interaction")),
SECOND(Settings.getActionByName("menu_character_second_interaction")),
TALK_TO(Settings.getActionByName("menu_character_second_interaction")),
INTERACT(Settings.getActionByName("menu_character_second_interaction")),
BAIT(Settings.getActionByName("menu_character_second_interaction")),
CAGE(Settings.getActionByName("menu_character_second_interaction")),
NET(Settings.getActionByName("menu_character_second_interaction")),
THIRD(settings.get("menu_character_third_interaction")),
TRADE(settings.get("menu_character_third_interaction")),
BANK(settings.get("menu_character_third_interaction")),
PICKPOCKET(settings.get("menu_character_third_interaction")),
HARPOON(settings.get("menu_character_third_interaction")),
GET_TASK(settings.get("menu_character_third_interaction")),
THIRD(Settings.getActionByName("menu_character_third_interaction")),
TRADE(Settings.getActionByName("menu_character_third_interaction")),
BANK(Settings.getActionByName("menu_character_third_interaction")),
PICKPOCKET(Settings.getActionByName("menu_character_third_interaction")),
HARPOON(Settings.getActionByName("menu_character_third_interaction")),
GET_TASK(Settings.getActionByName("menu_character_third_interaction")),
FOURTH(settings.get("menu_character_fourth_interaction")),
COLLECT(settings.get("menu_character_fourth_interaction")),
CHANGE_CLOTHES(settings.get("menu_character_fourth_interaction")),
FOURTH(Settings.getActionByName("menu_character_fourth_interaction")),
COLLECT(Settings.getActionByName("menu_character_fourth_interaction")),
CHANGE_CLOTHES(Settings.getActionByName("menu_character_fourth_interaction")),
FIFTH(settings.get("menu_character_fifth_interaction")),
REWARD(settings.get("menu_character_fifth_interaction")),
FIFTH(Settings.getActionByName("menu_character_fifth_interaction")),
REWARD(Settings.getActionByName("menu_character_fifth_interaction")),
EXAMINE(settings.get("menu_character_examine"));
EXAMINE(Settings.getActionByName("menu_character_examine"));
private int actionId;
@@ -4,6 +4,7 @@ import org.parabot.core.Context;
import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader;
import org.rev317.min.accessors.Client;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Player;
import java.util.ArrayList;
@@ -39,6 +40,7 @@ public class Players {
* Gets all players except local player
*
* @param filter
*
* @return all players
*/
public static final Player[] getPlayers(final Filter<Player> filter) {
@@ -71,6 +73,7 @@ public class Players {
* Returns array with the first index to be the nearest player
*
* @param filter
*
* @return nearest players
*/
public static final Player[] getNearest(final Filter<Player> filter) {
@@ -98,24 +101,24 @@ public class Players {
}
public enum Option {
FIRST(settings.get("menu_character_first_interaction")),
FIRST(Settings.getActionByName("menu_character_first_interaction")),
SECOND(settings.get("menu_character_second_interaction")),
SECOND(Settings.getActionByName("menu_character_second_interaction")),
THIRD(settings.get("menu_character_third_interaction")),
THIRD(Settings.getActionByName("menu_character_third_interaction")),
FOURTH(settings.get("menu_character_fourth_interaction")),
FOURTH(Settings.getActionByName("menu_character_fourth_interaction")),
FIFTH(settings.get("menu_character_fifth_interaction")),
FIFTH(Settings.getActionByName("menu_character_fifth_interaction")),
FOLLOW(settings.get("menu_character_follow")),
FOLLOW(Settings.getActionByName("menu_character_follow")),
TRADE(settings.get("menu_character_trade")),
TRADE(Settings.getActionByName("menu_character_trade")),
ATTACK(settings.get("menu_character_attack")),
CHALLENGE(settings.get("menu_character_attack")),
ATTACK(Settings.getActionByName("menu_character_attack")),
CHALLENGE(Settings.getActionByName("menu_character_attack")),
EXAMINE(settings.get("menu_character_examine"));
EXAMINE(Settings.getActionByName("menu_character_examine"));
private int actionId;
@@ -5,6 +5,7 @@ import org.parabot.environment.api.utils.Filter;
import org.rev317.min.Loader;
import org.rev317.min.accessors.Ground;
import org.rev317.min.accessors.SceneObjectTile;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.SceneObject;
import java.util.*;
@@ -67,6 +68,7 @@ public class SceneObjects {
* Returns array of sceneobjects with the first index to be the nearest
*
* @param filter
*
* @return sceneobjects
*/
public static final SceneObject[] getNearest(Filter<SceneObject> filter) {
@@ -89,6 +91,7 @@ public class SceneObjects {
* Returns nearest objects with given id
*
* @param ids
*
* @return sceneobjects
*/
public static final SceneObject[] getNearest(final int... ids) {
@@ -175,6 +178,7 @@ public class SceneObjects {
*
* @param x
* @param y
*
* @return array of sceneobjects, or null if there aren't any
*/
public static final Collection<SceneObject> getSceneObjectsAtTile(int x, int y) {
@@ -228,37 +232,36 @@ public class SceneObjects {
return sceneObjects;
}
public enum Option {
FIRST(settings.get("menu_scene_object_first_interaction")),
TALK_TO(settings.get("menu_scene_object_first_interaction")),
CHOP_DOWN(settings.get("menu_scene_object_first_interaction")),
CRAFT_RUNE(settings.get("menu_scene_object_first_interaction")),
PRAY_AT(settings.get("menu_scene_object_first_interaction")),
OPEN(settings.get("menu_scene_object_first_interaction")),
DEPOSIT(settings.get("menu_scene_object_first_interaction")),
USE(settings.get("menu_scene_object_first_interaction")),
SEARCH(settings.get("menu_scene_object_first_interaction")),
CLOSE(settings.get("menu_scene_object_first_interaction")),
CROSS(settings.get("menu_scene_object_first_interaction")),
MINE(settings.get("menu_scene_object_first_interaction")),
SMELT(settings.get("menu_scene_object_first_interaction")),
FIRST(Settings.getActionByName("menu_scene_object_first_interaction")),
TALK_TO(Settings.getActionByName("menu_scene_object_first_interaction")),
CHOP_DOWN(Settings.getActionByName("menu_scene_object_first_interaction")),
CRAFT_RUNE(Settings.getActionByName("menu_scene_object_first_interaction")),
PRAY_AT(Settings.getActionByName("menu_scene_object_first_interaction")),
OPEN(Settings.getActionByName("menu_scene_object_first_interaction")),
DEPOSIT(Settings.getActionByName("menu_scene_object_first_interaction")),
USE(Settings.getActionByName("menu_scene_object_first_interaction")),
SEARCH(Settings.getActionByName("menu_scene_object_first_interaction")),
CLOSE(Settings.getActionByName("menu_scene_object_first_interaction")),
CROSS(Settings.getActionByName("menu_scene_object_first_interaction")),
MINE(Settings.getActionByName("menu_scene_object_first_interaction")),
SMELT(Settings.getActionByName("menu_scene_object_first_interaction")),
SECOND(settings.get("menu_scene_object_second_interaction")),
TELEPORT(settings.get("menu_scene_object_second_interaction")),
STEAL_FROM(settings.get("menu_scene_object_second_interaction")),
PRAY(settings.get("menu_scene_object_second_interaction")),
USE_QUICKLY(settings.get("menu_scene_object_second_interaction")),
INSPECT(settings.get("menu_scene_object_second_interaction")),
SECOND(Settings.getActionByName("menu_scene_object_second_interaction")),
TELEPORT(Settings.getActionByName("menu_scene_object_second_interaction")),
STEAL_FROM(Settings.getActionByName("menu_scene_object_second_interaction")),
PRAY(Settings.getActionByName("menu_scene_object_second_interaction")),
USE_QUICKLY(Settings.getActionByName("menu_scene_object_second_interaction")),
INSPECT(Settings.getActionByName("menu_scene_object_second_interaction")),
THIRD(settings.get("menu_scene_object_third_interaction")),
THIRD(Settings.getActionByName("menu_scene_object_third_interaction")),
FOURTH(settings.get("menu_scene_object_fourth_interaction")),
GUIDE(settings.get("menu_scene_object_fourth_interaction")),
FOURTH(Settings.getActionByName("menu_scene_object_fourth_interaction")),
GUIDE(Settings.getActionByName("menu_scene_object_fourth_interaction")),
FIFTH(settings.get("menu_scene_object_fifth_interaction")),
FIFTH(Settings.getActionByName("menu_scene_object_fifth_interaction")),
EXAMINE(settings.get("menu_scene_object_examine"));
EXAMINE(Settings.getActionByName("menu_scene_object_examine"));
private int actionId;
@@ -9,7 +9,7 @@ public enum Skill {
ATTACK, DEFENSE, STRENGTH, HITPOINTS, RANGE, PRAYER, MAGIC, COOKING, WOODCUTTING, FLETCHING, FISHING, FIREMAKING, CRAFTING, SMITHING, MINING, HERBLORE, AGILITY, THIEVING, SLAYER, FARMING, RUNECRAFTING, CONSTRUCTION, HUNTER, 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,
3523, 3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824,
12031, 13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473,
@@ -24,12 +24,13 @@ public enum Skill {
13034431, 14391160, 15889109, 17542976, 19368992, 21385073,
23611006, 26068632, 28782069, 31777943, 35085654, 38737661,
42769801, 47221641, 52136869, 57563718, 63555443, 70170840,
77474828, 85539082, 94442737, 104273167};
77474828, 85539082, 94442737, 104273167 };
/**
* Returns the experience of the provided skill.
*
* @param index the skill index.
*
* @return the experience.
*/
public static final int getCurrentExperience(int index) {
@@ -40,6 +41,7 @@ public enum Skill {
* 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) {
@@ -50,6 +52,7 @@ public enum Skill {
* 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) {
@@ -60,6 +63,7 @@ public enum Skill {
* 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) {
@@ -74,6 +78,7 @@ public enum Skill {
* 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) {
@@ -90,6 +95,7 @@ public enum Skill {
* 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) {
@@ -105,6 +111,7 @@ public enum Skill {
* 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) {
@@ -4,6 +4,7 @@ import org.parabot.core.Context;
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.accessors.Interface;
import org.rev317.min.api.methods.utils.Settings;
import org.rev317.min.api.wrappers.Item;
import java.util.ArrayList;
@@ -20,10 +21,11 @@ public class Trading {
* Checks if the first or the second screen is open, based on the given boolean
*
* @param first If true, the first trade screen will be checked. If false, the second screen will be checked
*
* @return True if the requested screen is open
*/
public static boolean isOpen(boolean first) {
return Interfaces.getOpenInterfaceId() == (first ? settings.get("first_trade_interface_id") : settings.get("second_trade_interface_id"));
return Interfaces.getOpenInterfaceId() == (first ? Settings.getActionByName("first_trade_interface_id") : Settings.getActionByName("second_trade_interface_id"));
}
/**
@@ -32,7 +34,7 @@ public class Trading {
* @return True if open, false if not open
*/
public static boolean isOpen() {
return Interfaces.getOpenInterfaceId() == settings.get("first_trade_interface_id") || Interfaces.getOpenInterfaceId() == settings.get("second_trade_interface_id");
return Interfaces.getOpenInterfaceId() == Settings.getActionByName("first_trade_interface_id") || Interfaces.getOpenInterfaceId() == Settings.getActionByName("second_trade_interface_id");
}
/**
@@ -51,8 +53,8 @@ public class Trading {
public static Item[] getMyOffer() {
ArrayList<Item> items = new ArrayList<>();
int[] ids = getItemIDs(settings.get("my_offer_interface_id"));
int[] stacks = getItemStacks(settings.get("my_offer_interface_id"));
int[] ids = getItemIDs(Settings.getActionByName("my_offer_interface_id"));
int[] stacks = getItemStacks(Settings.getActionByName("my_offer_interface_id"));
for (int i = 0; i < ids.length; i++) {
if (ids[i] > 0) {
items.add(new Item(ids[i], stacks[i], i));
@@ -63,8 +65,8 @@ public class Trading {
public static Item[] getOpponentsOffer() {
ArrayList<Item> items = new ArrayList<>();
int[] ids = getItemIDs(settings.get("opponent_offer_interface_id"));
int[] stacks = getItemStacks(settings.get("opponent_offer_interface_id"));
int[] ids = getItemIDs(Settings.getActionByName("opponent_offer_interface_id"));
int[] stacks = getItemStacks(Settings.getActionByName("opponent_offer_interface_id"));
for (int i = 0; i < ids.length; i++) {
if (ids[i] > 0) {
items.add(new Item(ids[i], stacks[i], i));
@@ -106,7 +108,7 @@ public class Trading {
Time.sleep(new SleepCondition() {
@Override
public boolean isValid() {
return Interfaces.getOpenInterfaceId() == settings.get("second_trade_interface_id");
return Interfaces.getOpenInterfaceId() == Settings.getActionByName("second_trade_interface_id");
}
}, 2500);
}
@@ -1,6 +1,5 @@
package org.rev317.min.api.methods;
import org.parabot.core.Context;
import org.rev317.min.Loader;
import org.rev317.min.api.wrappers.Tile;
@@ -36,6 +35,7 @@ public class Walking {
/**
* @param tilePath
*
* @return <b>true</b> if destination reached, otherwise <b>false</b>
*/
public static boolean walkDown(TilePath tilePath) {
@@ -51,6 +51,7 @@ public class Walking {
* Gets nearest reachable tile on minimap to given tile
*
* @param tile
*
* @return nearest reachable tile on minimap
*/
public static Tile getNearestTileTo(Tile tile) {
@@ -0,0 +1,50 @@
package org.rev317.min.api.methods.utils;
/**
* @author EmmaStone
*/
public enum Emote {
YES(168),
NO(169),
BOW(164),
ANGRY(165),
THINK(162),
WAVE(163),
SHRUG(13370),
CHEER(171),
BECKON(167),
LAUGH(170),
JUMP_FOR_JOY(13366),
YAWN(13368),
DANCE(166),
JIG(13363),
SPIN(13364),
HEADBANG(13365),
CRY(161),
BLOW_KISS(11100),
PANIC(13362),
RASPBERRY(13367),
CLAP(172),
SALUTE(13369),
GOBLIN_BOW(13383),
GOBLIN_SALUTE(13384),
GLASS_BOX(667),
CLIMB_ROPE(6503),
LEAN_ON_AIR(6506),
GLASS_WALL(666),
ZOMBIE_WALK(18464),
ZOMBIE_DANCE(18465),
SCARED(15166),
RABBIT_HOP(18686),
SKILLCAPE_EMOTE(154);
private int action3;
Emote(int action3) {
this.action3 = action3;
}
public int getAction3() {
return action3;
}
}
@@ -0,0 +1,82 @@
package org.rev317.min.api.methods.utils;
/**
* @author EmmaStone
*/
public enum Settings {
BANK_INTERFACE_ID("bank_interface_id", 5292),
ITEM_INTERFACE_ID("item_interface_id", 5382),
BUTTON_CLOSE_BANK("button_close_bank", 5384),
BUTTON_DEPOSIT_ALL("button_deposit_all", 5386),
BUTTON_ACTION_CLICK("button_deposit_all", 646),
BUTTON_DROP_ITEM("button_drop_item", 847),
BUTTON_TAKE_ITEM("button_take_item", 234),
INVENTORY_PARENT_ID("inventory_parent_id", 5064),
BANK_OPEN_ID("bank_open_index", 1),
INVENTORY_INDEX("inventory_index", 3214),
MY_OFFER_INTERFACE_ID("my_offer_interface_id", 3415),
OPPONENT_OFFER_INTERFACE_ID("opponent_offer_interface_id", 3416),
FIRST_TRADE_INTERFACE_ID("first_trade_interface_id", 3323),
SECOND_TRADE_INTERFACE_ID("second_trade_interface_id", 3443),
MENU_SCENE_OBJECT_FIRST_INTERACTION("menu_scene_object_first_interaction", 502),
MENU_SCENE_OBJECT_SECOND_INTERACTION("menu_scene_object_second_interaction", 900),
MENU_SCENE_OBJECT_THIRD_INTERACTION("menu_scene_object_third_interaction", 113),
MENU_SCENE_OBJECT_FOURTH_INTERACTION("menu_scene_object_fourth_interaction", 872),
MENU_SCENE_OBJECT_FIFTH_INTERACTION("menu_scene_object_fifth_interaction", 1062),
MENU_SCENE_OBJECT_EXAMINE("menu_scene_object_examine", 1226),
MENU_CHARACTER_FOLLOW("menu_character_follow", 2779),
MENU_CHARACTER_TRADE("menu_character_trade", 2027),
MENU_CHARACTER_ATTACK("menu_character_attack", 2561),
MENU_CHARACTER_FIRST_INTERACTION("menu_character_first_interaction", 412),
MENU_CHARACTER_SECOND_INTERACTION("menu_character_second_interaction", 20),
MENU_CHARACTER_THIRD_INTERACTION("menu_character_third_interaction", 225),
MENU_CHARACTER_FOURTH_INTERACTION("menu_character_fourth_interaction", 965),
MENU_CHARACTER_FIFTH_INTERACTION("menu_character_fifth_interaction", 478),
MENU_CHARACTER_EXAMINE("menu_character_examine", 1025),
MENU_TRANSFORM_ONE_INTERACTION("menu_transform_one_interaction", 632),
MENU_TRANSFORM_FIVE_INTERACTION("menu_transform_five_interaction", 78),
MENU_TRANSFORM_TEN_INTERACTION("menu_transform_ten_interaction", 867),
MENU_TRANSFORM_ALL_INTERACTION("menu_transform_all_interaction", 431),
MENU_TRANSFORM_X_INTERACTION("menu_transform_x_interaction", 53),
MENU_TRANSFORM_ALL_BUT_ONE_INTERACTION("menu_transform_all_but_one_interaction", 775),
MENU_TRANSFORM_EXAMINE_INTERACTION("menu_transform_examine_interaction", 1125),
MENU_GROUND_ITEM_FIRST_INTERACTION("menu_ground_item_first_interaction", 652),
MENU_GROUND_ITEM_SECOND_INTERACTION("menu_ground_item_second_interaction", 567),
MENU_GROUND_ITEM_THIRD_INTERACTION("menu_ground_item_third_interaction", 234),
MENU_GROUND_ITEM_FOURTH_INTERACTION("menu_ground_item_fourth_interaction", 244),
MENU_GROUND_ITEM_FIFTH_INTERACTION("menu_ground_item_fifth_interaction", 213),
MENU_GROUND_ITEM_EXAMINE_INTERACTION("menu_ground_item_examine_interaction", 1448),
MENU_ITEM_FIRST_INTERACTION("menu_item_first_interaction", 454),
MENU_ITEM_SECOND_INTERACTION("menu_item_second_interaction", 74),
MENU_ITEM_THIRD_INTERACTION("menu_item_third_interaction", 447),
MENU_ITEM_FOURTH_INTERACTION("menu_item_fourth_interaction", 493),
MENU_ITEM_FIFTH_INTERACTION("menu_item_fifth_interaction", 847),
MENU_ITEM_SIXTH_INTERACTION("menu_item_sixth_interaction", 1125),
MENU_ITEM_SEVENTH_INTERACTION("menu_item_seventh_interaction", 870);
private String name;
private int id;
Settings(String name, int id) {
this.name = name;
this.id = id;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
public static int getActionByName(String name) {
for (Settings settings : Settings.values()) {
if (name.equalsIgnoreCase(settings.getName())) {
return settings.getId();
}
}
return 0;
}
}
@@ -86,6 +86,7 @@ public class Area {
* Checks if a tile is in the area
*
* @param tile The tile to check
*
* @return <b>true</b> if area does contain the tile, otherwise <b>false</b>
*/
public boolean contains(Tile tile) {
@@ -97,6 +98,7 @@ public class Area {
*
* @param x The x-axis from the tile
* @param y The y-axis from the tile
*
* @return True if the area does contain the tile, otherwise false
*/
public boolean contains(int x, int y) {
@@ -1,15 +1,18 @@
package org.rev317.min.api.wrappers;
import org.parabot.core.reflect.RefClass;
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.Loader;
import org.rev317.min.api.interfaces.Locatable;
import org.rev317.min.api.methods.Calculations;
import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Menu;
import org.rev317.min.api.methods.Players;
import org.rev317.min.api.methods.utils.Emote;
/**
* @author Everel
* @author Everel, EmmaStone
*/
public class Character implements Locatable {
@@ -116,6 +119,7 @@ public class Character implements Locatable {
* Interacts with this character
*
* @param i
*
* @deprecated
*/
public void interact(int i) {
@@ -146,6 +150,21 @@ public class Character implements Locatable {
return null;
}
/**
* Performs an emote
*
* @param emote
*/
public void performEmote(Emote emote) {
Menu.clickButton(emote.getAction3());
Time.sleep(new SleepCondition() {
@Override
public boolean isValid() {
return Players.getMyPlayer().getAnimation() != -1;
}
}, 1500);
}
/**
* Gets the accessor class
*
@@ -61,6 +61,7 @@ public class GroundItem implements Locatable {
* Interacts with this ground item
*
* @param actionIndex
*
* @deprecated
*/
public void interact(int actionIndex) {
@@ -71,6 +71,7 @@ public class Item {
* Interacts with this item
*
* @param i
*
* @deprecated
*/
public void interact(int i) {
@@ -81,6 +82,7 @@ public class Item {
* Interacts with this item
*
* @param s
*
* @deprecated
*/
public void interact(String s) {
@@ -90,6 +92,7 @@ public class Item {
/**
* @param actionIndex
* @param interfaceParentId
*
* @deprecated
*/
public void transform(int actionIndex, int interfaceParentId) {
@@ -15,7 +15,6 @@ public final class Npc extends Character {
this.accessor = accessor;
}
/**
* Gets the definition of this npc
*
@@ -25,6 +25,7 @@ public class NpcDef {
* Gets id of this item
*
* @param avoidLong defines if it should check if long id exists
*
* @return id of this item
*/
private int getId(boolean avoidLong) {
@@ -102,6 +102,7 @@ public class SceneObject implements Locatable {
* Interacts with this object
*
* @param actionIndex
*
* @deprecated
*/
public void interact(int actionIndex) {
@@ -139,6 +139,7 @@ public final class Tile implements TileFlags, Locatable {
* Determines if this tile is reachable
*
* @param isObject whether this tile is an object tile
*
* @return <code>true</code> if this tile is reachable, otherwise <code>false</code>
*/
public boolean isReachable(boolean isObject) {
@@ -3,7 +3,6 @@ package org.rev317.min.callback;
import org.rev317.min.api.events.MessageEvent;
import org.rev317.min.script.ScriptEngine;
public class MessageCallback {
public static final void messageListenerHook(int type, String name, String message) {
@@ -20,8 +20,9 @@ public class DSceneObjects extends AbstractDebugger {
@Override
public void toggle() {
SceneObject[] objects = SceneObjects.getNearest();
if (objects == null || objects.length == 0)
if (objects == null || objects.length == 0) {
return;
}
for (int i = objects.length - 1; i >= 0; i--) {
System.out.println(