mirror of
https://github.com/2006-Scape/Parabot-317-API-Minified.git
synced 2026-07-07 08:39:13 +00:00
[FEATURE] Added getLongId
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ 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) {
|
||||||
@@ -147,7 +146,6 @@ 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) {
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ public class Equipment {
|
|||||||
RING(12),
|
RING(12),
|
||||||
AMMO(13);
|
AMMO(13);
|
||||||
|
|
||||||
private int slot;
|
|
||||||
private final int INTERFACE_ID = 1688;
|
private final int INTERFACE_ID = 1688;
|
||||||
|
private int slot;
|
||||||
|
|
||||||
Slot(int slot) {
|
Slot(int slot) {
|
||||||
this.slot = slot;
|
this.slot = slot;
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ public class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Login to a server
|
* Login to a server
|
||||||
|
*
|
||||||
* @param username String
|
* @param username String
|
||||||
* @param password String
|
* @param password String
|
||||||
* @param reconnecting True if it's a retry, false if not
|
* @param reconnecting True if it's a retry, false if not
|
||||||
@@ -164,6 +165,7 @@ public class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Login to a server
|
* Login to a server
|
||||||
|
*
|
||||||
* @param username String
|
* @param username String
|
||||||
* @param password String
|
* @param password String
|
||||||
*/
|
*/
|
||||||
@@ -173,6 +175,7 @@ public class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds friend
|
* Adds friend
|
||||||
|
*
|
||||||
* @param username String
|
* @param username String
|
||||||
*/
|
*/
|
||||||
public static void addFriend(String username) {
|
public static void addFriend(String username) {
|
||||||
@@ -181,6 +184,7 @@ public class Game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes friend
|
* Deletes friend
|
||||||
|
*
|
||||||
* @param username String
|
* @param username String
|
||||||
*/
|
*/
|
||||||
public static void deleteFriend(String username) {
|
public static void deleteFriend(String username) {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ public class GroundItems {
|
|||||||
*
|
*
|
||||||
* @param x - local region x
|
* @param x - local region x
|
||||||
* @param y - local region y
|
* @param y - local region y
|
||||||
*
|
|
||||||
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
|
* @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) {
|
public static final GroundItem[] getGroundItemsAt(final int x, final int y) {
|
||||||
@@ -119,7 +118,6 @@ public class GroundItems {
|
|||||||
* Gets the closest GroundItem which matches the given filter.
|
* Gets the closest GroundItem which matches the given filter.
|
||||||
*
|
*
|
||||||
* @param filter Filter that should be applied to the GroundItem.
|
* @param filter Filter that should be applied to the GroundItem.
|
||||||
*
|
|
||||||
* @return closest GroundItem
|
* @return closest GroundItem
|
||||||
*/
|
*/
|
||||||
public static final GroundItem getClosest(final Filter<GroundItem> filter) {
|
public static final GroundItem getClosest(final Filter<GroundItem> filter) {
|
||||||
@@ -134,7 +132,6 @@ public class GroundItems {
|
|||||||
* Gets the closest GroundItems which matches the given ids.
|
* Gets the closest GroundItems which matches the given ids.
|
||||||
*
|
*
|
||||||
* @param ids ID's of the GroundItems to look for.
|
* @param ids ID's of the GroundItems to look for.
|
||||||
*
|
|
||||||
* @return closest GroundItems
|
* @return closest GroundItems
|
||||||
*/
|
*/
|
||||||
public static final GroundItem getClosest(int... ids) {
|
public static final GroundItem getClosest(int... ids) {
|
||||||
@@ -149,7 +146,6 @@ 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 Filter that should be applied to the GroundItem.
|
* @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.
|
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
|
||||||
*/
|
*/
|
||||||
public static final GroundItem[] getNearest(Filter<GroundItem> filter) {
|
public static final GroundItem[] getNearest(Filter<GroundItem> filter) {
|
||||||
@@ -171,7 +167,6 @@ 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 ids GroundItem ID's to look for.
|
* @param ids GroundItem ID's to look for.
|
||||||
*
|
|
||||||
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
|
* @return GroundItems Array of the Nearest GroundItems with the first index to be the nearest.
|
||||||
*/
|
*/
|
||||||
public static final GroundItem[] getNearest(final int... ids) {
|
public static final GroundItem[] getNearest(final int... ids) {
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ import java.util.HashMap;
|
|||||||
*/
|
*/
|
||||||
public class Inventory {
|
public class Inventory {
|
||||||
|
|
||||||
private static HashMap<String, Integer> settings = Context.getInstance().getServerProviderInfo().getSettings();
|
|
||||||
|
|
||||||
private static final Filter<Item> ALL_FILTER = new Filter<Item>() {
|
private static final Filter<Item> ALL_FILTER = new Filter<Item>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -27,6 +25,7 @@ public class Inventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
private static HashMap<String, Integer> settings = Context.getInstance().getServerProviderInfo().getSettings();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the inventory
|
* Clears the inventory
|
||||||
@@ -75,7 +74,6 @@ 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 int getCount(int... ids) {
|
public static int getCount(int... ids) {
|
||||||
@@ -86,7 +84,6 @@ 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 int getCount(final boolean includeStack) {
|
public static int getCount(final boolean includeStack) {
|
||||||
@@ -110,7 +107,6 @@ public class 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 int getCount(final boolean includeStack, int... ids) {
|
public static int getCount(final boolean includeStack, int... ids) {
|
||||||
@@ -148,7 +144,6 @@ 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 Item[] getItems(final int... ids) {
|
public static Item[] getItems(final int... ids) {
|
||||||
@@ -171,7 +166,6 @@ 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 Item[] getItems(final Filter<Item> filter) {
|
public static Item[] getItems(final Filter<Item> filter) {
|
||||||
@@ -218,7 +212,6 @@ public class Inventory {
|
|||||||
* Checks if an item exists in the inventory
|
* Checks if an item exists in the inventory
|
||||||
*
|
*
|
||||||
* @param id The item id that will be looked for
|
* @param id The item id that will be looked for
|
||||||
*
|
|
||||||
* @return True if the item exists in the inventory
|
* @return True if the item exists in the inventory
|
||||||
*/
|
*/
|
||||||
public static boolean contains(int... id) {
|
public static boolean contains(int... id) {
|
||||||
@@ -234,7 +227,6 @@ public class Inventory {
|
|||||||
* Returns the item in the inventory based on the given id
|
* 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
|
* @param id The item id that will be used to find the item in the inventory
|
||||||
*
|
|
||||||
* @return First found item in the inventory
|
* @return First found item in the inventory
|
||||||
*/
|
*/
|
||||||
public static Item getItem(int id) {
|
public static Item getItem(int id) {
|
||||||
@@ -251,7 +243,6 @@ public class Inventory {
|
|||||||
*
|
*
|
||||||
* @param itemOne The first item id that will be used to combine
|
* @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 itemTwo The second item id that will be used to combine
|
||||||
*
|
|
||||||
* @return True if nothing unexpected happened
|
* @return True if nothing unexpected happened
|
||||||
*/
|
*/
|
||||||
public static boolean combine(int itemOne, int itemTwo) {
|
public static boolean combine(int itemOne, int itemTwo) {
|
||||||
@@ -276,7 +267,6 @@ public class Inventory {
|
|||||||
* @param itemOne The first item id that will be used to combine
|
* @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 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
|
* @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
|
* @return True if the condition was true and nothing unexpected happened
|
||||||
*/
|
*/
|
||||||
public static boolean combine(int itemOne, int itemTwo, SleepCondition sleepCondition) {
|
public static boolean combine(int itemOne, int itemTwo, SleepCondition sleepCondition) {
|
||||||
|
|||||||
@@ -60,12 +60,14 @@ public class Items {
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (MalformedURLException | ParseException ignored) {}
|
} catch (MalformedURLException | ParseException ignored) {
|
||||||
|
}
|
||||||
return new int[0];
|
return new int[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an int array based on the string it starts with. getIdsStart(dragon) will return an int array with all items starting with dragon
|
* 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
|
* @param name
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -83,12 +85,14 @@ public class Items {
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (MalformedURLException | ParseException ignored) {}
|
} catch (MalformedURLException | ParseException ignored) {
|
||||||
|
}
|
||||||
return new int[0];
|
return new int[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an int array based on the string it contains. getIdsContain(dragon) will return an int array with all items containingdragon
|
* Returns an int array based on the string it contains. getIdsContain(dragon) will return an int array with all items containingdragon
|
||||||
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -106,7 +110,8 @@ public class Items {
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (MalformedURLException | ParseException ignored) {}
|
} catch (MalformedURLException | ParseException ignored) {
|
||||||
|
}
|
||||||
return new int[0];
|
return new int[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ 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.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Everel, JKetelaar
|
* @author Everel, JKetelaar
|
||||||
@@ -36,7 +39,6 @@ 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) {
|
||||||
@@ -68,7 +70,6 @@ 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) {
|
||||||
@@ -83,7 +84,6 @@ 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) {
|
||||||
@@ -98,7 +98,6 @@ 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) {
|
||||||
@@ -111,7 +110,6 @@ 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) {
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ 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.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Everel, JKetelaar
|
* @author Everel, JKetelaar
|
||||||
@@ -36,7 +39,6 @@ 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) {
|
||||||
@@ -68,7 +70,6 @@ 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) {
|
||||||
|
|||||||
@@ -12,14 +12,62 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public class Prayer {
|
public class Prayer {
|
||||||
|
|
||||||
public interface Book {
|
public static boolean isEnabled(Book book) {
|
||||||
public int getSetting();
|
return Game.getSetting(book.getSetting()) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
public int getAction();
|
public static void enable(final Book book) {
|
||||||
|
if (!isEnabled(book)) {
|
||||||
|
Menu.sendAction(169, -1, -1, book.getAction());
|
||||||
|
Time.sleep(new SleepCondition() {
|
||||||
|
@Override
|
||||||
|
public boolean isValid() {
|
||||||
|
return isEnabled(book);
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getLevel();
|
public static void disable(final Book book) {
|
||||||
|
if (isEnabled(book)) {
|
||||||
|
Menu.sendAction(169, -1, -1, book.getAction());
|
||||||
|
Time.sleep(new SleepCondition() {
|
||||||
|
@Override
|
||||||
|
public boolean isValid() {
|
||||||
|
return !isEnabled(book);
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getName();
|
public static Book[] getActivePrayers() {
|
||||||
|
ArrayList<Book> prayers = new ArrayList<>();
|
||||||
|
for (Book normal : Normal.values()) {
|
||||||
|
if (isEnabled(normal)) {
|
||||||
|
prayers.add(normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Book curse : Curse.values()) {
|
||||||
|
if (isEnabled(curse)) {
|
||||||
|
prayers.add(curse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return prayers.toArray(new Book[prayers.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setActivePrayers(Book[] prayers) {
|
||||||
|
for (Book book : prayers) {
|
||||||
|
for (Book normal : Normal.values()) {
|
||||||
|
if (!isEnabled(normal) && normal.equals(book)) {
|
||||||
|
enable(normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Book curse : Curse.values()) {
|
||||||
|
if (!isEnabled(curse) && curse.equals(book)) {
|
||||||
|
enable(curse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Normal implements Book {
|
public enum Normal implements Book {
|
||||||
@@ -176,62 +224,13 @@ public class Prayer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface Book {
|
||||||
|
public int getSetting();
|
||||||
|
|
||||||
public static boolean isEnabled(Book book) {
|
public int getAction();
|
||||||
return Game.getSetting(book.getSetting()) == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void enable(final Book book) {
|
public int getLevel();
|
||||||
if (!isEnabled(book)) {
|
|
||||||
Menu.sendAction(169, -1, -1, book.getAction());
|
|
||||||
Time.sleep(new SleepCondition() {
|
|
||||||
@Override
|
|
||||||
public boolean isValid() {
|
|
||||||
return isEnabled(book);
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void disable(final Book book) {
|
public String getName();
|
||||||
if (isEnabled(book)) {
|
|
||||||
Menu.sendAction(169, -1, -1, book.getAction());
|
|
||||||
Time.sleep(new SleepCondition() {
|
|
||||||
@Override
|
|
||||||
public boolean isValid() {
|
|
||||||
return !isEnabled(book);
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Book[] getActivePrayers() {
|
|
||||||
ArrayList<Book> prayers = new ArrayList<>();
|
|
||||||
for (Book normal : Normal.values()) {
|
|
||||||
if (isEnabled(normal)) {
|
|
||||||
prayers.add(normal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Book curse : Curse.values()) {
|
|
||||||
if (isEnabled(curse)) {
|
|
||||||
prayers.add(curse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return prayers.toArray(new Book[prayers.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setActivePrayers(Book[] prayers) {
|
|
||||||
for (Book book : prayers) {
|
|
||||||
for (Book normal : Normal.values()) {
|
|
||||||
if (!isEnabled(normal) && normal.equals(book)) {
|
|
||||||
enable(normal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Book curse : Curse.values()) {
|
|
||||||
if (!isEnabled(curse) && curse.equals(book)) {
|
|
||||||
enable(curse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ 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) {
|
||||||
@@ -88,7 +87,6 @@ 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) {
|
||||||
@@ -172,7 +170,6 @@ public class SceneObjects {
|
|||||||
* @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) {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public enum Skill {
|
|||||||
* Returns the experience of the provided skill.
|
* Returns the experience of the provided skill.
|
||||||
*
|
*
|
||||||
* @param index the skill index.
|
* @param index the skill index.
|
||||||
*
|
|
||||||
* @return the experience.
|
* @return the experience.
|
||||||
*/
|
*/
|
||||||
public static final int getCurrentExperience(int index) {
|
public static final int getCurrentExperience(int index) {
|
||||||
@@ -41,7 +40,6 @@ public enum Skill {
|
|||||||
* Returns the real level of the provided skill.
|
* Returns the real level of the provided skill.
|
||||||
*
|
*
|
||||||
* @param index the skill index.
|
* @param index the skill index.
|
||||||
*
|
|
||||||
* @return the real skill level.
|
* @return the real skill level.
|
||||||
*/
|
*/
|
||||||
public static final int getRealLevel(int index) {
|
public static final int getRealLevel(int index) {
|
||||||
@@ -52,7 +50,6 @@ public enum Skill {
|
|||||||
* Returns the current level of the provided skill. (Will return de-buffed/buffed levels)
|
* Returns the current level of the provided skill. (Will return de-buffed/buffed levels)
|
||||||
*
|
*
|
||||||
* @param index the skill index.
|
* @param index the skill index.
|
||||||
*
|
|
||||||
* @return the current skill level. Done by Bears
|
* @return the current skill level. Done by Bears
|
||||||
*/
|
*/
|
||||||
public static final int getCurrentLevel(int index) {
|
public static final int getCurrentLevel(int index) {
|
||||||
@@ -63,7 +60,6 @@ public enum Skill {
|
|||||||
* Returns the exact experience at the provided level.
|
* Returns the exact experience at the provided level.
|
||||||
*
|
*
|
||||||
* @param level the level.
|
* @param level the level.
|
||||||
*
|
|
||||||
* @return the experience at the provided level.
|
* @return the experience at the provided level.
|
||||||
*/
|
*/
|
||||||
public static final int getExperienceByLevel(int level) {
|
public static final int getExperienceByLevel(int level) {
|
||||||
@@ -77,7 +73,6 @@ public enum Skill {
|
|||||||
* Returns the exact level with the provided experience.
|
* Returns the exact level with the provided experience.
|
||||||
*
|
*
|
||||||
* @param experience the experience.
|
* @param experience the experience.
|
||||||
*
|
|
||||||
* @return the level at the provided experience.
|
* @return the level at the provided experience.
|
||||||
*/
|
*/
|
||||||
public static final int getLevelByExperience(int experience) {
|
public static final int getLevelByExperience(int experience) {
|
||||||
@@ -93,7 +88,6 @@ public enum Skill {
|
|||||||
* Returns the remaining experience for the provided skill to level up.
|
* Returns the remaining experience for the provided skill to level up.
|
||||||
*
|
*
|
||||||
* @param index the skill index.
|
* @param index the skill index.
|
||||||
*
|
|
||||||
* @return the remaining experience.
|
* @return the remaining experience.
|
||||||
*/
|
*/
|
||||||
public static final int getRemainingExperience(int index) {
|
public static final int getRemainingExperience(int index) {
|
||||||
@@ -108,7 +102,6 @@ public enum Skill {
|
|||||||
* Returns the percentage to the next level for the provided skill.
|
* Returns the percentage to the next level for the provided skill.
|
||||||
*
|
*
|
||||||
* @param index the skill index.
|
* @param index the skill index.
|
||||||
*
|
|
||||||
* @return the remaining percentage.
|
* @return the remaining percentage.
|
||||||
*/
|
*/
|
||||||
public static final int getPercentToNextLevel(int index) {
|
public static final int getPercentToNextLevel(int index) {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ package org.rev317.min.api.methods;
|
|||||||
|
|
||||||
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.Mouse;
|
|
||||||
import org.parabot.environment.scripts.framework.SleepCondition;
|
import org.parabot.environment.scripts.framework.SleepCondition;
|
||||||
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;
|
||||||
|
|
||||||
@@ -20,6 +18,7 @@ public class Trading {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the first or the second screen is open, based on the given boolean
|
* 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
|
* @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
|
* @return True if the requested screen is open
|
||||||
*/
|
*/
|
||||||
@@ -29,6 +28,7 @@ public class Trading {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if any of the trade screens are open
|
* Checks if any of the trade screens are open
|
||||||
|
*
|
||||||
* @return True if open, false if not open
|
* @return True if open, false if not open
|
||||||
*/
|
*/
|
||||||
public static boolean isOpen() {
|
public static boolean isOpen() {
|
||||||
@@ -98,7 +98,7 @@ public class Trading {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Add the id into the settings
|
* TODO: Add the id into the settings
|
||||||
*
|
* <p>
|
||||||
* Accepts the offer and hits the button to continue to the second screen
|
* Accepts the offer and hits the button to continue to the second screen
|
||||||
*/
|
*/
|
||||||
public static void acceptOffer() {
|
public static void acceptOffer() {
|
||||||
@@ -113,7 +113,7 @@ public class Trading {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Add the id into the settings
|
* TODO: Add the id into the settings
|
||||||
*
|
* <p>
|
||||||
* Accepts the trade and hits the button to complete the trade
|
* Accepts the trade and hits the button to complete the trade
|
||||||
*/
|
*/
|
||||||
public static void acceptTrade() {
|
public static void acceptTrade() {
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import java.awt.*;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Matt, JKetelaar
|
* @author Matt, JKetelaar
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class Area {
|
public class Area {
|
||||||
private Polygon p;
|
private Polygon p;
|
||||||
@@ -14,8 +12,7 @@ public class Area {
|
|||||||
/**
|
/**
|
||||||
* Initializes a PolygonArea with the tiles given
|
* Initializes a PolygonArea with the tiles given
|
||||||
*
|
*
|
||||||
* @param tiles
|
* @param tiles tiles to use in the area
|
||||||
* tiles to use in the area
|
|
||||||
*/
|
*/
|
||||||
public Area(Tile... tiles) {
|
public Area(Tile... tiles) {
|
||||||
this.p = new Polygon();
|
this.p = new Polygon();
|
||||||
@@ -27,8 +24,7 @@ public class Area {
|
|||||||
/**
|
/**
|
||||||
* Adds a tile to the area
|
* Adds a tile to the area
|
||||||
*
|
*
|
||||||
* @param t
|
* @param t The tile to add the area
|
||||||
* The tile to add the area
|
|
||||||
*/
|
*/
|
||||||
public void addTile(Tile t) {
|
public void addTile(Tile t) {
|
||||||
p.addPoint(t.getX(), t.getY());
|
p.addPoint(t.getX(), t.getY());
|
||||||
@@ -86,8 +82,7 @@ public class Area {
|
|||||||
/**
|
/**
|
||||||
* Checks if a tile is in the area
|
* Checks if a tile is in the area
|
||||||
*
|
*
|
||||||
* @param tile
|
* @param tile The tile to check
|
||||||
* The tile to check
|
|
||||||
* @return <b>true</b> if area does contain the tile, otherwise <b>false</b>
|
* @return <b>true</b> if area does contain the tile, otherwise <b>false</b>
|
||||||
*/
|
*/
|
||||||
public boolean contains(Tile tile) {
|
public boolean contains(Tile tile) {
|
||||||
@@ -99,7 +94,6 @@ public class Area {
|
|||||||
*
|
*
|
||||||
* @param x The x-axis from the tile
|
* @param x The x-axis from the tile
|
||||||
* @param y The y-axis from the tile
|
* @param y The y-axis from the tile
|
||||||
*
|
|
||||||
* @return True if the area does contain the tile, otherwise false
|
* @return True if the area does contain the tile, otherwise false
|
||||||
*/
|
*/
|
||||||
public boolean contains(int x, int y) {
|
public boolean contains(int x, int y) {
|
||||||
|
|||||||
@@ -115,9 +115,8 @@ public class Character implements Locatable {
|
|||||||
/**
|
/**
|
||||||
* Interacts with this character
|
* Interacts with this character
|
||||||
*
|
*
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param i
|
* @param i
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void interact(int i) {
|
public void interact(int i) {
|
||||||
Menu.interact(this, i);
|
Menu.interact(this, i);
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ package org.rev317.min.api.wrappers;
|
|||||||
|
|
||||||
import org.parabot.core.reflect.RefClass;
|
import org.parabot.core.reflect.RefClass;
|
||||||
import org.rev317.min.api.interfaces.Locatable;
|
import org.rev317.min.api.interfaces.Locatable;
|
||||||
import org.rev317.min.api.methods.*;
|
import org.rev317.min.api.methods.Calculations;
|
||||||
|
import org.rev317.min.api.methods.Game;
|
||||||
|
import org.rev317.min.api.methods.GroundItems;
|
||||||
|
import org.rev317.min.api.methods.Menu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Everel
|
* @author Everel
|
||||||
@@ -57,9 +60,8 @@ public class GroundItem implements Locatable {
|
|||||||
/**
|
/**
|
||||||
* Interacts with this ground item
|
* Interacts with this ground item
|
||||||
*
|
*
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param actionIndex
|
* @param actionIndex
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void interact(int actionIndex) {
|
public void interact(int actionIndex) {
|
||||||
Menu.interact(this, actionIndex);
|
Menu.interact(this, actionIndex);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ public class Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param option
|
* @param option
|
||||||
* @param interfaceParentId
|
* @param interfaceParentId
|
||||||
*/
|
*/
|
||||||
@@ -71,9 +70,8 @@ public class Item {
|
|||||||
/**
|
/**
|
||||||
* Interacts with this item
|
* Interacts with this item
|
||||||
*
|
*
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param i
|
* @param i
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void interact(int i) {
|
public void interact(int i) {
|
||||||
Menu.interact(this, i);
|
Menu.interact(this, i);
|
||||||
@@ -82,19 +80,17 @@ public class Item {
|
|||||||
/**
|
/**
|
||||||
* Interacts with this item
|
* Interacts with this item
|
||||||
*
|
*
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param s
|
* @param s
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void interact(String s) {
|
public void interact(String s) {
|
||||||
Menu.interact(this, s);
|
Menu.interact(this, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param actionIndex
|
* @param actionIndex
|
||||||
* @param interfaceParentId
|
* @param interfaceParentId
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void transform(int actionIndex, int interfaceParentId) {
|
public void transform(int actionIndex, int interfaceParentId) {
|
||||||
Menu.transformItem(this, actionIndex, interfaceParentId);
|
Menu.transformItem(this, actionIndex, interfaceParentId);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.rev317.min.api.wrappers;
|
|||||||
import org.parabot.core.reflect.RefClass;
|
import org.parabot.core.reflect.RefClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Everel
|
* @author Everel, JKetelaar, EmmaStone
|
||||||
*/
|
*/
|
||||||
public class NpcDef {
|
public class NpcDef {
|
||||||
private org.rev317.min.accessors.NpcDef accessor;
|
private org.rev317.min.accessors.NpcDef accessor;
|
||||||
@@ -18,12 +18,25 @@ public class NpcDef {
|
|||||||
* @return id of this item
|
* @return id of this item
|
||||||
*/
|
*/
|
||||||
public int getId() {
|
public int getId() {
|
||||||
if (accessor != null) {
|
try {
|
||||||
return accessor.getId();
|
return (int) getLongId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long getLongId() {
|
||||||
|
if (accessor != null) {
|
||||||
|
if (accessor.getId() < Integer.MAX_VALUE) {
|
||||||
|
return (long) accessor.getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the accessor class
|
* Gets the accessor class
|
||||||
*
|
*
|
||||||
@@ -34,4 +47,3 @@ public class NpcDef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,9 +101,8 @@ public class SceneObject implements Locatable {
|
|||||||
/**
|
/**
|
||||||
* Interacts with this object
|
* Interacts with this object
|
||||||
*
|
*
|
||||||
* @deprecated
|
|
||||||
*
|
|
||||||
* @param actionIndex
|
* @param actionIndex
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void interact(int actionIndex) {
|
public void interact(int actionIndex) {
|
||||||
Menu.interact(this, actionIndex);
|
Menu.interact(this, actionIndex);
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ 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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user