public abstract class QuestHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Map<java.lang.Integer,java.lang.Integer> |
bankItems |
protected static BotController |
bc |
protected static Controller |
c |
protected static java.lang.String |
CURRENT_QUEST_STEP |
protected static boolean |
hasWalkedToStart |
static PaintBuilder |
paintBuilder |
static QuestDef |
quest |
protected static int |
QUEST_STAGE |
static RowBuilder |
rowBuilder |
protected static Location |
START_LOCATION |
protected static int[][] |
STEP_ITEMS |
protected static boolean |
timeToDrinkAntidote |
| Constructor and Description |
|---|
QuestHandler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
atObject(int[] coords)
Does c.atObject command and sleeps until you are moved to the destination, Climbs a ladder or
stairs and sleeps until you are moved to the destination Also Supports going through fixed
(does not stay open) doors
|
static void |
atObject(int x,
int y)
Does c.atObject command and sleeps until you are moved to the destination.
|
static void |
atObject2(int[] coords)
Does c.atObject2 command and sleeps until you are moved to the destination, Climbs a ladder or
stairs and sleeps until you are moved to the destination Also Supports going through a fixed
(does not stay open) doors
|
static void |
atObject2(int x,
int y)
Does c.atObject2 command and sleeps until you are moved to the destination, Climbs a ladder or
stairs and sleeps until you are moved to the destination Also Supports going through fixed
(does not stay open) doors
|
static void |
atObjectSequence(int[][] coords)
Interacts with objects in a given order based on coords.
|
static void |
atWallObject(int[] coords)
Opens a fixed (does not stay open) wall object (c.atWallObject()) and sleeps until you are
moved to the destination
|
static void |
atWallObject(int x,
int y)
Opens a fixed (does not stay open) wall object (c.atWallObject()) and sleeps until you are
moved to the destination
|
static void |
atWallObject2(int[] coords)
Opens a fixed (does not stay open) wall object (c.atWallObject2())and sleeps until you are
moved to the destination
|
static void |
atWallObject2(int x,
int y)
Opens a fixed (does not stay open) wall object (c.atWallObject2())and sleeps until you are
moved to the destination
|
static void |
climb(int[] coords)
Climbs a ladder or stairs and sleeps until you are moved to the destination Also Supports going
through fixed (does not stay open) doors
|
static void |
climb(int x,
int y)
Climbs a ladder or stairs and sleeps until you are moved to the destination
|
static int |
distanceFromTile(int[] coords)
Returns the distance the player is from the specified tile
|
static int |
distanceFromTile(MapPoint mapPoint)
Returns the distance the player is from the specified Map Point
|
static void |
drawPaint()
Draws the quest paint using PaintBuilder.
|
static void |
dropAllButAmount(int itemId,
int amountToKeep)
Drops all of a given item id except one.
|
static void |
followNPCDialog(int npcId,
java.lang.String[] dialogChoices)
Goes through a dialog with the nearest instance of a npc id with dialogChoices[] being the
responses from the character.
|
static void |
followNPCDialogPopUps(int npcId,
java.lang.String[] dialogChoices)
Goes through a dialog with the nearest instance of a npc id with dialogChoices[] being the
responses from the character.
|
static int |
getQuestStage()
If TESTING_QUESTS is false, returns the quest's stage; if not, then it returns TESTING_STAGE
|
static boolean |
hasAtLeastItemAmount(int id,
int amount)
Checks if the player has at least a certain amount of an item id.
|
static boolean |
hasAtLeastItemAmount(ItemId item,
int amount)
Checks if the player has at least a certain amount of an ItemId.
|
static boolean |
hasSkillLevel(SkillId skill,
int requiredLevel)
Checks if the player has the required level of a specified skill.
|
static boolean |
isAtCoords(int x,
int y)
Returns whether the player is at a specific coordinate.
|
static boolean |
isAtLocation(Location location)
Checks if the player is within the boundary of a Location
|
static boolean |
isQuesting()
Returns whether the controller is still running; while handling sleep, afk anti-logout
movement, setting QUEST_STAGE, and doing the initial walk to START_LOCATION.
|
static void |
openShopThenBuy(int[] npcIds,
int[][] buyItems)
Opens the shop for the closest NPC with a given id and buys items from them.
|
static void |
openShopThenSell(int[] npcIds,
int[][] sellItems)
Opens the shop for the closest NPC with a given id and sells items to them.
|
static void |
openShopThenSellAndBuy(int[] npcIds,
int[][] sellItems,
int[][] buyItems)
Opens the shop for the closest NPC with a given id and sells then buys items.
|
static void |
pathWalker(int[] coords)
Ideally, this will eventually be removed in place of walkToward().
|
static void |
pathWalker(int x,
int y)
Ideally, this will eventually be removed in place of walkToward().
|
static void |
pathWalker(MapPoint mapPoint)
Ideally, this will eventually be removed in place of walkToward().
|
static void |
pickupGroundItem(int itemId,
int amount)
Picks up the nearest item matching the given item id.
|
static void |
pickupUnreachableItem(int itemId,
int[] standTile,
int amount)
Walks to specified tile and picks up an item id from an unreachable tile.
|
static void |
quit(QuitReason reason)
Quits the script and prints out a corresponding message.
|
static void |
serverMessageInterrupt(java.lang.String message)
Check if the client receives a server message and do something with it.
|
static void |
sleepUntilQuestStageChanges() |
static void |
startTestingLoop()
Used for testing only
|
static void |
talkToNpcId(int npcId)
Talks to the nearest npc with the given id.
|
static void |
updateBankItems()
Update the bankItems Map from controller.getDebuggerBank().
|
static void |
useItemOnNearestNpcId(int npcId,
int itemId)
Uses an item id on the nearest npc with matching npc id.
|
static void |
walkPath(int[][] path)
Ideally, this will eventually be removed in place of walkToward().
|
static void |
walkPathReverse(int[][] path)
Ideally, this will eventually be removed in place of walkToward().
|
static void |
walkToStartLocation()
Uses WebWalker to walk to the start location.
|
static void |
walkTowards(int x,
int y)
Uses WebWalker to walk to a set of coordinates.
|
static void |
walkTowards(Location location)
Uses WebWalker to walk to a location's standable tile or if null, to the first corner in its
bounds.
|
protected static final Controller c
protected static final BotController bc
public static PaintBuilder paintBuilder
public static RowBuilder rowBuilder
public static QuestDef quest
public static java.util.Map<java.lang.Integer,java.lang.Integer> bankItems
protected static boolean timeToDrinkAntidote
protected static boolean hasWalkedToStart
protected static java.lang.String CURRENT_QUEST_STEP
protected static int QUEST_STAGE
protected static int[][] STEP_ITEMS
protected static Location START_LOCATION
public static void startTestingLoop()
public static void walkToStartLocation()
public static void walkTowards(Location location)
location - - Location to walk topublic static void walkTowards(int x,
int y)
x - - X coordinate to walk toy - - y coordinate to walk topublic static boolean hasAtLeastItemAmount(int id,
int amount)
id - int -- The item id to checkamount - int -- The amount to check forpublic static boolean hasAtLeastItemAmount(ItemId item, int amount)
item - ItemId -- The ItemId to checkamount - int -- The amount to check forpublic static boolean hasSkillLevel(SkillId skill, int requiredLevel)
skill - SkillId -- SkillId enum valuerequiredLevel - int -- Level required for the skillpublic static boolean isAtLocation(Location location)
location - Location to checkpublic static boolean isAtCoords(int x,
int y)
x - int - X coordinate to checky - int - Y coordinate to checkpublic static boolean isQuesting()
public static void dropAllButAmount(int itemId,
int amountToKeep)
itemId - int -- Id of the item to dropamountToKeep - int -- Amount of item to keeppublic static void openShopThenSell(int[] npcIds,
int[][] sellItems)
npcIds - int[] -- Ids of npcs to look forsellItems - int[][] -- ItemId/amount pairs. Example: {{SILK_ID, 1}, {EGG_ID, 12}}public static void openShopThenBuy(int[] npcIds,
int[][] buyItems)
npcIds - int[] -- Ids of npcs to look forbuyItems - int[][] -- ItemId/amount pairs. Example: {{SILK_ID, 1}, {EGG_ID, 12}}public static void openShopThenSellAndBuy(int[] npcIds,
int[][] sellItems,
int[][] buyItems)
npcIds - int[] -- Ids of npcs to look forsellItems - int[][] -- ItemId/amount pairs. Example: {{SILK_ID, 1}, {EGG_ID, 12}}buyItems - int[][] -- ItemId/amount pairs. Example: {{SILK_ID, 1}, {EGG_ID, 12}}public static void pickupUnreachableItem(int itemId,
int[] standTile,
int amount)
itemId - int -- Id of the item to pick upstandTile - int[] -- Tile to stand at to pick up itemamount - int -- The amount to pick uppublic static void pickupGroundItem(int itemId,
int amount)
itemId - int -- Id of the item to pick upamount - int -- The amount to pick uppublic static void useItemOnNearestNpcId(int npcId,
int itemId)
npcId - int -- Id of npc, not server indexitemId - int -- Id of the item to use on the npcpublic static void talkToNpcId(int npcId)
npcId - int -- Id of the npc to talk topublic static void followNPCDialogPopUps(int npcId,
java.lang.String[] dialogChoices)
This method is for pop up quest dialog after interacting with an object
npcId - int -- Id of the npc to talk todialogChoices - String[] -- Responses to dialogspublic static void followNPCDialog(int npcId,
java.lang.String[] dialogChoices)
npcId - int -- Id of the npc to talk todialogChoices - String[] -- Responses to dialogspublic static void sleepUntilQuestStageChanges()
public static void pathWalker(MapPoint mapPoint)
mapPoint - MapPoint -- Coordinates of the tile to walk topublic static void pathWalker(int[] coords)
coords - int[] -- Coordinates of the tile to walk topublic static void pathWalker(int x,
int y)
x - int -- X coordinate of the tile to walk toy - int -- Y coordinate of the tile to walk topublic static void walkPath(int[][] path)
path - - Int[][] -- Each index is a different tile. Either {{X, Y}, {X2, Y2}} or
{TILE1[],TILE2[]}public static void walkPathReverse(int[][] path)
path - - Int[][] -- Each index is a different tile. Either {{X, Y}, {X2, Y2}} or {TILE1[],
TILE2[]}public static int distanceFromTile(int[] coords)
coords - int[] -- Coordinates to specified tilepublic static int distanceFromTile(MapPoint mapPoint)
mapPoint - MapPoint -- MapPoint to checkpublic static void atObject(int[] coords)
*Requires the object moving your coordinates*
coords - int[] -- Coordinates of an objectpublic static void atObject2(int[] coords)
*Requires the object moving your coordinates*
coords - int[] -- Coordinates of an objectpublic static void atObject(int x,
int y)
*Requires the object moving your coordinates*
x - int x coordinate of the objecty - int y coordinate of the objectpublic static void atObject2(int x,
int y)
*Requires the object moving your coordinates*
x - int x coordinate of the objecty - int y coordinate of the objectpublic static void atWallObject(int[] coords)
*Requires the object moving your coordinates*
coords - int[] -- Coordinates of a wall objectpublic static void atWallObject2(int[] coords)
*Requires the object moving your coordinates*
coords - int[] -- Coordinates of a wall objectpublic static void atWallObject(int x,
int y)
*Requires the object moving your coordinates*
x - int x coordinate of the objecty - int y coordinate of the objectpublic static void atWallObject2(int x,
int y)
*Requires the object moving your coordinates*
x - int x coordinate of the objecty - int y coordinate of the objectpublic static void climb(int[] coords)
coords - int[] -- Coordinates of a climbable objectpublic static void climb(int x,
int y)
x - int -- X coordinate of a climbable objecty - int -- Y coordinate of a climbable objectpublic static void atObjectSequence(int[][] coords)
coords - - Int[][] -- Each index is a different Object's tile coordinates. Either {{X, Y},
{X2, Y2}} or {TILE1[], TILE2[]}public static int getQuestStage()
public static void updateBankItems()
public static void quit(QuitReason reason)
reason - QuestReason - Reason to quitpublic static void serverMessageInterrupt(java.lang.String message)
message - String - Message to check forpublic static void drawPaint()