├── .gitignore ├── src └── main │ └── java │ └── org │ └── dreambot │ ├── paint │ └── PaintInfo.java │ ├── framework │ ├── Leaf.java │ ├── Root.java │ ├── fallback │ │ └── FallbackLeaf.java │ ├── timeout │ │ └── TimeoutLeaf.java │ ├── Tree.java │ ├── webnodes │ │ ├── RemoveDraynorJailNodesLeaf.java │ │ └── RemoveWizardWebnodesLeaf.java │ ├── Branch.java │ ├── bank │ │ └── BankOnceLeaf.java │ └── unbankables │ │ └── UnbankableItemsLeaf.java │ ├── utilities │ ├── helpers │ │ ├── commonitemshelper │ │ │ ├── CommonItemsHelper.java │ │ │ ├── SpadeHelper.java │ │ │ ├── PinkSkirtHelper.java │ │ │ ├── BucketHelper.java │ │ │ ├── BucketOfWaterHelper.java │ │ │ ├── BeerHelper.java │ │ │ ├── WoadLeafHelper.java │ │ │ ├── RopeHelper.java │ │ │ ├── OnionHelper.java │ │ │ ├── RedDyeHelper.java │ │ │ ├── BlueDyeHelper.java │ │ │ └── RedBerryHelper.java │ │ ├── DialogueHelper.java │ │ ├── BankHelper.java │ │ └── ShopHelper.java │ ├── QuestManifest.java │ ├── API.java │ ├── requirements │ │ ├── ItemRequirement.java │ │ └── CheckRequirements.java │ ├── loadouts │ │ ├── LoadoutItem.java │ │ ├── Loadout.java │ │ └── EquipmentItem.java │ └── OwnedItems.java │ └── quests │ ├── freequests │ ├── demonslayer │ │ ├── DemonSlayer.java │ │ ├── RetrieveDemonSlayerCoinsLeaf.java │ │ ├── TalkToSirPrysinLeaf.java │ │ ├── RetrieveBucketLeaf.java │ │ ├── TalkToWizardTraibornLeaf.java │ │ ├── RetrieveSecondKeyLeaf.java │ │ ├── TalkToArisLeaf.java │ │ ├── KillGoblinsLeaf.java │ │ └── TalkToCaptainRovinLeaf.java │ ├── piratestreasure │ │ ├── smugglerum │ │ │ ├── SmuggleRumBranch.java │ │ │ ├── PauseForCutsceneLeaf.java │ │ │ ├── chatmsg │ │ │ │ ├── SeeFullBananasCrateLeaf.java │ │ │ │ ├── SeeStashedRumLeaf.java │ │ │ │ ├── SeeRumNoBananasLeaf.java │ │ │ │ └── SeeCrateSentLeaf.java │ │ │ ├── RetrieveRumLeaf.java │ │ │ ├── RetrieveBananaLeaf.java │ │ │ ├── LeaveKaramjaLeaf.java │ │ │ ├── SmuggleState.java │ │ │ ├── RetrieveSmuggledRumLeaf.java │ │ │ ├── RetrieveWhiteApronLeaf.java │ │ │ ├── FillCrateWithBananasLeaf.java │ │ │ └── EnterStoreBackhouseLeaf.java │ │ ├── PiratesTreasure.java │ │ ├── RetrieveSpadePiratesTreasureLeaf.java │ │ ├── RetrievePiratesTreasureCoinsLeaf.java │ │ └── TalkToRedbeardFrankLeaf.java │ ├── thecorsaircurse │ │ ├── cursepuzzle │ │ │ ├── SolveCurseBranch.java │ │ │ ├── TalkToIthoiLeaf.java │ │ │ ├── TalkToArsenLeaf.java │ │ │ ├── TalkToColinLeaf.java │ │ │ ├── TalkToGnocciLeaf.java │ │ │ ├── TalkToTockCorsair1Leaf.java │ │ │ ├── RetrieveSpadeCorsairCurseLeaf.java │ │ │ ├── ObserveIthoiTelescopeLeaf.java │ │ │ └── CurseState.java │ │ ├── TheCorsairCurse.java │ │ ├── KillIthoiLeaf.java │ │ ├── PauseForCorsairCurseCutsceneLeaf.java │ │ ├── TalkToTockRimmingtonLeaf.java │ │ ├── TalkToTockCorsair4Leaf.java │ │ ├── SolveArsenFoodMystery.java │ │ ├── SolveGnocciFoodMysteryLeaf.java │ │ ├── TalkToTockCorsair3Leaf.java │ │ ├── TalkToTockCorsair2Leaf.java │ │ ├── TalkToTockFarmLeaf.java │ │ ├── SolveIthoiFoodMysteryLeaf.java │ │ ├── RetrieveTinderboxCorsairCurseLeaf.java │ │ └── BurnIthoiLeaf.java │ ├── impcatcher │ │ ├── ImpCatcher.java │ │ └── GiveBeadsLeaf.java │ ├── doricsquest │ │ ├── DoricsQuest.java │ │ ├── RetrievePickaxeLeaf.java │ │ ├── TalkToDoricLeaf.java │ │ ├── RetrieveIronLeaf.java │ │ ├── RetrieveClayLeaf.java │ │ └── RetrieveCopperLeaf.java │ ├── runemysteries │ │ ├── RuneMysteries.java │ │ ├── TalkToLumbridgeDukeLeaf.java │ │ ├── TalkToAuburyLeaf.java │ │ └── TalkToArchmageLeaf.java │ ├── sheepshearer │ │ ├── SheepShearer.java │ │ └── TalkToFredLeaf.java │ ├── vampyreslayer │ │ ├── VampyreSlayer.java │ │ ├── RetrieveCoinsLeaf.java │ │ ├── RetrieveOwnedStakeLeaf.java │ │ ├── TalkToMorganLeaf.java │ │ ├── TalkToDrHarlowLeaf.java │ │ ├── TalkToBartenderLeaf.java │ │ └── RetrieveHammerLeaf.java │ ├── witchspotion │ │ ├── WitchsPotion.java │ │ ├── EngageBoosterThrusters.java │ │ ├── TalkToWitchLeaf.java │ │ ├── RetrieveOnion.java │ │ └── DrinkFromCauldronLeaf.java │ ├── xmarksthespot │ │ ├── XMarksTheSpot.java │ │ ├── RetrieveSpadeXMarksTheSpotLeaf.java │ │ ├── TalkToVeosSarimLeaf.java │ │ ├── ClueStepFourLeaf.java │ │ ├── ClueStepOneLeaf.java │ │ ├── ClueStepThreeLeaf.java │ │ ├── ClueStepTwoLeaf.java │ │ └── TalkToVeosLumbridgeLeaf.java │ ├── cooksassistant │ │ ├── CooksAssistant.java │ │ ├── obtainflour │ │ │ ├── RetrievePotOfFlourBranch.java │ │ │ ├── RetrievePotLeaf.java │ │ │ └── RetrieveGrainLeaf.java │ │ ├── RetrieveEggLeaf.java │ │ ├── TalkToCookLeaf.java │ │ └── RetrieveBucketOfMilkLeaf.java │ ├── goblindiplomacy │ │ ├── GoblinDiplomacy.java │ │ ├── RetrieveRedDyeLeaf.java │ │ ├── RetrieveYellowDyeLeaf.java │ │ ├── MixDyeLeaf.java │ │ ├── MixBlueGoblinMailLeaf.java │ │ ├── MixOrangeGoblinMailLeaf.java │ │ ├── RetrieveBlueDyeLeaf.java │ │ ├── retrieveitems │ │ │ ├── RetrieveOnionLeaf.java │ │ │ ├── RetrieveRedBerryLeaf.java │ │ │ ├── RetrieveWoadLeavesLeaf.java │ │ │ └── RetrieveGoblinMailLeaf.java │ │ └── TalkToGeneralWartfaceLeaf.java │ ├── romeoandjuliet │ │ ├── RomeoAndJuliet.java │ │ ├── TalkToFatherLawrenceLeaf.java │ │ ├── TalkToRomeoLeaf.java │ │ └── TalkToJulietLeaf.java │ ├── therestlessghost │ │ ├── TheRestlessGhost.java │ │ ├── TalkToFatherAereckLeaf.java │ │ ├── TalkToFatherUrhneyLeaf.java │ │ ├── RetrieveGhostHeadLeaf.java │ │ └── ReturnSkullToGhostLeaf.java │ ├── blackknightsfortress │ │ ├── BlackKnightsFortress.java │ │ ├── RetrieveCoinsLeaf.java │ │ ├── RetrieveIronChainbodyLeaf.java │ │ ├── RetrieveCabbageLeaf.java │ │ ├── RetrieveBronzeMedHelmLeaf.java │ │ ├── TalkToSirAmikVarzeLeaf.java │ │ ├── GoToFortressLeaf.java │ │ └── EnterFortressLeaf.java │ └── shieldofarrav │ │ └── blackarmgang │ │ ├── TalkToCharlieLeaf.java │ │ └── TalkToKatrineLeaf.java │ ├── paidquests │ ├── monksfriend │ │ ├── MonksFriend.java │ │ └── TalkToBrotherOmadLeaf.java │ ├── gertrudescat │ │ ├── GertrudesCat.java │ │ ├── RetrieveCoinsLeaf.java │ │ ├── TalkToWiloughLeaf.java │ │ ├── RetrieveRawSardineLeaf.java │ │ ├── RetrieveDoogleLeavesLeaf.java │ │ ├── MixSardineAndDoogleLeavesLeaf.java │ │ ├── GiveMilkToCatLeaf.java │ │ ├── GiveKittenToFluffsLeaf.java │ │ └── GiveSeasonedSardineToCatLeaf.java │ ├── junglepotion │ │ ├── JunglePotion.java │ │ ├── RetrieveSiteFoilLeaf.java │ │ ├── RetrieveAdrigalLeaf.java │ │ ├── RetrieveSnakeWeedLeaf.java │ │ ├── RetrieveVolenciaMossLeaf.java │ │ ├── RetrieveRoguesPurseLeaf.java │ │ └── TalkToTrufitusLeaf.java │ ├── druidicritual │ │ ├── DruidicRitual.java │ │ ├── TalkToKaqemeexLeaf.java │ │ ├── TalkToSanfewLeaf.java │ │ ├── RetrieveChickenMeatLeaf.java │ │ ├── RetrieveCowMeatLeaf.java │ │ ├── RetrieveRatMeatLeaf.java │ │ └── RetrieveBearMeatLeaf.java │ └── clocktower │ │ ├── placecogs │ │ ├── CogState.java │ │ ├── DropExtraCogsLeaf.java │ │ ├── RetrieveRedCogLeaf.java │ │ └── SeeCogPlacedOnSpindleLeaf.java │ │ ├── TalkToBrotherKojoLeaf.java │ │ └── ClockTower.java │ └── miniquests │ └── alfredgrimhandsbarcrawl │ ├── AlfredGrimhandsBarcrawl.java │ ├── SeeAllFinishedMessage.java │ ├── WithdrawFromBankAlfredGrimhandsBarcrawlLeaf.java │ ├── SeeBartenderMessageLeaf.java │ └── TalkToBarbarianGuardsLeaf.java ├── CONTRIBUTING.md ├── .github └── workflows │ └── formatter.yml ├── DreamBotQuester.iml └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/paint/PaintInfo.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.paint; 2 | 3 | public interface PaintInfo { 4 | String[] getPaintInfo(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/Leaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework; 2 | 3 | public abstract class Leaf { 4 | public abstract boolean isValid(); 5 | 6 | public abstract int onLoop(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/Root.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework; 2 | 3 | public class Root extends Branch { 4 | @Override 5 | public boolean isValid() { 6 | return true; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/CommonItemsHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | public interface CommonItemsHelper { 4 | int getItem(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/QuestManifest.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface QuestManifest { 11 | String author(); 12 | 13 | String questName(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/DemonSlayer.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class DemonSlayer extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return CheckRequirements.checkRequirements(FreeQuest.DEMON_SLAYER); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/monksfriend/MonksFriend.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.monksfriend; 2 | 3 | import org.dreambot.api.methods.quest.book.PaidQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class MonksFriend extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return CheckRequirements.checkRequirements(PaidQuest.MONKS_FRIEND); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/GertrudesCat.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.quest.book.PaidQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class GertrudesCat extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return CheckRequirements.checkRequirements(PaidQuest.GERTRUDES_CAT); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/JunglePotion.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.quest.book.PaidQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class JunglePotion extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return CheckRequirements.checkRequirements(PaidQuest.JUNGLE_POTION); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/DruidicRitual.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.quest.book.PaidQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class DruidicRitual extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return CheckRequirements.checkRequirements(PaidQuest.DRUIDIC_RITUAL); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/fallback/FallbackLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.fallback; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.utilities.Timing; 5 | 6 | public class FallbackLeaf extends Leaf { 7 | 8 | @Override 9 | public boolean isValid() { 10 | return true; 11 | } 12 | 13 | @Override 14 | public int onLoop() { 15 | // By calling Timing.loopReturn() we set a net tickTimeout and wait one tick. 16 | return Timing.loopReturn(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/placecogs/CogState.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower.placecogs; 2 | 3 | public class CogState { 4 | public static boolean placedRedCog = false; 5 | public static boolean placedBlackCog = false; 6 | public static boolean placedWhiteCog = false; 7 | public static boolean placedBlueCog = false; 8 | 9 | public static boolean finished() { 10 | return placedBlackCog && placedBlueCog && placedRedCog && placedWhiteCog; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/SpadeHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Tile; 4 | import org.dreambot.utilities.helpers.GroundItemHelper; 5 | 6 | public class SpadeHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | final Tile FALADOR_SPADE_TILE = new Tile(2981, 3370, 0); 10 | return GroundItemHelper.pickupGroundSpawn(FALADOR_SPADE_TILE, "Spade"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/PinkSkirtHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.ShopHelper; 5 | 6 | public class PinkSkirtHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | Area THESSALIA_AREA = new Area(3201, 3420, 3209, 3410); 10 | return ShopHelper.purchaseFromShop(THESSALIA_AREA, "Pink skirt", 1, "Thessalia"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/SmuggleRumBranch.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.api.methods.settings.PlayerSettings; 5 | import org.dreambot.framework.Branch; 6 | 7 | public class SmuggleRumBranch extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 1; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/SolveCurseBranch.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.api.methods.settings.PlayerSettings; 5 | import org.dreambot.framework.Branch; 6 | 7 | public class SolveCurseBranch extends Branch { 8 | @Override 9 | public boolean isValid() { 10 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 15; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/BucketHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.ShopHelper; 5 | 6 | public class BucketHelper implements CommonItemsHelper { 7 | 8 | @Override 9 | public int getItem() { 10 | Area LUMBRIDGE_GENERAL_STORE_AREA = new Area(3206, 3252, 3215, 3241); 11 | return ShopHelper.purchaseFromShop(LUMBRIDGE_GENERAL_STORE_AREA, "Bucket", 1, "Shop keeper"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/API.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities; 2 | 3 | import org.dreambot.api.methods.map.Tile; 4 | 5 | public class API { 6 | 7 | public static QuestBranches selectedQuest; 8 | public static int questVarPlayer = 0; 9 | public static int questVarBit = 10 | 0; // represents either VarBit if true, or VarPlayer (config) if false 11 | public static String currentBranch = ""; 12 | public static String currentLeaf = ""; 13 | public static String lastGameMessage = ""; 14 | public static Tile lastGameMessageTile = null; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/BucketOfWaterHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.GameObjectHelper; 5 | 6 | public class BucketOfWaterHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | Area LUMBRIDGE_FOUNTAIN_AREA = new Area(3219, 3229, 3224, 3224); 10 | GameObjectHelper.goAndUseItemOnGameObject(LUMBRIDGE_FOUNTAIN_AREA, "Bucket", "Fountain"); 11 | return 0; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/impcatcher/ImpCatcher.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.impcatcher; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Imp catcher") 9 | public class ImpCatcher extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.IMP_CATCHER); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/BeerHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.NPCHelper; 5 | 6 | public class BeerHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | final Area BARTENDER_AREA = new Area(3216, 3404, 3227, 3392); 10 | final String[] DIALOGUE_OPTIONS = {"A glass of your finest ale please."}; 11 | return NPCHelper.goAndTalkToNpc(BARTENDER_AREA, "Bartender", DIALOGUE_OPTIONS); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/DoricsQuest.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "Doric's quest") 9 | public class DoricsQuest extends Branch { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return CheckRequirements.checkRequirements(FreeQuest.DORICS_QUEST); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/runemysteries/RuneMysteries.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.runemysteries; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Rune mysteries") 9 | public class RuneMysteries extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.RUNE_MYSTERIES); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/sheepshearer/SheepShearer.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.sheepshearer; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Sheep shearer") 9 | public class SheepShearer extends Branch { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return CheckRequirements.checkRequirements(FreeQuest.SHEEP_SHEARER); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/VampyreSlayer.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Vampyre slayer") 9 | public class VampyreSlayer extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.VAMPIRE_SLAYER); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/witchspotion/WitchsPotion.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.witchspotion; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "Witch's potion") 9 | public class WitchsPotion extends Branch { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return CheckRequirements.checkRequirements(FreeQuest.WITCHS_POTION); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TheCorsairCurse.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "Corsair curse") 9 | public class TheCorsairCurse extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.CORSAIR_CURSE); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/XMarksTheSpot.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "X marks the spot") 9 | public class XMarksTheSpot extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.X_MARKS_THE_SPOT); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/CooksAssistant.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "Cook's assistant") 9 | public class CooksAssistant extends Branch { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return CheckRequirements.checkRequirements(FreeQuest.COOKS_ASSISTANT); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/GoblinDiplomacy.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Goblin diplomacy") 9 | public class GoblinDiplomacy extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.GOBLIN_DIPLOMACY); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/PiratesTreasure.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "Pirate's treasure") 9 | public class PiratesTreasure extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.PIRATES_TREASURE); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/romeoandjuliet/RomeoAndJuliet.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.romeoandjuliet; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Romeo and juliet") 9 | public class RomeoAndJuliet extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.ROMEO_AND_JULIET); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/therestlessghost/TheRestlessGhost.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.therestlessghost; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "420", questName = "The restless ghost") 9 | public class TheRestlessGhost extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.THE_RESTLESS_GHOST); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/WoadLeafHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.NPCHelper; 5 | 6 | public class WoadLeafHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | final Area WYSON_AREA = new Area(3024, 3383, 3029, 3375); 10 | final String[] DIALOGUE_OPTIONS = {"Yes please, I need woad leaves.", "How about 20 coins?"}; 11 | return NPCHelper.goAndTalkToNpc(WYSON_AREA, "Wyson the gardener", DIALOGUE_OPTIONS); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/RopeHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.NPCHelper; 5 | 6 | public class RopeHelper implements CommonItemsHelper { 7 | 8 | @Override 9 | public int getItem() { 10 | Area NED_AREA = new Area(3096, 3261, 3101, 3256); 11 | final String[] DIALOGUE_OPTIONS = { 12 | "Yes, I would like some rope.", "Okay, please sell me some rope." 13 | }; 14 | 15 | return NPCHelper.goAndTalkToNpc(NED_AREA, "Ned", DIALOGUE_OPTIONS); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/miniquests/alfredgrimhandsbarcrawl/AlfredGrimhandsBarcrawl.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.miniquests.alfredgrimhandsbarcrawl; 2 | 3 | import org.dreambot.api.methods.quest.book.MiniQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.requirements.CheckRequirements; 6 | 7 | public class AlfredGrimhandsBarcrawl extends Branch { 8 | public static boolean finishedCard = false; 9 | public static boolean checkedCard = false; 10 | 11 | @Override 12 | public boolean isValid() { 13 | return CheckRequirements.checkRequirements(MiniQuest.ALFRED_GRIMHANDS_BARCRAWL); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/BlackKnightsFortress.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.quest.book.FreeQuest; 4 | import org.dreambot.framework.Branch; 5 | import org.dreambot.utilities.QuestManifest; 6 | import org.dreambot.utilities.requirements.CheckRequirements; 7 | 8 | @QuestManifest(author = "Sinan", questName = "Black Knight's Fortress") 9 | public class BlackKnightsFortress extends Branch { 10 | @Override 11 | public boolean isValid() { 12 | return CheckRequirements.checkRequirements(FreeQuest.BLACK_KNIGHTS_FORTRESS); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/RetrieveCoinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.OwnedItems; 6 | import org.dreambot.utilities.helpers.BankHelper; 7 | 8 | public class RetrieveCoinsLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return Inventory.count("Coins") < 50 && !OwnedItems.contains("Hammer"); 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | return BankHelper.withdrawFromBank("Coins", 100); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/RetrieveOwnedStakeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.OwnedItems; 6 | import org.dreambot.utilities.helpers.BankHelper; 7 | 8 | public class RetrieveOwnedStakeLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return OwnedItems.contains("Stake") && !Inventory.contains("Stake"); 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | return BankHelper.withdrawFromBank("Stake", 1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to DreamBotQuester 2 | 3 | We welcome contributions to DreamBotQuester! If you have an idea for a new feature or have found a bug that you'd like 4 | to fix, we encourage you to submit a pull request. 5 | 6 | ## Submitting a Pull Request 7 | 8 | 1. Fork the repository and create a new branch for your changes. 9 | 2. Make your changes and commit them to your branch. 10 | 3. Push your branch to your fork and submit a pull request. 11 | 4. The DreamBotQuester maintainers will review your changes and provide feedback. 12 | 5. If your changes are accepted, they will be merged into the main repository. 13 | 14 | Thank you for your contribution! -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/timeout/TimeoutLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.timeout; 2 | 3 | import org.dreambot.api.utilities.Sleep; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.Timing; 6 | 7 | public class TimeoutLeaf extends Leaf { 8 | 9 | // If this leaf is called, that means that there is currently a tick timeout 10 | @Override 11 | public boolean isValid() { 12 | return Timing.tickTimeout > 0; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | // Decrement the tick timeout by one and wait for exactly one tick 18 | Timing.tickTimeout--; 19 | Sleep.sleepTick(); 20 | return 60; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/PauseForCutsceneLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.Client; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.Timing; 6 | 7 | public class PauseForCutsceneLeaf extends Leaf { 8 | 9 | /** 10 | * Pause for cutscene during Pirate's Treasure (karamja boat), do nothing. 11 | * @return 12 | */ 13 | @Override 14 | public boolean isValid() { 15 | return Client.isInCutscene() || Client.isDynamicRegion(); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | return Timing.loopReturn(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/OnionHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.utilities.helpers.GameObjectHelper; 6 | 7 | public class OnionHelper implements CommonItemsHelper { 8 | @Override 9 | public int getItem() { 10 | final Area ONION_AREA = new Area(3186, 3269, 3191, 3265); 11 | final int count = Inventory.count("Onion") + 1; 12 | return GameObjectHelper.goAndInteractWithGameObject( 13 | ONION_AREA, "Onion", "Pick", () -> Inventory.count("Onion") != count); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/RedDyeHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.NPCHelper; 5 | 6 | public class RedDyeHelper implements CommonItemsHelper { 7 | @Override 8 | public int getItem() { 9 | Area AGGIE_AREA = new Area(3083, 3261, 3088, 3256); 10 | final String[] DIALOGUE_OPTIONS = { 11 | "Can you make dyes for me please?", 12 | "What do you need to make red dye?", 13 | "Okay, make me some red dye please." 14 | }; 15 | return NPCHelper.goAndTalkToNpc(AGGIE_AREA, "Aggie", DIALOGUE_OPTIONS); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/formatter.yml: -------------------------------------------------------------------------------- 1 | name: Google java formatter 2 | 3 | on: 4 | push: 5 | paths: 6 | - "**/*.java" 7 | pull_request: 8 | paths: 9 | - "**/*.java" 10 | 11 | jobs: 12 | format: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout codebase 17 | uses: actions/checkout@v2 18 | 19 | - name: Setup java environment 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: "11" 23 | 24 | - name: Setup code formatter 25 | uses: axel-op/googlejavaformat-action@v3 26 | with: 27 | args: "--skip-javadoc-formatting --replace" 28 | commitMessage: "Format: Google java formatter" 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/TalkToIthoiLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.helpers.NPCHelper; 6 | 7 | public class TalkToIthoiLeaf extends Leaf { 8 | 9 | @Override 10 | public boolean isValid() { 11 | return !CurseState.talkedToIthoi(); 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | final Area ITHOI_AREA = new Area(2527, 2841, 2532, 2835, 1); 17 | return NPCHelper.goAndTalkToNpc( 18 | ITHOI_AREA, "Ithoi the Navigator", new String[] {"I hear you've been cursed."}); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/BlueDyeHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.utilities.helpers.NPCHelper; 5 | // Helper for beer item 6 | 7 | public class BlueDyeHelper implements CommonItemsHelper { 8 | @Override 9 | public int getItem() { 10 | Area AGGIE_AREA = new Area(3083, 3261, 3088, 3256); 11 | final String[] DIALOGUE_OPTIONS = { 12 | "Can you make dyes for me please?", 13 | "What do you need to make blue dye?", 14 | "Okay, make me some blue dye please." 15 | }; 16 | return NPCHelper.goAndTalkToNpc(AGGIE_AREA, "Aggie", DIALOGUE_OPTIONS); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/miniquests/alfredgrimhandsbarcrawl/SeeAllFinishedMessage.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.miniquests.alfredgrimhandsbarcrawl; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.utilities.API; 5 | import org.dreambot.utilities.Timing; 6 | 7 | public class SeeAllFinishedMessage extends Leaf { 8 | 9 | @Override 10 | public boolean isValid() { 11 | return API.lastGameMessage.contains("You are too drunk to be able to read the barcrawl card."); 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | AlfredGrimhandsBarcrawl.finishedCard = true; 17 | API.lastGameMessage = ""; 18 | API.lastGameMessageTile = null; 19 | return Timing.loopReturn(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/Tree.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | public class Tree { 7 | private final Root root; 8 | 9 | public Tree() { 10 | root = new Root(); 11 | } 12 | 13 | public Leaf addBranches(Leaf... leaves) { 14 | root.addLeafs(leaves); 15 | return root; 16 | } 17 | 18 | public void clear() { 19 | root.children.clear(); 20 | } 21 | 22 | public List getActiveBranches() { 23 | return root.children.stream() 24 | .map(tLeaf -> tLeaf.getClass().getSimpleName()) 25 | .collect(Collectors.toList()); 26 | } 27 | 28 | public int onLoop() { 29 | return root.onLoop(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/obtainflour/RetrievePotOfFlourBranch.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant.obtainflour; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Branch; 7 | 8 | public class RetrievePotOfFlourBranch extends Branch { 9 | @Override 10 | public boolean isValid() { 11 | return (PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 0 12 | || PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 1) 13 | && !Inventory.contains("Pot of flour"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/KillIthoiLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class KillIthoiLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 52; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndKillNpc(new Area(2527, 2841, 2532, 2835, 1), "Ithoi the Navigator"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/witchspotion/EngageBoosterThrusters.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.witchspotion; 2 | 3 | import org.dreambot.api.methods.interactive.Players; 4 | import org.dreambot.api.methods.walking.impl.Walking; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class EngageBoosterThrusters extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return Players.getLocal().isInCombat() 13 | && Walking.getRunEnergy() >= 2 14 | && !Walking.isRunEnabled(); 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | Timing.sleepForDelay(); 20 | Walking.toggleRun(); 21 | return Timing.loopReturn(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/commonitemshelper/RedBerryHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers.commonitemshelper; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.utilities.helpers.GameObjectHelper; 6 | 7 | public class RedBerryHelper implements CommonItemsHelper { 8 | @Override 9 | public int getItem() { 10 | final Area RED_BERRY_BUSH_AREA = new Area(3266, 3375, 3279, 3365); 11 | final int count = Inventory.count("Redberries"); 12 | return GameObjectHelper.goAndInteractWithGameObject( 13 | RED_BERRY_BUSH_AREA, 14 | "Redberry bush", 15 | "Pick-from", 16 | () -> Inventory.count("Redberries") != count); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/RetrieveCoinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.quest.book.PaidQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.BankHelper; 8 | 9 | public class RetrieveCoinsLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 0 13 | && Inventory.count("Coins") < 500; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return BankHelper.withdrawFromBank("Coins", 10000); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/placecogs/DropExtraCogsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower.placecogs; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class DropExtraCogsLeaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return API.lastGameMessage.contains("The cogs are too heavy to carry more than one at a time."); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | Inventory.dropAll(i -> i.getName().endsWith(" cog")); 18 | API.lastGameMessageTile = null; 19 | API.lastGameMessage = ""; 20 | return Timing.getSleepDelay(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/RetrieveCoinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.BankHelper; 8 | 9 | public class RetrieveCoinsLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 0 13 | && Inventory.count("Coins") <= 300; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return BankHelper.withdrawFromBank("Coins", 1000); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/PauseForCorsairCurseCutsceneLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.Client; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class PauseForCorsairCurseCutsceneLeaf extends Leaf { 9 | 10 | /** 11 | * Pause for cutscene during Corsair Curse, do nothing. 12 | */ 13 | @Override 14 | public boolean isValid() { 15 | return Client.isInCutscene(); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | if (Dialogues.canContinue()) { 21 | Timing.sleepForDelay(); 22 | Dialogues.continueDialogue(); 23 | } 24 | return Timing.loopReturn(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DreamBotQuester.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/requirements/ItemRequirement.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.requirements; 2 | 3 | import org.dreambot.api.data.requirements.Requirement; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | 6 | public class ItemRequirement extends Requirement { 7 | @Override 8 | public boolean meetsRequirement() { 9 | return Inventory.count(this.itemName) >= this.itemQuantity; 10 | } 11 | 12 | private String itemName; 13 | private int itemQuantity; 14 | 15 | public ItemRequirement(String itemName, int itemQuantity) { 16 | this.itemName = itemName; 17 | this.itemQuantity = itemQuantity; 18 | } 19 | 20 | public int getItemQuantity() { 21 | return this.itemQuantity; 22 | } 23 | 24 | public String getItemName() { 25 | return this.itemName; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/chatmsg/SeeFullBananasCrateLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum.chatmsg; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeFullBananasCrateLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return API.lastGameMessage.contains("The crate is full of bananas.") 12 | || API.lastGameMessage.contains("The crate is already full."); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | SmuggleState.filledCrateWithBananas = true; 18 | API.lastGameMessage = ""; 19 | return Timing.getSleepDelay(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/chatmsg/SeeStashedRumLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum.chatmsg; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeStashedRumLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return API.lastGameMessage.contains("There is also some rum stashed in here too.") 12 | || API.lastGameMessage.contains("There's already some rum in here..."); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | SmuggleState.stashedRum = true; 18 | API.lastGameMessage = ""; 19 | return Timing.getSleepDelay(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TalkToTockRimmingtonLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToTockRimmingtonLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 10; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndTalkToNpc( 18 | new Area(2906, 3227, 2915, 3225, 0), 19 | "Captain Tock", 20 | new String[] {"Okay, I'm ready go to Corsair Cove."}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/TalkToWiloughLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.PaidQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToWiloughLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 1; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndTalkToNpc( 18 | new Area(3213, 3437, 3223, 3429), // wilough area 19 | "Wilough", 20 | new String[] {"What will make you tell me?", "Okay then, I'll pay."}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/TalkToMorganLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToMorganLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.VAMPIRE_SLAYER.getConfigID()) == 0; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | final Area MORGAN_AREA = new Area(3096, 3270, 3102, 3266); 19 | final String[] DIALOGUE_OPTIONS = {"Yes."}; 20 | 21 | return NPCHelper.goAndTalkToNpc(MORGAN_AREA, "Morgan", DIALOGUE_OPTIONS); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/RetrieveDemonSlayerCoinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.BankHelper; 8 | 9 | /** 10 | * This class withdraws 100 coins from the bank. 11 | */ 12 | public class RetrieveDemonSlayerCoinsLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 0 17 | && !Inventory.contains("Coins"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | return BankHelper.withdrawFromBank("Coins", 100); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TalkToTockCorsair4Leaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToTockCorsair4Leaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 55; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return NPCHelper.goAndTalkToNpc( 19 | new Area(2573, 2837, 2583, 2835, 1), 20 | "Captain Tock", 21 | new String[] {"I've killed Ithoi for poisoning your crew."}); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/chatmsg/SeeRumNoBananasLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum.chatmsg; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeRumNoBananasLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return API.lastGameMessage.contains( 12 | "There is some rum in here, although with no bananas to cover it. It is a little obvious."); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | SmuggleState.stashedRum = true; 18 | SmuggleState.filledCrateWithBananas = false; 19 | API.lastGameMessage = ""; 20 | return Timing.getSleepDelay(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/SolveArsenFoodMystery.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class SolveArsenFoodMystery extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 30; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return NPCHelper.goAndTalkToNpc( 19 | new Area(2553, 2859, 2559, 2853, 1), 20 | "Arsen the Thief", 21 | new String[] {"I hear Ithoi cooked the meal you ate that night."}); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/SolveGnocciFoodMysteryLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class SolveGnocciFoodMysteryLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 25; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndTalkToNpc( 18 | new Area(2543, 2864, 2547, 2860, 1), 19 | "Arsen the Thief", 20 | new String[] {"I hear it happened straight after dinner."}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TalkToTockCorsair3Leaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToTockCorsair3Leaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 50; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndTalkToNpc( 18 | new Area(2573, 2837, 2583, 2835, 1), 19 | "Captain Tock", 20 | new String[] {"I've seen Ithoi running around. He's not sick at all."}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/chatmsg/SeeCrateSentLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum.chatmsg; 2 | 3 | import org.dreambot.framework.Leaf; 4 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeCrateSentLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return API.lastGameMessage.contains( 12 | "There is already some rum in Wydin's store, I should go and get that first.") 13 | || API.lastGameMessage.contains("Luthas hands you 30 coins."); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | SmuggleState.crateSent = true; 19 | API.lastGameMessage = ""; 20 | return Timing.getSleepDelay(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/therestlessghost/TalkToFatherAereckLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.therestlessghost; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToFatherAereckLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getConfig(FreeQuest.THE_RESTLESS_GHOST.getConfigID()) == 0; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | return NPCHelper.goAndTalkToNpc( 18 | new Area(3240, 3215, 3247, 3204), 19 | "Father Aereck", 20 | new String[] {"I'm looking for a quest!", "Ok, let me help then.", "Yes."}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TalkToTockCorsair2Leaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToTockCorsair2Leaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 20; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return NPCHelper.goAndTalkToNpc( 19 | new Area(2573, 2837, 2583, 2835, 1), 20 | "Captain Tock", 21 | new String[] {"I've ruled out all the Corsairs' theories...", "So what do I do now?"}); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/RetrieveRawSardineLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.ShopHelper; 9 | 10 | public class RetrieveRawSardineLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 0 15 | && !Inventory.contains("Raw sardine"); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | return ShopHelper.purchaseFromShop( 21 | new Area(3011, 3229, 3017, 3223), "Raw sardine", 1, "Gerrant"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/RetrieveRedDyeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.helpers.NPCHelper; 7 | 8 | public class RetrieveRedDyeLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return Inventory.count("Redberries") >= 3; 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | Area AGGIE_AREA = new Area(3083, 3261, 3088, 3256); 17 | final String[] DIALOGUE_OPTIONS = { 18 | "Can you make dyes for me please?", 19 | "What do you need to make red dye?", 20 | "Okay, make me some red dye please." 21 | }; 22 | return NPCHelper.goAndTalkToNpc(AGGIE_AREA, "Aggie", DIALOGUE_OPTIONS); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/RetrievePickaxeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.GroundItemHelper; 8 | 9 | public class RetrievePickaxeLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return !Inventory.contains("Bronze pickaxe", "Iron pickaxe") 14 | && !Equipment.contains("Bronze pickaxe", "Iron pickaxe"); 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | final Tile BRONZE_PICKAXE_FALADOR_SPAWN = new Tile(3009, 3342, 0); 20 | return GroundItemHelper.pickupGroundSpawn(BRONZE_PICKAXE_FALADOR_SPAWN, "Bronze pickaxe"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/RetrieveYellowDyeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.helpers.NPCHelper; 7 | 8 | public class RetrieveYellowDyeLeaf extends Leaf { 9 | @Override 10 | public boolean isValid() { 11 | return Inventory.count("Onion") >= 2; 12 | } 13 | 14 | @Override 15 | public int onLoop() { 16 | Area AGGIE_AREA = new Area(3083, 3261, 3088, 3256); 17 | final String[] DIALOGUE_OPTIONS = { 18 | "Can you make dyes for me please?", 19 | "What do you need to make yellow dye?", 20 | "Okay, make me some yellow dye please." 21 | }; 22 | return NPCHelper.goAndTalkToNpc(AGGIE_AREA, "Aggie", DIALOGUE_OPTIONS); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/romeoandjuliet/TalkToFatherLawrenceLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.romeoandjuliet; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToFatherLawrenceLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 30; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | final Area FATHER_LAWRENCE_AREA = new Area(3252, 3488, 3255, 3482); 19 | final String[] DIALOGUE_OPTIONS = {"Ok, thanks."}; 20 | return NPCHelper.goAndTalkToNpc(FATHER_LAWRENCE_AREA, "Father Lawrence", DIALOGUE_OPTIONS); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/webnodes/RemoveDraynorJailNodesLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.webnodes; 2 | 3 | import org.dreambot.api.methods.map.Tile; 4 | import org.dreambot.api.methods.walking.pathfinding.impl.web.WebFinder; 5 | import org.dreambot.api.methods.walking.web.node.AbstractWebNode; 6 | import org.dreambot.framework.Leaf; 7 | 8 | public class RemoveDraynorJailNodesLeaf extends Leaf { 9 | private boolean removed = false; 10 | private final Tile DRAYNOR_JAIL_CENTER_TILE = new Tile(3121, 3247, 0); 11 | 12 | @Override 13 | public boolean isValid() { 14 | return !removed; 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | for (AbstractWebNode webNode : 20 | WebFinder.getWebFinder().getNodesWithin(17, DRAYNOR_JAIL_CENTER_TILE)) { 21 | WebFinder.getWebFinder().removeNode(webNode.getIndex()); 22 | } 23 | removed = true; 24 | return 100; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/webnodes/RemoveWizardWebnodesLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.webnodes; 2 | 3 | import org.dreambot.api.methods.map.Tile; 4 | import org.dreambot.api.methods.walking.pathfinding.impl.web.WebFinder; 5 | import org.dreambot.api.methods.walking.web.node.AbstractWebNode; 6 | import org.dreambot.framework.Leaf; 7 | 8 | public class RemoveWizardWebnodesLeaf extends Leaf { 9 | private boolean removed = false; 10 | private final Tile VARROCK_WIZARDS_CENTER_TILE = new Tile(3227, 3369, 0); 11 | 12 | @Override 13 | public boolean isValid() { 14 | return !removed; 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | for (AbstractWebNode webNode : 20 | WebFinder.getWebFinder().getNodesWithin(12, VARROCK_WIZARDS_CENTER_TILE)) { 21 | WebFinder.getWebFinder().removeNode(webNode.getIndex()); 22 | } 23 | removed = true; 24 | return 100; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/RetrieveDoogleLeavesLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | public class RetrieveDoogleLeavesLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 0 15 | && !Inventory.contains("Doogle leaves"); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | return GroundItemHelper.pickupGroundSpawn( 21 | new Tile(3152, 3399, 0), // doogle leaves spawn 22 | "Doogle leaves"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/TalkToArsenLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.helpers.NPCHelper; 6 | 7 | public class TalkToArsenLeaf extends Leaf { 8 | 9 | @Override 10 | public boolean isValid() { 11 | return !CurseState.talkedToArsen() 12 | || (CurseState.talkedToIthoi() 13 | && CurseState.returnedToothpick() 14 | && CurseState.lookedThroughTelescope() 15 | && CurseState.finishedGnocci() 16 | && TalkToTessLeaf.leaveTessArea()); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2553, 2859, 2559, 2853, 1), 23 | "Arsen the Thief", 24 | new String[] {"I hear you've been cursed."}); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/TalkToColinLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.helpers.NPCHelper; 6 | 7 | public class TalkToColinLeaf extends Leaf { 8 | 9 | @Override 10 | public boolean isValid() { 11 | return !CurseState.talkedToColin() 12 | || (CurseState.talkedToIthoi() 13 | && CurseState.finishedArsen() 14 | && CurseState.finishedGnocci() 15 | && CurseState.lookedThroughTelescope() 16 | && TalkToTessLeaf.leaveTessArea()); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2553, 2859, 2559, 2853, 1), 23 | "Cabin Boy Colin", 24 | new String[] {"I hear you've been cursed."}); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/TalkToGnocciLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.helpers.NPCHelper; 6 | 7 | public class TalkToGnocciLeaf extends Leaf { 8 | 9 | @Override 10 | public boolean isValid() { 11 | return !CurseState.talkedToGnocci() 12 | || (CurseState.talkedToIthoi() 13 | && CurseState.returnedToothpick() 14 | && CurseState.lookedThroughTelescope() 15 | && CurseState.foundDoll() 16 | && TalkToTessLeaf.leaveTessArea()); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2543, 2864, 2547, 2860, 1), 23 | "Gnocci the Cook", 24 | new String[] {"I hear you've been cursed."}); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/RetrieveSpadeXMarksTheSpotLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | public class RetrieveSpadeXMarksTheSpotLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return !Inventory.contains("Spade") 15 | && PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 0; 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | final Tile FALADOR_SPADE_AREA = new Tile(2981, 3370, 0); 21 | return GroundItemHelper.pickupGroundSpawn(FALADOR_SPADE_AREA, "Spade"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/impcatcher/GiveBeadsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.impcatcher; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class GiveBeadsLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.IMP_CATCHER.getConfigID()) == 0 14 | || PlayerSettings.getConfig(FreeQuest.IMP_CATCHER.getConfigID()) == 1; 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | final Area MIZGOG_AREA = new Area(3099, 3166, 3107, 3159, 2); 20 | final String[] DIALOGUE_OPTIONS = {"Give me a quest please.", "Yes."}; 21 | return NPCHelper.goAndTalkToNpc(MIZGOG_AREA, "Wizard Mizgog", DIALOGUE_OPTIONS); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/TalkToTockFarmLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToTockFarmLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 0 13 | || PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 5; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return NPCHelper.goAndTalkToNpc( 19 | new Area(3028, 3275, 3033, 3270, 0), 20 | "Captain Tock", 21 | new String[] { 22 | "What kind of help do you need?", "Sure, I'll try to help with your curse.", "Yes." 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/Branch.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework; 2 | 3 | import java.util.Collections; 4 | import java.util.LinkedList; 5 | import java.util.List; 6 | import java.util.Objects; 7 | import org.dreambot.utilities.API; 8 | 9 | public abstract class Branch extends Leaf { 10 | 11 | public final List children; 12 | 13 | public Branch() { 14 | this.children = new LinkedList<>(); 15 | } 16 | 17 | public Branch addLeafs(Leaf... leaves) { 18 | Collections.addAll(this.children, leaves); 19 | return this; 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | return children.stream() 25 | .filter(c -> Objects.nonNull(c) && c.isValid()) 26 | .findFirst() 27 | .map( 28 | tLeaf -> { 29 | API.currentBranch = this.getClass().getSimpleName(); 30 | API.currentLeaf = tLeaf.getClass().getSimpleName(); 31 | return tLeaf.onLoop(); 32 | }) 33 | .orElse(600); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/RetrieveIronChainbodyLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.ShopHelper; 9 | 10 | public class RetrieveIronChainbodyLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 0 15 | && Inventory.count("Coins") >= 300 16 | && !Inventory.contains("Iron chainbody"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area HORVIK_AREA = new Area(3227, 3441, 3232, 3433); 22 | return ShopHelper.purchaseFromShop(HORVIK_AREA, "Iron chainbody", 1, "Horvik"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/RetrieveEggLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | public class RetrieveEggLeaf extends Leaf { 11 | private final Tile EGG_CHICKEN_WEST_SPAWN = new Tile(3185, 3297, 0); 12 | 13 | @Override 14 | public boolean isValid() { 15 | return (PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 0 16 | || PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 1) 17 | && !Inventory.contains("Egg"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | return GroundItemHelper.pickupGroundSpawn(EGG_CHICKEN_WEST_SPAWN, "Egg"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/MixDyeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.utilities.Sleep; 5 | import org.dreambot.api.wrappers.items.Item; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.Interaction; 8 | import org.dreambot.utilities.Timing; 9 | 10 | public class MixDyeLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return Inventory.containsAll("Yellow dye", "Red dye"); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | 19 | if (Inventory.contains("Red dye") && Inventory.contains("Yellow dye")) { 20 | Item redDye = Inventory.get("Red dye"); 21 | Item yellowDye = Inventory.get("Yellow dye"); 22 | Interaction.delayUseItemOn(redDye, yellowDye); 23 | Sleep.sleepUntil(() -> Inventory.contains("Orange dye"), 3000); 24 | } 25 | return Timing.loopReturn(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/TalkToTockCorsair1Leaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.helpers.NPCHelper; 7 | 8 | public class TalkToTockCorsair1Leaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return CurseState.talkedToIthoi() 13 | && CurseState.talkedToGnocci() 14 | && CurseState.talkedToArsen() 15 | && CurseState.talkedToColin() 16 | && Inventory.contains("Spade"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2573, 2837, 2583, 2835, 1), 23 | "Captain Tock", 24 | new String[] { 25 | "Arsen says he gave you a sacred ogre relic.", "About that sacred ogre relic..." 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/MixBlueGoblinMailLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.utilities.Sleep; 5 | import org.dreambot.api.wrappers.items.Item; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.Interaction; 8 | import org.dreambot.utilities.Timing; 9 | 10 | public class MixBlueGoblinMailLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return Inventory.containsAll("Blue dye", "Goblin mail"); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | if (Inventory.containsAll("Blue dye", "Goblin mail")) { 19 | Item blueDye = Inventory.get("Blue dye"); 20 | Item goblinMail = Inventory.get("Goblin mail"); 21 | Interaction.delayUseItemOn(blueDye, goblinMail); 22 | Sleep.sleepUntil(() -> Inventory.contains("Blue goblin mail"), 3000); 23 | } 24 | return Timing.loopReturn(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/shieldofarrav/blackarmgang/TalkToCharlieLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.shieldofarrav.blackarmgang; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToCharlieLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.SHIELD_OF_ARRAV.getVarBitID()) == 0; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | 19 | Area CHARLIE_AREA = new Area(3207, 3394, 3211, 3390); 20 | final String[] DIALOGUE_OPTIONS = { 21 | "Is there anything down this alleyway?", "Do you think they would let me join?", "Yes" 22 | }; 23 | final String CHARLIE = "Charlie the Tramp"; 24 | return NPCHelper.goAndTalkToNpc(CHARLIE_AREA, CHARLIE, DIALOGUE_OPTIONS); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/MixOrangeGoblinMailLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.utilities.Sleep; 5 | import org.dreambot.api.wrappers.items.Item; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.Interaction; 8 | import org.dreambot.utilities.Timing; 9 | 10 | public class MixOrangeGoblinMailLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return Inventory.containsAll("Orange dye", "Goblin mail"); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | if (Inventory.containsAll("Orange dye", "Goblin mail")) { 19 | Item orangeDye = Inventory.get("Orange dye"); 20 | Item goblinMail = Inventory.get("Goblin mail"); 21 | Interaction.delayUseItemOn(orangeDye, goblinMail); 22 | Sleep.sleepUntil(() -> Inventory.contains("Orange goblin mail"), 3000); 23 | } 24 | return Timing.loopReturn(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/therestlessghost/TalkToFatherUrhneyLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.therestlessghost; 2 | 3 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToFatherUrhneyLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.THE_RESTLESS_GHOST.getConfigID()) == 1 15 | && !Equipment.contains("Ghostspeak amulet"); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | return NPCHelper.goAndTalkToNpc( 21 | new Area(3144, 3177, 3151, 3173), 22 | "Father Urhney", 23 | new String[] { 24 | "Father Aereck sent me to talk to you.", "He's got a ghost haunting his graveyard." 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/TalkToBrotherKojoLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.quests.paidquests.clocktower.placecogs.CogState; 9 | import org.dreambot.utilities.helpers.NPCHelper; 10 | 11 | public class TalkToBrotherKojoLeaf extends Leaf { 12 | @Override 13 | public boolean isValid() { 14 | return CogState.finished() 15 | || Arrays.stream(new int[] {0, 5, 6, 7}) 16 | .anyMatch(i -> i == PlayerSettings.getConfig(PaidQuest.CLOCK_TOWER.getConfigID())); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2563, 3255, 2574, 3239), // brother kojo area 23 | "Brother Kojo", 24 | new String[] {"OK old monk, what can I do?", "Yes."}); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/loadouts/LoadoutItem.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.loadouts; 2 | 3 | public class LoadoutItem { 4 | private String itemName; 5 | private int itemQty; 6 | private boolean noted; 7 | 8 | public LoadoutItem(String itemName, int itemQty) { 9 | this.itemName = itemName; 10 | this.itemQty = itemQty; 11 | noted = false; 12 | } 13 | 14 | public LoadoutItem(String itemName, int itemQty, boolean noted) { 15 | this.itemName = itemName; 16 | this.itemQty = itemQty; 17 | this.noted = noted; 18 | } 19 | 20 | public String getItemName() { 21 | return itemName; 22 | } 23 | 24 | public void setItemName(String itemName) { 25 | this.itemName = itemName; 26 | } 27 | 28 | public int getItemQty() { 29 | return itemQty; 30 | } 31 | 32 | public void setItemQty(int itemQty) { 33 | this.itemQty = itemQty; 34 | } 35 | 36 | public boolean isNoted() { 37 | return noted; 38 | } 39 | 40 | public void setNoted(boolean noted) { 41 | this.noted = noted; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/TalkToVeosSarimLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToVeosSarimLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 6 15 | && Inventory.contains("Ancient casket") 16 | || PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 7; 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area VEOS_PORT_SARIM_AREA = new Area(3050, 3249, 3055, 3245); 22 | final String VEOS_NAME = "Veos"; 23 | return NPCHelper.goAndTalkToNpc(VEOS_PORT_SARIM_AREA, VEOS_NAME, null); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/ClockTower.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower; 2 | 3 | import org.dreambot.api.methods.quest.book.PaidQuest; 4 | import org.dreambot.api.methods.walking.pathfinding.impl.local.LocalPathFinder; 5 | import org.dreambot.api.methods.walking.pathfinding.impl.obstacle.impl.ClimbableObstacle; 6 | import org.dreambot.framework.Branch; 7 | import org.dreambot.utilities.requirements.CheckRequirements; 8 | 9 | public class ClockTower extends Branch { 10 | public static boolean shouldAddStairs = true; 11 | 12 | @Override 13 | public boolean isValid() { 14 | if (shouldAddStairs) { 15 | LocalPathFinder.getLocalPathFinder() 16 | .addObstacle(new ClimbableObstacle("Staircase", "Climb-up", null, null, null)); 17 | LocalPathFinder.getLocalPathFinder() 18 | .addObstacle(new ClimbableObstacle("Staircase", "Climb-down", null, null, null)); 19 | shouldAddStairs = false; 20 | } 21 | 22 | return CheckRequirements.checkRequirements(PaidQuest.CLOCK_TOWER); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/monksfriend/TalkToBrotherOmadLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.monksfriend; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToBrotherOmadLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(PaidQuest.MONKS_FRIEND.getConfigID()) == 0 15 | || PlayerSettings.getConfig(PaidQuest.MONKS_FRIEND.getConfigID()) == 10 16 | && Inventory.contains("Child's blanket"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | return NPCHelper.goAndTalkToNpc( 22 | new Area(2602, 3211, 2610, 3207), 23 | "Brother Omad", 24 | new String[] {"Why can't you sleep, what's wrong?", "Can I help at all?", "Yes."}); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2022 NotSinan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 4 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 5 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 6 | persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 9 | Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 12 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 14 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/obtainflour/RetrievePotLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant.obtainflour; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.helpers.GroundItemHelper; 7 | 8 | public class RetrievePotLeaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return !Inventory.contains("Pot"); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | // get bucket and pot together if not have either, because they are so close together, to save a 18 | // trip 19 | if (!Inventory.contains("Bucket", "Bucket of milk")) { 20 | final Tile BUCKET_LUMBRIDGE_SPAWN = new Tile(3216, 9625, 0); 21 | return GroundItemHelper.pickupGroundSpawn(BUCKET_LUMBRIDGE_SPAWN, "Bucket"); 22 | } 23 | 24 | final Tile POT_LUMBRIDGE_SPAWN = new Tile(3209, 3214, 0); 25 | return GroundItemHelper.pickupGroundSpawn(POT_LUMBRIDGE_SPAWN, "Pot"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/miniquests/alfredgrimhandsbarcrawl/WithdrawFromBankAlfredGrimhandsBarcrawlLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.miniquests.alfredgrimhandsbarcrawl; 2 | 3 | import org.dreambot.api.methods.container.impl.bank.Bank; 4 | import org.dreambot.api.methods.quest.book.MiniQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.api.utilities.Sleep; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.Timing; 9 | 10 | public class WithdrawFromBankAlfredGrimhandsBarcrawlLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return Bank.isOpen(); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | switch (PlayerSettings.getConfig(MiniQuest.ALFRED_GRIMHANDS_BARCRAWL.getConfigID())) { 19 | case (0): 20 | { 21 | // placeholder for teleportation withdrawal handling 22 | break; 23 | } 24 | } 25 | if (Bank.close()) { 26 | Sleep.sleepUntil(() -> !Bank.isOpen(), 3000); 27 | } 28 | return Timing.loopReturn(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/TalkToDoricLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToDoricLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.DORICS_QUEST.getConfigID()) == 0 14 | || PlayerSettings.getConfig(FreeQuest.DORICS_QUEST.getConfigID()) == 10; 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | final Area DORICS_QUEST_AREA = new Area(2950, 3454, 2953, 3449); 20 | final String[] DIALOGUES_OPTIONS = { 21 | "I wanted to use your anvils.", 22 | "Yes, I will get you the materials.", 23 | "Yes.", 24 | "Certainly, I'll be right back!" 25 | }; 26 | return NPCHelper.goAndTalkToNpc(DORICS_QUEST_AREA, "Doric", DIALOGUES_OPTIONS); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/RetrieveSpadePiratesTreasureLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | public class RetrieveSpadePiratesTreasureLeaf extends Leaf { 11 | 12 | private final Tile FALADOR_SPADE_AREA = new Tile(2981, 3370, 0); 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 0 17 | && !Inventory.contains("Spade") 18 | || PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 3 19 | && !Inventory.contains("Spade"); 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | return GroundItemHelper.pickupGroundSpawn(FALADOR_SPADE_AREA, "Spade"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/TalkToDrHarlowLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToDrHarlowLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.VAMPIRE_SLAYER.getConfigID()) == 1 15 | || PlayerSettings.getConfig(FreeQuest.VAMPIRE_SLAYER.getConfigID()) == 2 16 | && !Inventory.contains("Stake"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | 22 | final Area DR_HARLOW_AREA = new Area(3216, 3404, 3227, 3392); 23 | final String[] DIALOGUE_OPTIONS = {"Morgan needs your help!", "Okay mate."}; 24 | 25 | return NPCHelper.goAndTalkToNpc(DR_HARLOW_AREA, "Dr Harlow", DIALOGUE_OPTIONS); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/requirements/CheckRequirements.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.requirements; 2 | 3 | import org.dreambot.api.methods.quest.book.Quest; 4 | import org.dreambot.api.script.ScriptManager; 5 | import org.dreambot.api.utilities.Logger; 6 | import org.dreambot.utilities.API; 7 | 8 | public class CheckRequirements { 9 | public static boolean checkRequirements(Quest quest) { 10 | if (!quest.hasRequirements()) { 11 | Logger.log("Do not have requirements to start " + quest + ", stopping script...!"); 12 | ScriptManager.getScriptManager().stop(); 13 | return false; 14 | } 15 | 16 | if (quest.isFinished()) { 17 | Logger.log("Finished " + quest + ", stopping script...!"); 18 | ScriptManager.getScriptManager().stop(); 19 | return false; 20 | } 21 | 22 | if (API.questVarBit != quest.getVarBitID()) { 23 | API.questVarBit = quest.getVarBitID(); 24 | } 25 | 26 | if (API.questVarPlayer != quest.getConfigID()) { 27 | API.questVarPlayer = quest.getConfigID(); 28 | } 29 | 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/RetrieveRumLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.ShopHelper; 8 | 9 | public class RetrieveRumLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return !Inventory.contains("Karamjan rum"); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | final Area KARAMJA_PUB_AREA = 18 | new Area( 19 | new Tile(2930, 3142, 0), 20 | new Tile(2930, 3148, 0), 21 | new Tile(2921, 3147, 0), 22 | new Tile(2920, 3149, 0), 23 | new Tile(2917, 3149, 0), 24 | new Tile(2916, 3148, 0), 25 | new Tile(2916, 3143, 0), 26 | new Tile(2917, 3142, 0)); 27 | return ShopHelper.purchaseFromShop(KARAMJA_PUB_AREA, "Karamjan rum", 1, "Zambo"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/TalkToKaqemeexLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToKaqemeexLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 0 14 | && Inventory.contains("Raw rat meat", "Raw beef", "Raw chicken", "Raw bear meat") 15 | || PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 3; 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | return NPCHelper.goAndTalkToNpc( 21 | new Area(2914, 3490, 2931, 3478), // kaqemeex area 22 | "Kaqemeex", 23 | new String[] {"I'm in search of a quest.", "Okay, I will try and help.", "Yes."}); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/RetrieveCabbageLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | 10 | public class RetrieveCabbageLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 0 15 | && !Inventory.contains("Cabbage"); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | final Area CABBAGE_AREA = new Area(3049, 3506, 3055, 3502); 21 | final String GAME_OBJECT = "Cabbage"; 22 | final String ACTION = "Pick"; 23 | final String ITEM = "Cabbage"; 24 | return GameObjectHelper.goAndInteractWithGameObject( 25 | CABBAGE_AREA, GAME_OBJECT, ACTION, () -> Inventory.contains(ITEM)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/RetrieveSpadeCorsairCurseLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | public class RetrieveSpadeCorsairCurseLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 15 15 | && CurseState.talkedToIthoi() 16 | && CurseState.talkedToGnocci() 17 | && CurseState.talkedToArsen() 18 | && CurseState.talkedToColin() 19 | && !Inventory.contains("Spade"); 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | return GroundItemHelper.pickupGroundSpawn( 25 | new Tile(2552, 2846, 0), // corsair cove spade spawn 26 | "Spade"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/DialogueHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers; 2 | 3 | import org.dreambot.api.methods.dialogues.Dialogues; 4 | import org.dreambot.api.methods.widget.Widgets; 5 | import org.dreambot.api.utilities.Logger; 6 | import org.dreambot.api.wrappers.widgets.WidgetChild; 7 | 8 | public class DialogueHelper { 9 | public static String getDialogue() { 10 | String txt = ""; 11 | WidgetChild dialogWidget = Widgets.getWidgetChild(193, 2); 12 | if (dialogWidget == null || !dialogWidget.isVisible()) { 13 | dialogWidget = Widgets.getWidgetChild(231, 6); 14 | } 15 | if (dialogWidget != null && dialogWidget.isVisible()) { 16 | txt = dialogWidget.getText(); 17 | if (txt != null && !txt.isEmpty() && !txt.equalsIgnoreCase("null")) { 18 | Logger.log("NPC Dialogue: " + txt); 19 | return txt; 20 | } 21 | } 22 | txt = Dialogues.getNPCDialogue(); 23 | if (txt != null && !txt.isEmpty() && !txt.equalsIgnoreCase("null")) { 24 | Logger.log("NPC Dialogue: " + txt); 25 | return txt; 26 | } 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/RetrieveBronzeMedHelmLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.ShopHelper; 9 | 10 | public class RetrieveBronzeMedHelmLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 0 15 | && Inventory.count("Coins") >= 300 16 | && !Inventory.contains("Bronze med helm"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area PEKSA_AREA = new Area(3073, 3431, 3077, 3427); 22 | final String ITEM_NAME = "Bronze med helm"; 23 | final int QUANTITY = 1; 24 | final String NPC_NAME = "Peksa"; 25 | return ShopHelper.purchaseFromShop(PEKSA_AREA, ITEM_NAME, QUANTITY, NPC_NAME); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/RetrievePiratesTreasureCoinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 8 | import org.dreambot.utilities.helpers.BankHelper; 9 | 10 | public class RetrievePiratesTreasureCoinsLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return (PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 0 15 | && !Inventory.contains("Coins")) 16 | || (PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 1 17 | && !SmuggleState.stashedRum 18 | && !Inventory.contains("Coins") 19 | && !Inventory.contains("Karamjan rum")); 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | return BankHelper.withdrawFromBank("Coins", 1000); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/TalkToCookLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToCookLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return (PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 0 15 | || PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 1) 16 | && Inventory.containsAll("Pot of flour", "Egg", "Bucket of milk"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area COOK_AREA = new Area(3205, 3217, 3212, 3212, 0); 22 | final String COOK_NAME = "Cook"; 23 | final String[] DIALOGUE_OPTIONS = {"I'll get right on it."}; 24 | return NPCHelper.goAndTalkToNpc(COOK_AREA, COOK_NAME, DIALOGUE_OPTIONS); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/shieldofarrav/blackarmgang/TalkToKatrineLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.shieldofarrav.blackarmgang; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class TalkToKatrineLeaf extends Leaf { 10 | 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(FreeQuest.SHIELD_OF_ARRAV.getVarBitID()) == 1; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | Area KATRINE_AREA = new Area(3182, 3387, 3189, 3382); 19 | String[] DIALOGUE_OPTIONS = { 20 | "I've heard you're the Black Arm Gang.", 21 | "I'd rather not reveal my sources.", 22 | "I want to become a member of your gang.", 23 | "Well, you can give me a try can't you?", 24 | "Ok, no problem." 25 | }; 26 | String KATRINE = "Katrine"; 27 | return NPCHelper.goAndTalkToNpc(KATRINE_AREA, KATRINE, DIALOGUE_OPTIONS); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/TalkToSanfewLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToSanfewLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 1 15 | || PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 2 16 | && Inventory.contains( 17 | "Enchanted rat", "Enchanted beef", "Enchanted chicken", "Enchanted bear"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | return NPCHelper.goAndTalkToNpc( 23 | new Area(2894, 3431, 2901, 3425, 1), // sanfew area 24 | "Sanfew", 25 | new String[] {"I've been sent to help purify the Varrock stone circle."}); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/SolveIthoiFoodMysteryLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.quest.book.FreeQuest; 5 | import org.dreambot.api.methods.settings.PlayerSettings; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.NPCHelper; 8 | 9 | public class SolveIthoiFoodMysteryLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 35 13 | || PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 40; 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | return NPCHelper.goAndTalkToNpc( 19 | new Area(2527, 2841, 2532, 2835, 1), 20 | "Ithoi the Navigator", 21 | new String[] { 22 | "I bet I can prove you're well enough to get up.", 23 | "I know you've faked the curse.", 24 | "I hear you cooked the meal they ate before getting sick.", 25 | "Maybe because the Captain's thinking of firing you." 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/runemysteries/TalkToLumbridgeDukeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.runemysteries; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToLumbridgeDukeLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 0 15 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 1 16 | && !Inventory.contains("Air talisman"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area LUMBRIDGE_DUKE_AREA = new Area(3208, 3225, 3213, 3218, 1); 22 | final String DUKE_NAME = "Duke Horacio"; 23 | final String[] DIALOGUE_OPTIONS = {"Have you any quests for me?", "Sure, no problem", "Yes."}; 24 | return NPCHelper.goAndTalkToNpc(LUMBRIDGE_DUKE_AREA, DUKE_NAME, DIALOGUE_OPTIONS); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/TalkToBartenderLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToBartenderLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.VAMPIRE_SLAYER.getConfigID()) == 1 15 | && !Inventory.contains("Beer") 16 | || PlayerSettings.getConfig(FreeQuest.VAMPIRE_SLAYER.getConfigID()) == 2 17 | && !Inventory.contains("Stake") 18 | && !Inventory.contains("Beer"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area BARTENDER_AREA = new Area(3216, 3404, 3227, 3392); 24 | final String[] DIALOGUE_OPTIONS = {"A glass of your finest ale please."}; 25 | return NPCHelper.goAndTalkToNpc(BARTENDER_AREA, "Bartender", DIALOGUE_OPTIONS); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/BankHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.bank.Bank; 5 | import org.dreambot.api.utilities.Logger; 6 | import org.dreambot.api.utilities.Sleep; 7 | import org.dreambot.utilities.Timing; 8 | 9 | public class BankHelper { 10 | public static int withdrawFromBank(String itemName, int quantity) { 11 | if (!Bank.isOpen()) { 12 | Timing.sleepForDelay(); 13 | if (Bank.open()) { 14 | Timing.loopReturn(); 15 | } 16 | return Timing.getSleepDelay(); 17 | } 18 | 19 | if (Bank.count(itemName) <= 0) { 20 | Logger.log( 21 | "Attempted to withdraw itemName / quantity: " 22 | + itemName 23 | + " / " 24 | + quantity 25 | + " - but have none in bank!"); 26 | return Timing.loopReturn(); 27 | } 28 | 29 | Timing.sleepForDelay(); 30 | if (Bank.withdraw(itemName, quantity)) { 31 | Sleep.sleepUntil(() -> Inventory.count(itemName) >= quantity, 3000); 32 | } 33 | return Timing.loopReturn(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/OwnedItems.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.container.impl.bank.Bank; 6 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 7 | 8 | public class OwnedItems { 9 | public static int count(String itemName) { 10 | return Bank.count(itemName) + Inventory.count(itemName) + Equipment.count(itemName); 11 | } 12 | 13 | public static boolean contains(String itemName) { 14 | return Bank.contains(itemName) || Inventory.contains(itemName) || Equipment.contains(itemName); 15 | } 16 | 17 | public static boolean contains(String... itemNames) { 18 | return Bank.contains(itemNames) 19 | || Inventory.contains(itemNames) 20 | || Equipment.contains(itemNames); 21 | } 22 | 23 | public static boolean containsAll(String... itemNames) { 24 | return Arrays.stream(itemNames) 25 | .allMatch( 26 | itemName -> 27 | Bank.contains(itemName) 28 | || Inventory.contains(itemName) 29 | || Equipment.contains(itemName)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/ObserveIthoiTelescopeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.dialogues.Dialogues; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | 10 | public class ObserveIthoiTelescopeLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 15 15 | && CurseState.talkedToIthoi() 16 | && CurseState.returnedToothpick() 17 | && CurseState.talkedToColin() 18 | && CurseState.foundDoll() 19 | && TalkToTessLeaf.leaveTessArea(); 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | return GameObjectHelper.goAndInteractWithGameObject( 25 | new Area(2527, 2841, 2532, 2835, 1), // ithoi upstairs telescope 26 | "Telescope", 27 | "Observe", 28 | () -> Dialogues.inDialogue()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/TalkToSirAmikVarzeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToSirAmikVarzeLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 0 15 | && Inventory.containsAll("Iron chainbody", "Bronze med helm", "Cabbage"); 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | final Area SIR_AMIK_VARZE_AREA = new Area(2955, 3342, 2964, 3334, 2); 21 | final String[] DIALOGUE_OPTIONS = { 22 | "I seek a quest!", "I laugh in the face of danger!", "Ok, I'll do my best.", "Yes." 23 | }; 24 | final String SIR_AMIK_VARZE = "Sir Amik Varze"; 25 | return NPCHelper.goAndTalkToNpc(SIR_AMIK_VARZE_AREA, SIR_AMIK_VARZE, DIALOGUE_OPTIONS); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/RetrieveBlueDyeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class RetrieveBlueDyeLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 14 | && Inventory.count("Woad leaf") >= 2 15 | && !Inventory.contains("Blue dye") 16 | && !Inventory.contains("Blue goblin mail"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | Area AGGIE_AREA = new Area(3083, 3261, 3088, 3256); 22 | final String[] DIALOGUE_OPTIONS = { 23 | "Can you make dyes for me please?", 24 | "What do you need to make blue dye?", 25 | "Okay, make me some blue dye please." 26 | }; 27 | return NPCHelper.goAndTalkToNpc(AGGIE_AREA, "Aggie", DIALOGUE_OPTIONS); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/retrieveitems/RetrieveOnionLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy.retrieveitems; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | 10 | public class RetrieveOnionLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 14 | && Inventory.count("Onion") < 2 15 | && !Inventory.contains("Yellow dye") 16 | && !Inventory.contains("Orange dye") 17 | && !Inventory.contains("Orange goblin mail"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final Area ONION_AREA = new Area(3186, 3269, 3191, 3265); 23 | final int count = Inventory.count("Onion") + 1; 24 | return GameObjectHelper.goAndInteractWithGameObject( 25 | ONION_AREA, "Onion", "Pick", () -> Inventory.count("Onion") != count); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/RetrieveBananaLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.helpers.GameObjectHelper; 8 | 9 | public class RetrieveBananaLeaf extends Leaf { 10 | @Override 11 | public boolean isValid() { 12 | return Inventory.count("Banana") < 10; 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | final Area KARAMJA_BANANA_PLANTATION_AREA = 18 | new Area( 19 | new Tile(2927, 3154, 0), 20 | new Tile(2912, 3154, 0), 21 | new Tile(2911, 3156, 0), 22 | new Tile(2907, 3157, 0), 23 | new Tile(2907, 3163, 0), 24 | new Tile(2926, 3163, 0)); 25 | final int count = Inventory.count("Banana"); 26 | return GameObjectHelper.goAndInteractWithGameObject( 27 | KARAMJA_BANANA_PLANTATION_AREA, 28 | "Banana Tree", 29 | "Pick", 30 | () -> Inventory.count("Banana") > count); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/bank/BankOnceLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.bank; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.bank.Bank; 5 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 6 | import org.dreambot.api.utilities.Sleep; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.Timing; 9 | 10 | public class BankOnceLeaf extends Leaf { 11 | 12 | private static boolean emptied = false; 13 | 14 | @Override 15 | public boolean isValid() { 16 | return !emptied; 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | if (Inventory.isEmpty() && Equipment.isEmpty()) { 22 | emptied = true; 23 | return Timing.getSleepDelay(); 24 | } 25 | 26 | Timing.sleepForDelay(); 27 | if (Bank.open()) { 28 | if (!Inventory.isEmpty() && Bank.depositAllItems()) { 29 | Sleep.sleepUntil(Inventory::isEmpty, 3000); 30 | } 31 | 32 | if (!Equipment.isEmpty() && Bank.depositAllEquipment()) { 33 | Sleep.sleepUntil(Equipment::isEmpty, 3000); 34 | } 35 | return Timing.loopReturn(); 36 | } 37 | return Timing.loopReturn(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/witchspotion/TalkToWitchLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.witchspotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToWitchLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.WITCHS_POTION.getConfigID()) == 0 15 | || PlayerSettings.getConfig(FreeQuest.WITCHS_POTION.getConfigID()) == 1 16 | && Inventory.containsAll("Onion", "Rat's tail", "Eye of newt", "Burnt meat"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area WITCH_AREA = new Area(2965, 3208, 2970, 3203, 0); 22 | final String WITCH_NAME = "Hetty"; 23 | final String[] DIALOGUE_OPTIONS = { 24 | "Yes, help me become one with my darker side.", "I am in search of a quest.", "Yes." 25 | }; 26 | return NPCHelper.goAndTalkToNpc(WITCH_AREA, WITCH_NAME, DIALOGUE_OPTIONS); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/loadouts/Loadout.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.loadouts; 2 | 3 | public class Loadout { 4 | private EquipmentLoadout equipmentLoadout; 5 | private InventoryLoadout inventoryLoadout; 6 | 7 | public Loadout(EquipmentLoadout equipmentLoadout, InventoryLoadout inventoryLoadout) { 8 | this.equipmentLoadout = equipmentLoadout; 9 | this.inventoryLoadout = inventoryLoadout; 10 | } 11 | 12 | public boolean fulfilled() { 13 | return (equipmentLoadout == null || equipmentLoadout.fulfilled()) 14 | && (inventoryLoadout == null || inventoryLoadout.fulfilled()); 15 | } 16 | 17 | public boolean fulfill() { 18 | return (equipmentLoadout == null || equipmentLoadout.fulfill()) 19 | && (inventoryLoadout == null || inventoryLoadout.fulfill()); 20 | } 21 | 22 | public void addInventoryItem(LoadoutItem item) { 23 | if (inventoryLoadout == null) { 24 | inventoryLoadout = new InventoryLoadout(); 25 | } 26 | inventoryLoadout.addItem(item); 27 | } 28 | 29 | public void addEquipmentItem(LoadoutItem item) { 30 | if (equipmentLoadout == null) { 31 | equipmentLoadout = new EquipmentLoadout(); 32 | } 33 | equipmentLoadout.addItem(item); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/miniquests/alfredgrimhandsbarcrawl/SeeBartenderMessageLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.miniquests.alfredgrimhandsbarcrawl; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeBartenderMessageLeaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | 13 | return Arrays.stream( 14 | new String[] { 15 | "The barmaid signs your card.", 16 | "The bartender signs your card.", 17 | "Zambo signs your card.", 18 | "Blurberry signs your card.", 19 | "You think you see 2 bartenders signing 2 barcrawl cards.", 20 | "signing your barcrawl card", 21 | "The bartender scrawls his signature on your card.", 22 | "You can just about make out the bartender" 23 | }) 24 | .anyMatch(phrase -> API.lastGameMessage.contains(phrase)); 25 | } 26 | 27 | @Override 28 | public int onLoop() { 29 | AlfredGrimhandsBarcrawl.checkedCard = false; 30 | API.lastGameMessage = ""; 31 | API.lastGameMessageTile = null; 32 | return Timing.loopReturn(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/runemysteries/TalkToAuburyLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.runemysteries; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToAuburyLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 3 15 | && Inventory.contains("Research package") 16 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 4 17 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 5 18 | && !Inventory.contains("Research notes"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area AUBURY_AREA = new Area(3250, 3402, 3255, 3400); 24 | final String AUBURY_NAME = "Aubury"; 25 | final String[] DIALOGUE_OPTIONS = {"I've been sent here with a package for you."}; 26 | return NPCHelper.goAndTalkToNpc(AUBURY_AREA, AUBURY_NAME, DIALOGUE_OPTIONS); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/retrieveitems/RetrieveRedBerryLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy.retrieveitems; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | 10 | public class RetrieveRedBerryLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 15 | && Inventory.count("Redberries") < 3 16 | && !Inventory.contains("Red dye") 17 | && !Inventory.contains("Orange dye") 18 | && !Inventory.contains("Orange goblin mail"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area RED_BERRY_BUSH_AREA = new Area(3266, 3375, 3279, 3365); 24 | final int count = Inventory.count("Redberries"); 25 | return GameObjectHelper.goAndInteractWithGameObject( 26 | RED_BERRY_BUSH_AREA, 27 | "Redberry bush", 28 | "Pick-from", 29 | () -> Inventory.count("Redberries") != count); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/LeaveKaramjaLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.framework.Leaf; 6 | import org.dreambot.utilities.helpers.NPCHelper; 7 | 8 | public class LeaveKaramjaLeaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return SmuggleState.isOnKaramja() && SmuggleState.haveShippedRum(); 13 | } 14 | 15 | @Override 16 | public int onLoop() { 17 | final Area SEAMAN_AREA = 18 | new Area( 19 | new Tile(2949, 3146, 0), 20 | new Tile(2961, 3146, 0), 21 | new Tile(2961, 3147, 0), 22 | new Tile(2956, 3148, 0), 23 | new Tile(2955, 3155, 0), 24 | new Tile(2954, 3159, 0), 25 | new Tile(2953, 3159, 0), 26 | new Tile(2953, 3148, 0), 27 | new Tile(2949, 3148, 0)); 28 | final String SEAMAN_NAME = "Customs officer"; 29 | final String[] DIALOGUE_OPTIONS = { 30 | "Can I journey on this ship?", "Search away, I have nothing to hide.", "Ok." 31 | }; 32 | return NPCHelper.goAndTalkToNpc(SEAMAN_AREA, SEAMAN_NAME, DIALOGUE_OPTIONS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/placecogs/RetrieveRedCogLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower.placecogs; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.map.Tile; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | import org.dreambot.utilities.helpers.GroundItemHelper; 10 | 11 | public class RetrieveRedCogLeaf extends Leaf { 12 | @Override 13 | public boolean isValid() { 14 | return !CogState.placedRedCog && !Inventory.contains("Red cog"); 15 | } 16 | 17 | @Override 18 | public int onLoop() { 19 | if (!new Area(2623, 9599, 2558, 9664) 20 | .contains(Players.getLocal())) { // entire clocktower dungeon 21 | final Area CLOCKTOWER_MIDDLE_ROOM = new Area(2564, 3245, 2573, 3239, 0); 22 | 23 | return GameObjectHelper.goAndInteractWithGameObject( 24 | CLOCKTOWER_MIDDLE_ROOM, 25 | "Ladder", 26 | "Climb-down", 27 | () -> !CLOCKTOWER_MIDDLE_ROOM.contains(Players.getLocal())); 28 | } 29 | 30 | return GroundItemHelper.pickupGroundSpawn(new Tile(2583, 9613, 0), "Red cog"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/TalkToSirPrysinLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToSirPrysinLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return (PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 1) 15 | || (PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 16 | && Inventory.containsAll(2400, 2399, 2401)); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area SIR_PRYSIN_AREA = new Area(3201, 3475, 3206, 3469); 22 | final String[] DIALOGUE_OPTIONS = { 23 | "Aris said I should come and talk to you.", 24 | "I need to find Silverlight.", 25 | "He's back and unfortunately I've got to deal with him.", 26 | "So give me the keys!", 27 | "Can you give me your key?" 28 | }; 29 | return NPCHelper.goAndTalkToNpc(SIR_PRYSIN_AREA, "Sir Prysin", DIALOGUE_OPTIONS); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/RetrieveChickenMeatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.PaidQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.helpers.NPCHelper; 12 | 13 | public class RetrieveChickenMeatLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 0 17 | && Inventory.contains("Raw rat meat", "Raw beef", "Raw bear meat") 18 | && !Inventory.contains("Raw chicken"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | 24 | GroundItem rawRatMeat = GroundItems.closest("Raw chicken"); 25 | if (rawRatMeat != null && rawRatMeat.interact("Take")) { 26 | Sleep.sleepUntil(() -> Inventory.contains("Raw chicken"), 3000); 27 | } 28 | 29 | return NPCHelper.goAndKillNpc(new Area(3227, 3300, 3232, 3296), "Chicken"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/RetrieveCowMeatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.PaidQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.helpers.NPCHelper; 12 | 13 | public class RetrieveCowMeatLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 0 17 | && Inventory.contains("Raw rat meat", "Raw bear meat") 18 | && !Inventory.contains("Raw beef"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | 24 | GroundItem rawRatMeat = GroundItems.closest("Raw beef"); 25 | if (rawRatMeat != null && rawRatMeat.interact("Take")) { 26 | Sleep.sleepUntil(() -> Inventory.contains("Raw beef"), 3000); 27 | } 28 | 29 | return NPCHelper.goAndKillNpc( 30 | new Area(3253, 3265, 3259, 3255), // cow area 31 | "Cow"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/RetrieveRatMeatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.PaidQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.helpers.NPCHelper; 12 | 13 | public class RetrieveRatMeatLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 0 17 | && Inventory.contains("Raw bear meat") 18 | && !Inventory.contains("Raw rat meat"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | 24 | GroundItem rawRatMeat = GroundItems.closest("Raw rat meat"); 25 | if (rawRatMeat != null && rawRatMeat.interact("Take")) { 26 | Sleep.sleepUntil(() -> Inventory.contains("Raw rat meat"), 3000); 27 | } 28 | 29 | return NPCHelper.goAndKillNpc( 30 | new Area(3191, 3211, 3199, 3204), // rat area 31 | "Giant rat"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/RetrieveBucketLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GroundItemHelper; 9 | 10 | /** 11 | * This class picks up the bucket that spawns upstairs in Varrock palace. 12 | */ 13 | public class RetrieveBucketLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 17 | && !Inventory.contains("Bucket") 18 | && !Inventory.contains("Bucket of water") 19 | && !Inventory.contains(2401) 20 | && // Silverlight key ID. 21 | PlayerSettings.getBitValue(2568) 22 | == 0; // Player setting to determine if a player has poured water in the drain. 23 | } 24 | 25 | @Override 26 | public int onLoop() { 27 | final Tile BUCKET_SPAWN_TILE = 28 | new Tile(3221, 3497, 1); // Bucket spawn upstairs in Varrock palace. 29 | return GroundItemHelper.pickupGroundSpawn(BUCKET_SPAWN_TILE, "Bucket"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/retrieveitems/RetrieveWoadLeavesLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy.retrieveitems; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.BankHelper; 9 | import org.dreambot.utilities.helpers.NPCHelper; 10 | 11 | public class RetrieveWoadLeavesLeaf extends Leaf { 12 | 13 | @Override 14 | public boolean isValid() { 15 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 16 | && Inventory.count("Woad leaf") < 2 17 | && !Inventory.contains("Blue dye") 18 | && !Inventory.contains("Blue goblin mail"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | 24 | if (Inventory.count("Coins") < 40) { 25 | return BankHelper.withdrawFromBank("Coins", 40); 26 | } 27 | final Area WYSON_AREA = new Area(3024, 3383, 3029, 3375); 28 | final String[] DIALOGUE_OPTIONS = {"Yes please, I need woad leaves.", "How about 20 coins?"}; 29 | return NPCHelper.goAndTalkToNpc(WYSON_AREA, "Wyson the gardener", DIALOGUE_OPTIONS); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/druidicritual/RetrieveBearMeatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.druidicritual; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.PaidQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.helpers.NPCHelper; 13 | 14 | public class RetrieveBearMeatLeaf extends Leaf { 15 | @Override 16 | public boolean isValid() { 17 | return PlayerSettings.getConfig(PaidQuest.DRUIDIC_RITUAL.getConfigID()) == 0 18 | && !Inventory.contains("Raw bear meat"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | GroundItem rawRatMeat = GroundItems.closest("Raw bear meat"); 24 | if (rawRatMeat != null && Interaction.delayEntityInteract(rawRatMeat, "Take")) { 25 | Sleep.sleepUntil(() -> Inventory.contains("Raw bear meat"), 3000); 26 | } 27 | return NPCHelper.goAndKillNpc( 28 | new Area(3070, 3612, 3094, 3597), // bear area 29 | "Grizzly bear"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/TalkToWizardTraibornLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | /** 11 | * This class speaks to gives Wizard Traiborn the 25 bones to retrieve the 3rd key. 12 | */ 13 | public class TalkToWizardTraibornLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 17 | && Inventory.containsAll(2401, 2400) 18 | && Inventory.count("Bones") == 25; 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area WIZARD_TRAIBORN_AREA = new Area(3099, 3168, 3117, 3154, 1); 24 | final String[] DIALOGUE_OPTIONS = { 25 | "Talk about Demon Slayer.", 26 | "I need to get a key given to you by Sir Prysin.", 27 | "Well, have you got any keys knocking around?", 28 | "I'll get the bones for you." 29 | }; 30 | return NPCHelper.goAndTalkToNpc(WIZARD_TRAIBORN_AREA, "Wizard Traiborn", DIALOGUE_OPTIONS); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/RetrieveSiteFoilLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class RetrieveSiteFoilLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 5 17 | && !Inventory.contains("Sito foil"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final String ITEM = "Grimy sito foil"; 23 | if (Inventory.contains(ITEM)) { 24 | if (Inventory.interact(ITEM, "Clean")) { 25 | Sleep.sleepUntil(() -> Inventory.contains("Sito foil"), 3000); 26 | } 27 | return Timing.loopReturn(); 28 | } 29 | 30 | return GameObjectHelper.goAndInteractWithGameObject( 31 | new Area(2787, 3051, 2794, 3046), 32 | "Scorched earth", 33 | "Search", 34 | () -> Inventory.contains(ITEM)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/obtainflour/RetrieveGrainLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant.obtainflour; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.GameObjectHelper; 9 | 10 | public class RetrieveGrainLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | final int GRAIN_TOWER_FLOUR_COUNT_VARBIT = 15 | 4920; // Indicates the quantity of flour available to take from bin in west lumbridge grain 16 | // tower 17 | return !Inventory.contains("Grain") 18 | && PlayerSettings.getBitValue(GRAIN_TOWER_FLOUR_COUNT_VARBIT) <= 0; 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area WHEAT_FIELD_AREA = 24 | new Area( 25 | new Tile(3161, 3293, 0), 26 | new Tile(3155, 3297, 0), 27 | new Tile(3154, 3305, 0), 28 | new Tile(3158, 3304, 0), 29 | new Tile(3162, 3299, 0)); 30 | return GameObjectHelper.goAndInteractWithGameObject( 31 | WHEAT_FIELD_AREA, "Wheat", "Pick", () -> Inventory.contains("Grain")); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/RetrieveAdrigalLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class RetrieveAdrigalLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 3 17 | && !Inventory.contains("Ardrigal"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final String ITEM = "Grimy ardrigal"; 23 | 24 | if (Inventory.contains(ITEM)) { 25 | if (Inventory.interact(ITEM, "Clean")) { 26 | Sleep.sleepUntil(() -> Inventory.contains("Ardrigal"), 3000); 27 | } 28 | return Timing.loopReturn(); 29 | } 30 | 31 | return GameObjectHelper.goAndInteractWithGameObject( 32 | new Area(2870, 3126, 2879, 3114), // ardrigal area 33 | "Palm tree", 34 | "Search", 35 | () -> Inventory.contains(ITEM)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/RetrieveSnakeWeedLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class RetrieveSnakeWeedLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 1 17 | && !Inventory.contains("Snake weed"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final String ITEM = "Grimy snake weed"; 23 | 24 | if (Inventory.contains(ITEM)) { 25 | if (Inventory.interact(ITEM, "Clean")) { 26 | Sleep.sleepUntil(() -> Inventory.contains("Snake weed"), 3000); 27 | } 28 | return Timing.loopReturn(); 29 | } 30 | 31 | return GameObjectHelper.goAndInteractWithGameObject( 32 | new Area(2759, 3043, 2773, 3034), 33 | "Marshy jungle vine", 34 | "Search", 35 | () -> Inventory.contains(ITEM)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/RetrieveVolenciaMossLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class RetrieveVolenciaMossLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 3 17 | && !Inventory.contains("Volencia moss"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | 23 | if (Inventory.contains("Grimy volencia moss")) { 24 | if (Inventory.interact("Grimy volencia moss", "Clean")) { 25 | Sleep.sleepUntil(() -> Inventory.contains("Volencia moss"), 3000); 26 | } 27 | return Timing.loopReturn(); 28 | } 29 | 30 | return GameObjectHelper.goAndInteractWithGameObject( 31 | new Area(2844, 3038, 2853, 3029), 32 | "Rock", 33 | "Search", 34 | () -> Inventory.contains("Grimy volencia moss")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/sheepshearer/TalkToFredLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.sheepshearer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToFredLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.SHEEP_SHEARER.getConfigID()) == 0 15 | || PlayerSettings.getConfig(FreeQuest.SHEEP_SHEARER.getConfigID()) == 1 16 | && Inventory.count("Ball of wool") >= 20 17 | || PlayerSettings.getConfig(FreeQuest.SHEEP_SHEARER.getConfigID()) == 20; 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final Area FARMER_FRED_FARM_AREA = new Area(3183, 3280, 3192, 3270); 23 | final String FRED_NAME = "Fred the Farmer"; 24 | final String[] DIALOGUE_OPTIONS = { 25 | "I'm looking for a quest.", 26 | "Yes, okay. I can do that.", 27 | "Yes.", 28 | "I need to talk to you about shearing these sheep!" 29 | }; 30 | return NPCHelper.goAndTalkToNpc(FARMER_FRED_FARM_AREA, FRED_NAME, DIALOGUE_OPTIONS); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/RetrieveRoguesPurseLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class RetrieveRoguesPurseLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 9 17 | && !Inventory.contains("Rogue's purse"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | final String ITEM = "Grimy rogue's purse"; 23 | if (Inventory.contains(ITEM)) { 24 | if (Inventory.interact(ITEM, "Clean")) { 25 | Sleep.sleepUntil(() -> Inventory.contains("Rogue's purse"), 3000); 26 | } 27 | return Timing.loopReturn(); 28 | } 29 | 30 | return GameObjectHelper.goAndInteractWithGameObject( 31 | new Area(2870, 3126, 2879, 3114), // adrigal area 32 | "Palm tree", 33 | "Search", 34 | () -> Inventory.contains(ITEM)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/ClueStepFourLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.WalkingHelper; 12 | 13 | public class ClueStepFourLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 5 17 | && Inventory.contains("Treasure scroll"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | 23 | final Area CLUE_FOUR_AREA = new Area(3075, 3261, 3079, 3259); 24 | 25 | if (!WalkingHelper.walkToArea(CLUE_FOUR_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | Timing.sleepForDelay(); 29 | if (Inventory.interact("Spade", "Dig")) { 30 | if (Sleep.sleepUntil(() -> Players.getLocal().isAnimating(), 3000)) { 31 | Sleep.sleepUntil(() -> !Players.getLocal().isAnimating(), 3000); 32 | } 33 | } 34 | return Timing.loopReturn(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/ClueStepOneLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.WalkingHelper; 12 | 13 | public class ClueStepOneLeaf extends Leaf { 14 | 15 | @Override 16 | public boolean isValid() { 17 | return PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 2 18 | && Inventory.contains("Treasure scroll"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area CLUE_ONE_AREA = new Area(3230, 3209, 3230, 3209); 24 | 25 | if (!WalkingHelper.walkToArea(CLUE_ONE_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | 29 | Timing.sleepForDelay(); 30 | if (Inventory.interact("Spade", "Dig")) { 31 | if (Sleep.sleepUntil(() -> Players.getLocal().isAnimating(), 3000)) { 32 | Sleep.sleepUntil(() -> !Players.getLocal().isAnimating(), 3000); 33 | } 34 | } 35 | return Timing.loopReturn(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/ClueStepThreeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.WalkingHelper; 12 | 13 | public class ClueStepThreeLeaf extends Leaf { 14 | 15 | @Override 16 | public boolean isValid() { 17 | return PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 4 18 | && Inventory.contains("Mysterious orb"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area CLUE_THREE_AREA = new Area(3109, 3263, 3109, 3263); 24 | if (!WalkingHelper.walkToArea(CLUE_THREE_AREA)) { 25 | return Timing.getSleepDelay(); 26 | } 27 | 28 | Timing.sleepForDelay(); 29 | if (Inventory.interact("Spade", "Dig")) { 30 | if (Sleep.sleepUntil(() -> Players.getLocal().isAnimating(), 3000)) { 31 | Sleep.sleepUntil(() -> !Players.getLocal().isAnimating(), 3000); 32 | } 33 | } 34 | return Timing.loopReturn(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/GoToFortressLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 4 | import org.dreambot.api.methods.container.impl.equipment.EquipmentSlot; 5 | import org.dreambot.api.methods.interactive.Players; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.WalkingHelper; 12 | 13 | public class GoToFortressLeaf extends Leaf { 14 | 15 | @Override 16 | public boolean isValid() { 17 | final Area FORTRESS_ENTRANCE_AREA = new Area(3014, 3513, 3017, 3512); 18 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 1 19 | && !FORTRESS_ENTRANCE_AREA.contains(Players.getLocal()) 20 | && !Equipment.slotContains(EquipmentSlot.HAT, "Bronze med helm") 21 | || !Equipment.slotContains(EquipmentSlot.CHEST, "Iron chainbody"); 22 | } 23 | 24 | @Override 25 | public int onLoop() { 26 | final Area FORTRESS_ENTRANCE_AREA = new Area(3014, 3513, 3017, 3512); 27 | WalkingHelper.walkToArea(FORTRESS_ENTRANCE_AREA); 28 | return Timing.getSleepDelay(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/ClueStepTwoLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.WalkingHelper; 12 | 13 | public class ClueStepTwoLeaf extends Leaf { 14 | 15 | @Override 16 | public boolean isValid() { 17 | return PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 3 18 | && Inventory.contains("Treasure scroll"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area CLUE_TWO_AREA = new Area(3203, 3213, 3203, 3213); 24 | 25 | if (!WalkingHelper.walkToArea(CLUE_TWO_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | 29 | Timing.sleepForDelay(); 30 | if (Inventory.interact("Spade", "Dig")) { 31 | if (Sleep.sleepUntil(() -> Players.getLocal().isAnimating(), 3000)) { 32 | Sleep.sleepUntil(() -> !Players.getLocal().isAnimating(), 3000); 33 | } 34 | } 35 | 36 | return Timing.loopReturn(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/xmarksthespot/TalkToVeosLumbridgeLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.xmarksthespot; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToVeosLumbridgeLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return Inventory.contains("Spade") 15 | && PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 0 16 | || PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 1 17 | || PlayerSettings.getBitValue(FreeQuest.X_MARKS_THE_SPOT.getVarBitID()) == 2 18 | && !Inventory.contains("Treasure scroll"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area VEOS_AREA = new Area(3226, 3242, 3233, 3239); 24 | final String VEOS_NAME = "Veos"; 25 | final String[] DIALOGUE_OPTIONS = { 26 | "I'm looking for a quest.", 27 | "Sounds good, what should I do?", 28 | "Okay, thanks Veos.", 29 | "Yes.", 30 | "Can I help?" 31 | }; 32 | return NPCHelper.goAndTalkToNpc(VEOS_AREA, VEOS_NAME, DIALOGUE_OPTIONS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/therestlessghost/RetrieveGhostHeadLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.therestlessghost; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.GameObjects; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.GameObject; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.WalkingHelper; 14 | 15 | public class RetrieveGhostHeadLeaf extends Leaf { 16 | 17 | @Override 18 | public boolean isValid() { 19 | return PlayerSettings.getConfig(FreeQuest.THE_RESTLESS_GHOST.getConfigID()) == 3 20 | && !Inventory.contains("Skull"); 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | if (!WalkingHelper.walkToArea(new Area(3112, 9569, 3121, 9564))) { // altar area 26 | return Timing.getSleepDelay(); 27 | } 28 | 29 | GameObject altar = GameObjects.closest("Altar"); 30 | if (altar != null && Interaction.delayEntityInteract(altar, "Search")) { 31 | Sleep.sleepUntil(() -> Inventory.contains("Skull"), 3000); 32 | } 33 | return Timing.loopReturn(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/SmuggleState.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | 7 | public class SmuggleState { 8 | /** 9 | * Variables that hold persistent values within the lifespan of the script 10 | */ 11 | public static boolean talkedLuthasBeforeBananas = false; 12 | 13 | public static boolean talkedLuthasAfterBananas = false; 14 | public static boolean filledCrateWithBananas = false; 15 | public static boolean stashedRum = false; 16 | public static boolean crateSent = false; 17 | public static boolean atStart = true; 18 | 19 | public static boolean haveShippedRum() { 20 | return crateSent && stashedRum; 21 | } 22 | 23 | public static boolean isOnKaramja() { 24 | final Area karamjaZone1 = new Area(2688, 3235, 2903, 2879); 25 | final Area karamjaZone2 = new Area(2903, 2879, 2964, 3187); 26 | final Area karamjaBoat = new Area(2964, 3138, 2951, 3144, 1); 27 | return karamjaZone1.contains(Players.getLocal()) 28 | || karamjaZone2.contains(Players.getLocal()) 29 | || karamjaBoat.contains(Players.getLocal()); 30 | } 31 | 32 | public static boolean hasRumOffKaramja() { 33 | return Inventory.contains("Karamjan rum") && !isOnKaramja(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/RetrieveTinderboxCorsairCurseLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.Players; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.map.Tile; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.helpers.GroundItemHelper; 11 | 12 | public class RetrieveTinderboxCorsairCurseLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return !Inventory.contains("Tinderbox") 17 | && (new Area(2543, 2864, 2547, 2860, 1).contains(Players.getLocal()) 18 | || // Gnocci upstairs area 19 | (PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 30 20 | || PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 35 21 | || PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 40 22 | || PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 45)); 23 | } 24 | 25 | @Override 26 | public int onLoop() { 27 | return GroundItemHelper.pickupGroundSpawn( 28 | new Tile(2543, 2862, 1), "Tinderbox"); // gnocci upstairs tinderbox spawn 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/RetrieveSmuggledRumLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.interactive.GameObjects; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.methods.map.Tile; 9 | import org.dreambot.api.utilities.Sleep; 10 | import org.dreambot.api.wrappers.interactive.GameObject; 11 | import org.dreambot.framework.Leaf; 12 | import org.dreambot.utilities.Timing; 13 | 14 | public class RetrieveSmuggledRumLeaf extends Leaf { 15 | @Override 16 | public boolean isValid() { 17 | final Area FOOD_SHOP_INNER_AREA = new Area(3009, 3210, 3011, 3203, 0); 18 | return FOOD_SHOP_INNER_AREA.contains(Players.getLocal()) && !Inventory.contains("Karamjan rum"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Tile RUM_CRATE_TILE = new Tile(3009, 3207, 0); 24 | GameObject rumCrate = 25 | GameObjects.closest(g -> g.getTile().equals(RUM_CRATE_TILE) && g.getName().equals("Crate")); 26 | if (rumCrate != null && rumCrate.interact("Search")) { 27 | Sleep.sleepUntil( 28 | () -> Dialogues.inDialogue(), () -> Players.getLocal().isMoving(), 8000, 100); 29 | } 30 | return Timing.loopReturn(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/RetrieveWhiteApronLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.api.utilities.Logger; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GroundItemHelper; 11 | 12 | public class RetrieveWhiteApronLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return SmuggleState.haveShippedRum() && !Equipment.contains("White apron"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | if (!Equipment.contains("White apron") && Inventory.contains("White apron")) { 22 | Timing.sleepForDelay(); 23 | if (Inventory.interact("White apron", "Wear")) { 24 | Sleep.sleepUntil(() -> Equipment.contains("White apron"), 3000); 25 | } 26 | return Timing.loopReturn(); 27 | } 28 | 29 | if (Inventory.isFull()) { 30 | Logger.log("Inventory is full! Please empty to continue quest..."); 31 | return -1; 32 | } 33 | final Tile SARIM_WHITE_APRON_SPAWN = new Tile(3016, 3229, 0); 34 | return GroundItemHelper.pickupGroundSpawn(SARIM_WHITE_APRON_SPAWN, "White apron"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/TalkToRedbeardFrankLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.quests.freequests.piratestreasure.smugglerum.SmuggleState; 9 | import org.dreambot.utilities.helpers.NPCHelper; 10 | 11 | public class TalkToRedbeardFrankLeaf extends Leaf { 12 | 13 | @Override 14 | public boolean isValid() { 15 | return PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 0 16 | && Inventory.contains("Coins") 17 | || PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 1 18 | && !SmuggleState.isOnKaramja() 19 | && Inventory.contains("Karamjan rum") 20 | || PlayerSettings.getConfig(FreeQuest.PIRATES_TREASURE.getConfigID()) == 2 21 | && !Inventory.contains("Chest key"); 22 | } 23 | 24 | @Override 25 | public int onLoop() { 26 | final Area RED_BEARD_FRANK_AREA = new Area(3049, 3254, 3054, 3249); 27 | final String[] DIALOGUE_OPTIONS = { 28 | "I'm in search of treasure.", "Yes.", "Ok, I will bring you some rum" 29 | }; 30 | return NPCHelper.goAndTalkToNpc(RED_BEARD_FRANK_AREA, "Redbeard Frank", DIALOGUE_OPTIONS); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/cooksassistant/RetrieveBucketOfMilkLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.cooksassistant; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.helpers.GameObjectHelper; 10 | import org.dreambot.utilities.helpers.GroundItemHelper; 11 | 12 | public class RetrieveBucketOfMilkLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return (PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 0 17 | || PlayerSettings.getConfig(FreeQuest.COOKS_ASSISTANT.getConfigID()) == 1) 18 | && !Inventory.contains("Bucket of milk"); 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | if (!Inventory.contains("Bucket")) { 24 | final Tile BUCKET_LUMBRIDGE_SPAWN = new Tile(3216, 9625, 0); 25 | return GroundItemHelper.pickupGroundSpawn(BUCKET_LUMBRIDGE_SPAWN, "Bucket"); 26 | } 27 | 28 | final Area DAIRY_COW_WEST_LUMBRIDGE_AREA = new Area(3171, 3322, 3177, 3316, 0); 29 | return GameObjectHelper.goAndInteractWithGameObject( 30 | DAIRY_COW_WEST_LUMBRIDGE_AREA, 31 | "Dairy cow", 32 | "Milk", 33 | () -> Inventory.contains("Bucket of milk")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/romeoandjuliet/TalkToRomeoLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.romeoandjuliet; 2 | 3 | import org.dreambot.api.Client; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.NPCHelper; 11 | 12 | public class TalkToRomeoLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 0 17 | || PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 20 18 | || PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 60; 19 | } 20 | 21 | @Override 22 | public int onLoop() { 23 | final Area ROMEO_AREA = new Area(3205, 3438, 3223, 3422); 24 | final String[] DIALOGUE_OPTIONS = { 25 | "Yes, I have seen her actually!", "Yes, ok, I'll let her know.", "Yes." 26 | }; 27 | if (!Client.isInCutscene()) { 28 | return NPCHelper.goAndTalkToNpc(ROMEO_AREA, "Romeo", DIALOGUE_OPTIONS); 29 | } 30 | 31 | if (Dialogues.inDialogue()) { 32 | if (Dialogues.canContinue()) { 33 | Timing.sleepForDelay(); 34 | Dialogues.continueDialogue(); 35 | } 36 | } 37 | return Timing.loopReturn(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/helpers/ShopHelper.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.helpers; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.Shop; 5 | import org.dreambot.api.methods.interactive.NPCs; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.NPC; 10 | import org.dreambot.api.wrappers.items.Item; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | 14 | public class ShopHelper { 15 | public static int purchaseFromShop(Area area, String itemName, int quantity, String npcName) { 16 | if (!WalkingHelper.walkToArea(area)) { 17 | return Timing.getSleepDelay(); 18 | } 19 | if (Shop.isOpen()) { 20 | Item item = Shop.get(itemName); 21 | if (item != null && item.isValid() && item.getAmount() > 0) { 22 | Timing.sleepForDelay(); 23 | if (Shop.purchase(itemName, quantity)) { 24 | Sleep.sleepUntil(() -> Inventory.contains(itemName), 3000); 25 | } 26 | } 27 | return Timing.loopReturn(); 28 | } 29 | 30 | NPC shopAssistant = NPCs.closest(npcName); 31 | if (shopAssistant != null && Interaction.delayEntityInteract(shopAssistant, "Trade")) { 32 | Sleep.sleepUntil(() -> Shop.isOpen(), () -> Players.getLocal().isMoving(), 3000, 100); 33 | } 34 | return Timing.loopReturn(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/runemysteries/TalkToArchmageLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.runemysteries; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToArchmageLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 1 15 | && Inventory.contains("Air talisman") 16 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 2 17 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 3 18 | && !Inventory.contains("Research package") 19 | || PlayerSettings.getConfig(FreeQuest.RUNE_MYSTERIES.getConfigID()) == 5 20 | && Inventory.contains("Research notes"); 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | final Area WIZARD_TOWER_AREA = new Area(3099, 9574, 3107, 9569); 26 | final String ARCHMAGE_SEDRIDOR_NAME = "Archmage Sedridor"; 27 | final String[] DIALOGUE_OPTIONS = { 28 | "I'm looking for the head wizard.", "Okay, here you are.", "Go ahead.", "Yes, certainly." 29 | }; 30 | return NPCHelper.goAndTalkToNpc(WIZARD_TOWER_AREA, ARCHMAGE_SEDRIDOR_NAME, DIALOGUE_OPTIONS); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/framework/unbankables/UnbankableItemsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.framework.unbankables; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.utilities.Logger; 5 | import org.dreambot.api.wrappers.items.Item; 6 | import org.dreambot.framework.Leaf; 7 | import org.dreambot.utilities.API; 8 | import org.dreambot.utilities.Interaction; 9 | import org.dreambot.utilities.Timing; 10 | 11 | public class UnbankableItemsLeaf extends Leaf { 12 | @Override 13 | public boolean isValid() { 14 | return Inventory.contains( 15 | "Antique lamp", 16 | "Lamp", 17 | "Lamp of knowledge", 18 | "Lamp of the gatherer", 19 | "Kourend favour certificate") 20 | || API.lastGameMessage.contains("Your items cannot be stored in the bank."); 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | Logger.log( 26 | "Found unbankable items in inventory! Script is currently not able to handle them, so" 27 | + " script is stopping to let you consume them"); 28 | 29 | return -1; 30 | } 31 | 32 | // methods to handle them anyways since I had an antique lamp 33 | public static boolean haveRegularLamp() { 34 | return Inventory.contains("Antique lamp", "Lamp"); 35 | } 36 | 37 | public static void rubRegularLamp() { 38 | Item lamp = Inventory.get("Antique lamp", "Lamp"); 39 | if (Interaction.delayInventoryInteract(lamp.getName(), "Rub")) { 40 | Timing.loopReturn(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/FillCrateWithBananasLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.map.Tile; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.DialogueHelper; 9 | import org.dreambot.utilities.helpers.GameObjectHelper; 10 | 11 | public class FillCrateWithBananasLeaf extends Leaf { 12 | @Override 13 | public boolean isValid() { 14 | return !SmuggleState.filledCrateWithBananas 15 | && Inventory.count("Banana") >= 10 16 | && SmuggleState.isOnKaramja(); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | if (Dialogues.inDialogue()) { 22 | String dialog = DialogueHelper.getDialogue(); 23 | if (dialog != null && dialog.contains("You pack all your bananas into the crate")) { 24 | SmuggleState.filledCrateWithBananas = true; 25 | } 26 | } 27 | final Area CRATE_AREA = 28 | new Area( 29 | new Tile(2936, 3151, 0), 30 | new Tile(2936, 3149, 0), 31 | new Tile(2945, 3149, 0), 32 | new Tile(2945, 3156, 0), 33 | new Tile(2942, 3156, 0), 34 | new Tile(2942, 3152, 0)); 35 | return GameObjectHelper.goAndInteractWithGameObject( 36 | CRATE_AREA, "Crate", "Fill", () -> Dialogues.inDialogue()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/RetrieveSecondKeyLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.FreeQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | /** 13 | * This class retrieves the Silverlight key from the Varrock sewers. 14 | */ 15 | public class RetrieveSecondKeyLeaf extends Leaf { 16 | @Override 17 | public boolean isValid() { 18 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 19 | && PlayerSettings.getBitValue(2568) 20 | == 1; // Player setting to determine if a player has poured water in the drain. 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | if (Inventory.contains("Bucket")) { 26 | Inventory.drop("Bucket"); 27 | Sleep.sleepUntil(() -> !Inventory.contains("Bucket"), 3000); 28 | return Timing.loopReturn(); 29 | } 30 | final Area VARROCK_SEWER = 31 | new Area( 32 | 3224, 9899, 3232, 33 | 9896); // This is where the key spawns after pouring water in the drain. 34 | return GameObjectHelper.goAndInteractWithGameObject( 35 | VARROCK_SEWER, "Rusty key", "Take", () -> Inventory.contains("Rusty key")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/utilities/loadouts/EquipmentItem.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.utilities.loadouts; 2 | 3 | import org.dreambot.api.methods.container.impl.equipment.EquipmentSlot; 4 | import org.dreambot.api.utilities.impl.Condition; 5 | 6 | public class EquipmentItem { 7 | private final String name; 8 | private final EquipmentSlot slot; 9 | private final int attLvl; 10 | private final int strLvl; 11 | private final int defLvl; 12 | private final Condition otherCondition; 13 | 14 | public EquipmentItem( 15 | String name, 16 | EquipmentSlot slot, 17 | int attLvl, 18 | int strLvl, 19 | int defLvl, 20 | Condition otherCondition) { 21 | this.name = name; 22 | this.slot = slot; 23 | this.attLvl = attLvl; 24 | this.strLvl = strLvl; 25 | this.defLvl = defLvl; 26 | this.otherCondition = otherCondition; 27 | } 28 | 29 | public EquipmentItem(String name, EquipmentSlot slot) { 30 | this.name = name; 31 | this.slot = slot; 32 | this.attLvl = 1; 33 | this.strLvl = 1; 34 | this.defLvl = 1; 35 | this.otherCondition = () -> true; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public EquipmentSlot getSlot() { 43 | return slot; 44 | } 45 | 46 | public int getAttLvl() { 47 | return attLvl; 48 | } 49 | 50 | public int getStrLvl() { 51 | return strLvl; 52 | } 53 | 54 | public int getDefLvl() { 55 | return defLvl; 56 | } 57 | 58 | public Condition getOtherCondition() { 59 | return otherCondition; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/retrieveitems/RetrieveGoblinMailLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy.retrieveitems; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.NPCHelper; 14 | 15 | public class RetrieveGoblinMailLeaf extends Leaf { 16 | @Override 17 | public boolean isValid() { 18 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 19 | && Inventory.count(item -> item.getName().endsWith("mail")) < 3; 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | final Area GOBLIN_AREA = new Area(3243, 3241, 3261, 3227); // Lumbridge goblin area. 25 | GroundItem goblinMail = 26 | GroundItems.closest( 27 | item -> item.getName().equals("Goblin mail") && GOBLIN_AREA.contains(item)); 28 | if (goblinMail != null) { 29 | if (Interaction.delayEntityInteract(goblinMail, "Take")) { 30 | Sleep.sleep(2000, 3000); 31 | } 32 | return Timing.loopReturn(); 33 | } 34 | return NPCHelper.goAndKillNpc(GOBLIN_AREA, "Goblin"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/romeoandjuliet/TalkToJulietLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.romeoandjuliet; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.NPCHelper; 11 | 12 | public class TalkToJulietLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 10 17 | || PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 50 18 | && Inventory.contains("Cadava potion") 19 | || PlayerSettings.getConfig(FreeQuest.ROMEO_AND_JULIET.getConfigID()) == 50 20 | && PlayerSettings.getBitValue(12139) == 1; 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | if (PlayerSettings.getBitValue(12139) == 0) { 26 | final Area JULIET_AREA = new Area(3155, 3426, 3161, 3425, 1); 27 | final String[] DIALOGUE_OPTIONS = {"Ok, thanks."}; 28 | return NPCHelper.goAndTalkToNpc(JULIET_AREA, "Juliet", DIALOGUE_OPTIONS); 29 | } 30 | if (Dialogues.inDialogue()) { 31 | if (Dialogues.canContinue()) { 32 | Timing.sleepForDelay(); 33 | Dialogues.continueDialogue(); 34 | } 35 | } 36 | return Timing.loopReturn(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/MixSardineAndDoogleLeavesLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.api.wrappers.items.Item; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Interaction; 11 | import org.dreambot.utilities.Timing; 12 | 13 | public class MixSardineAndDoogleLeavesLeaf extends Leaf { 14 | @Override 15 | public boolean isValid() { 16 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 3 17 | && Inventory.containsAll("Doogle leaves", "Raw sardine"); 18 | } 19 | 20 | @Override 21 | public int onLoop() { 22 | if (Dialogues.inDialogue()) { 23 | if (Dialogues.canContinue()) { 24 | Dialogues.continueDialogue(); 25 | Sleep.sleepUntil(() -> Dialogues.isProcessing(), 3000); 26 | } 27 | return Timing.loopReturn(); 28 | } 29 | Item doogle = Inventory.get("Doogle leaves"); 30 | Item sardine = Inventory.get("Raw sardine"); 31 | if (doogle != null 32 | && doogle.isValid() 33 | && sardine != null 34 | && sardine.isValid() 35 | && Interaction.delayUseItemOn(doogle, sardine)) { 36 | Sleep.sleepUntil(() -> Inventory.contains("Seasoned sardine"), 3000); 37 | } 38 | return Timing.loopReturn(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/blackknightsfortress/EnterFortressLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.blackknightsfortress; 2 | 3 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 4 | import org.dreambot.api.methods.interactive.GameObjects; 5 | import org.dreambot.api.methods.interactive.Players; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.api.utilities.Sleep; 10 | import org.dreambot.api.wrappers.interactive.GameObject; 11 | import org.dreambot.framework.Leaf; 12 | import org.dreambot.utilities.Timing; 13 | 14 | public class EnterFortressLeaf extends Leaf { 15 | 16 | @Override 17 | public boolean isValid() { 18 | 19 | final Area FORTRESS_ENTRANCE_AREA = new Area(3014, 3513, 3017, 3512); 20 | return PlayerSettings.getConfig(FreeQuest.BLACK_KNIGHTS_FORTRESS.getConfigID()) == 1 21 | && FORTRESS_ENTRANCE_AREA.contains(Players.getLocal()) 22 | && Equipment.containsAll("Iron chainbody", "Bronze med helm"); 23 | } 24 | 25 | @Override 26 | public int onLoop() { 27 | final Area INSIDE_FORTRESS_AREA = new Area(3015, 3516, 3017, 3515); 28 | 29 | if (!INSIDE_FORTRESS_AREA.contains(Players.getLocal())) { 30 | GameObject sturdyDoor = GameObjects.closest("Sturdy door"); 31 | if (sturdyDoor != null && sturdyDoor.interact("Open")) { 32 | Sleep.sleepUntil(() -> INSIDE_FORTRESS_AREA.contains(Players.getLocal()), 3000); 33 | } 34 | } 35 | return Timing.loopReturn(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/TalkToArisLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.Client; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.dialogues.Dialogues; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.framework.Leaf; 10 | import org.dreambot.utilities.Timing; 11 | import org.dreambot.utilities.helpers.NPCHelper; 12 | 13 | /** 14 | * This class enables the local player to speak with Aris to begin the quest. 15 | */ 16 | public class TalkToArisLeaf extends Leaf { 17 | @Override 18 | public boolean isValid() { 19 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 0 20 | && Inventory.contains("Coins"); 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | if (Client.isInCutscene()) { 26 | if (Dialogues.inDialogue()) { 27 | if (Dialogues.canContinue()) { 28 | Dialogues.continueDialogue(); 29 | return Timing.loopReturn(); 30 | } 31 | } 32 | } 33 | 34 | final Area ARIS_AREA = 35 | new Area(3200, 3427, 3206, 3421); // This is where Aris can be found (Varrock Square). 36 | final String[] DIALOGUE_OPTIONS = { 37 | "Yes.", 38 | "Ok, here you go.", 39 | "Okay, where is he? I'll kill him for you!", 40 | "So how did Wally kill Delrith?" 41 | }; 42 | return NPCHelper.goAndTalkToNpc(ARIS_AREA, "Aris", DIALOGUE_OPTIONS); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/witchspotion/RetrieveOnion.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.witchspotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.GameObjects; 5 | import org.dreambot.api.methods.interactive.Players; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.api.utilities.Sleep; 10 | import org.dreambot.api.wrappers.interactive.GameObject; 11 | import org.dreambot.framework.Leaf; 12 | import org.dreambot.utilities.Interaction; 13 | import org.dreambot.utilities.Timing; 14 | import org.dreambot.utilities.helpers.WalkingHelper; 15 | 16 | public class RetrieveOnion extends Leaf { 17 | @Override 18 | public boolean isValid() { 19 | return PlayerSettings.getConfig(FreeQuest.WITCHS_POTION.getConfigID()) == 1 20 | && !Inventory.contains("Onion"); 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | final Area ONION_AREA = new Area(2955, 3254, 2945, 3248, 0); 26 | if (!WalkingHelper.walkToArea(ONION_AREA)) { 27 | return Timing.getSleepDelay(); 28 | } 29 | 30 | GameObject onion = GameObjects.closest("Onion"); 31 | if (onion != null && onion.exists() && Interaction.delayEntityInteract(onion, "Pick")) { 32 | Sleep.sleepUntil( 33 | () -> Inventory.contains("Onion"), 34 | () -> Players.getLocal().isMoving() || Players.getLocal().isAnimating(), 35 | 3000, 36 | 100); 37 | } 38 | return Timing.loopReturn(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/miniquests/alfredgrimhandsbarcrawl/TalkToBarbarianGuardsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.miniquests.alfredgrimhandsbarcrawl; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.api.methods.map.Tile; 5 | import org.dreambot.api.methods.quest.book.MiniQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToBarbarianGuardsLeaf extends Leaf { 11 | 12 | @Override 13 | public boolean isValid() { 14 | return PlayerSettings.getConfig(MiniQuest.ALFRED_GRIMHANDS_BARCRAWL.getConfigID()) == 0 15 | || AlfredGrimhandsBarcrawl.finishedCard; 16 | } 17 | 18 | @Override 19 | public int onLoop() { 20 | 21 | final Area BARBARIAN_GUARDS_AREA = 22 | new Area( 23 | new Tile(2549, 3574, 0), 24 | new Tile(2549, 3579, 0), 25 | new Tile(2539, 3579, 0), 26 | new Tile(2538, 3572, 0), 27 | new Tile(2540, 3571, 0), 28 | new Tile(2540, 3569, 0), 29 | new Tile(2539, 3570, 0), 30 | new Tile(2539, 3563, 0), 31 | new Tile(2545, 3562, 0), 32 | new Tile(2546, 3574, 0)); 33 | return NPCHelper.goAndTalkToNpc( 34 | BARBARIAN_GUARDS_AREA, 35 | "Barbarian guard", 36 | new String[] { 37 | "I want to come through this gate.", 38 | "Looks can be deceiving, I am in fact a barbarian.", 39 | "Sorry, I'm a bit busy.", 40 | "Yes please, I want to smash my vials." 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/goblindiplomacy/TalkToGeneralWartfaceLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.goblindiplomacy; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.helpers.NPCHelper; 10 | 11 | public class TalkToGeneralWartfaceLeaf extends Leaf { 12 | 13 | @Override 14 | public boolean isValid() { 15 | return PlayerSettings.getBitValue(FreeQuest.GOBLIN_DIPLOMACY.getVarBitID()) == 0 16 | && Inventory.containsAll("Blue goblin mail", "Orange goblin mail", "Goblin mail"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | final Area GENERAL_WARTFACE_AREA = 22 | new Area( 23 | new Tile[] { 24 | new Tile(2954, 3510, 0), 25 | new Tile(2961, 3510, 0), 26 | new Tile(2961, 3514, 0), 27 | new Tile(2957, 3514, 0), 28 | new Tile(2954, 3512, 0) 29 | }); 30 | final String[] DIALOGUE_OPTIONS = { 31 | "So how is life for the goblins?", 32 | "Yes, Wartface looks fat", 33 | "Do you want me to pick an armour colour for you?", 34 | "What about a different colour?", 35 | "I have some orange armour here", 36 | "No he doesn't look fat", 37 | "Yes." 38 | }; 39 | 40 | return NPCHelper.goAndTalkToNpc(GENERAL_WARTFACE_AREA, "General Wartface", DIALOGUE_OPTIONS); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/RetrieveIronLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.interactive.GameObjects; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.GameObject; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.WalkingHelper; 14 | 15 | public class RetrieveIronLeaf extends Leaf { 16 | 17 | @Override 18 | public boolean isValid() { 19 | return Inventory.count("Iron ore") < 2; 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | final Area RIMMINGTON_IRON_ROCKS_AREA = new Area(2972, 3236, 2967, 3243, 0); 25 | if (!WalkingHelper.walkToArea(RIMMINGTON_IRON_ROCKS_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | GameObject rock = 29 | GameObjects.closest( 30 | g -> 31 | RIMMINGTON_IRON_ROCKS_AREA.contains(g) 32 | && Arrays.stream(new int[] {11364, 11365}).anyMatch(i -> i == g.getID())); 33 | if (rock != null && rock.exists() && Interaction.delayEntityInteract(rock, "Mine")) { 34 | int count = Inventory.getEmptySlots(); 35 | Sleep.sleepUntil( 36 | () -> Inventory.getEmptySlots() != count, 37 | () -> Players.getLocal().isAnimating(), 38 | 3000, 39 | 100); 40 | } 41 | return Timing.loopReturn(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/RetrieveClayLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.interactive.GameObjects; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.GameObject; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.WalkingHelper; 14 | 15 | public class RetrieveClayLeaf extends Leaf { 16 | 17 | @Override 18 | public boolean isValid() { 19 | return Inventory.count("Clay") < 6; 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | final Area RIMMINGTON_CLAY_ROCKS_AREA = new Area(2985, 3241, 2988, 3238, 0); 25 | if (!WalkingHelper.walkToArea(RIMMINGTON_CLAY_ROCKS_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | 29 | GameObject rock = 30 | GameObjects.closest( 31 | g -> 32 | RIMMINGTON_CLAY_ROCKS_AREA.contains(g) 33 | && Arrays.stream(new int[] {11362, 11363}).anyMatch(i -> i == g.getID())); 34 | if (rock != null && rock.exists() && Interaction.delayEntityInteract(rock, "Mine")) { 35 | int count = Inventory.getEmptySlots(); 36 | Sleep.sleepUntil( 37 | () -> Inventory.getEmptySlots() != count, 38 | () -> Players.getLocal().isAnimating(), 39 | 3000, 40 | 100); 41 | } 42 | return Timing.loopReturn(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/KillGoblinsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.item.GroundItems; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.items.GroundItem; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.NPCHelper; 14 | 15 | /** 16 | * This class kills 25 goblins and collects their bones. 17 | */ 18 | public class KillGoblinsLeaf extends Leaf { 19 | @Override 20 | public boolean isValid() { 21 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 22 | && Inventory.containsAll(2401, 2400) 23 | && // Silverlight key IDS. 24 | Inventory.count("Bones") < 25 25 | && !Inventory.containsAll(2399); // Silverlight key ID that is to be obtained. 26 | } 27 | 28 | @Override 29 | public int onLoop() { 30 | final Area GOBLIN_AREA = new Area(3243, 3241, 3261, 3227); // Lumbridge goblin area. 31 | GroundItem bones = 32 | GroundItems.closest(item -> item.getName().equals("Bones") && GOBLIN_AREA.contains(item)); 33 | if (bones != null) { 34 | if (Interaction.delayEntityInteract(bones, "Take")) { 35 | Sleep.sleep(2000, 3000); 36 | } 37 | return Timing.loopReturn(); 38 | } 39 | return NPCHelper.goAndKillNpc(GOBLIN_AREA, "Goblin"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/doricsquest/RetrieveCopperLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.doricsquest; 2 | 3 | import java.util.Arrays; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.interactive.GameObjects; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.GameObject; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.Timing; 13 | import org.dreambot.utilities.helpers.WalkingHelper; 14 | 15 | public class RetrieveCopperLeaf extends Leaf { 16 | 17 | @Override 18 | public boolean isValid() { 19 | return Inventory.count("Copper ore") < 4; 20 | } 21 | 22 | @Override 23 | public int onLoop() { 24 | final Area RIMMINGTON_COPPER_ROCKS_AREA = new Area(2975, 3249, 2980, 3246, 0); 25 | if (!WalkingHelper.walkToArea(RIMMINGTON_COPPER_ROCKS_AREA)) { 26 | return Timing.getSleepDelay(); 27 | } 28 | GameObject rock = 29 | GameObjects.closest( 30 | g -> 31 | RIMMINGTON_COPPER_ROCKS_AREA.contains(g) 32 | && Arrays.stream(new int[] {11161, 10943}).anyMatch(i -> i == g.getID())); 33 | if (rock != null && rock.exists() && Interaction.delayEntityInteract(rock, "Mine")) { 34 | int count = Inventory.getEmptySlots(); 35 | Sleep.sleepUntil( 36 | () -> Inventory.getEmptySlots() != count, 37 | () -> Players.getLocal().isAnimating(), 38 | 3000, 39 | 100); 40 | } 41 | return Timing.loopReturn(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/BurnIthoiLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse; 2 | 3 | import org.dreambot.api.Client; 4 | import org.dreambot.api.methods.container.impl.Inventory; 5 | import org.dreambot.api.methods.interactive.GameObjects; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.methods.quest.book.FreeQuest; 9 | import org.dreambot.api.methods.settings.PlayerSettings; 10 | import org.dreambot.api.utilities.Sleep; 11 | import org.dreambot.api.wrappers.interactive.GameObject; 12 | import org.dreambot.api.wrappers.items.Item; 13 | import org.dreambot.framework.Leaf; 14 | import org.dreambot.utilities.Timing; 15 | import org.dreambot.utilities.helpers.WalkingHelper; 16 | 17 | public class BurnIthoiLeaf extends Leaf { 18 | @Override 19 | public boolean isValid() { 20 | return PlayerSettings.getBitValue(FreeQuest.CORSAIR_CURSE.getVarBitID()) == 45; 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | if (!WalkingHelper.walkToArea( 26 | new Area(2527, 2840, 2534, 2833, 0))) { // driftwood area under ithoi's house 27 | return Timing.getSleepDelay(); 28 | } 29 | 30 | GameObject driftwood = GameObjects.closest("Driftwood"); 31 | if (driftwood != null && driftwood.exists()) { 32 | Item tinderbox = Inventory.get("Tinderbox"); 33 | if (tinderbox.useOn(driftwood)) { 34 | Sleep.sleepUntil( 35 | () -> Client.isDynamicRegion() || Client.isInCutscene(), 36 | () -> Players.getLocal().isMoving(), 37 | 8000, 38 | 100); 39 | } 40 | } 41 | return Timing.loopReturn(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/junglepotion/TalkToTrufitusLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.junglepotion; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.quest.book.PaidQuest; 6 | import org.dreambot.api.methods.settings.PlayerSettings; 7 | import org.dreambot.framework.Leaf; 8 | import org.dreambot.utilities.helpers.NPCHelper; 9 | 10 | public class TalkToTrufitusLeaf extends Leaf { 11 | @Override 12 | public boolean isValid() { 13 | return PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 0 14 | || PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 1 15 | && Inventory.contains("Snake weed") 16 | || PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 4 17 | && Inventory.contains("Ardrigal") 18 | || PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 6 19 | && Inventory.contains("Sito foil") 20 | || PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 8 21 | && Inventory.contains("Volencia moss") 22 | || PlayerSettings.getConfig(PaidQuest.JUNGLE_POTION.getConfigID()) == 10 23 | && Inventory.contains("Rogue's purse"); 24 | } 25 | 26 | @Override 27 | public int onLoop() { 28 | return NPCHelper.goAndTalkToNpc( 29 | new Area(2805, 3089, 2814, 3082), 30 | "Trufitis", 31 | new String[] { 32 | "It's a nice village, where is everyone?", 33 | "Me? How can I help?", 34 | "It sounds like just the challenge for me.", 35 | "Yes.", 36 | "Of course!" 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/GiveMilkToCatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.interactive.NPCs; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.methods.quest.book.PaidQuest; 9 | import org.dreambot.api.methods.settings.PlayerSettings; 10 | import org.dreambot.api.utilities.Sleep; 11 | import org.dreambot.api.wrappers.interactive.NPC; 12 | import org.dreambot.api.wrappers.items.Item; 13 | import org.dreambot.framework.Leaf; 14 | import org.dreambot.utilities.Interaction; 15 | import org.dreambot.utilities.Timing; 16 | import org.dreambot.utilities.helpers.WalkingHelper; 17 | 18 | public class GiveMilkToCatLeaf extends Leaf { 19 | 20 | @Override 21 | public boolean isValid() { 22 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 2 23 | && Inventory.contains("Bucket of milk"); 24 | } 25 | 26 | @Override 27 | public int onLoop() { 28 | 29 | if (!WalkingHelper.walkToArea(new Area(3305, 3513, 3312, 3507, 1))) { // cat area 30 | return Timing.getSleepDelay(); 31 | } 32 | 33 | NPC cat = NPCs.closest("Gertrude's cat"); 34 | Item milk = Inventory.get("Bucket of milk"); 35 | if (cat != null 36 | && cat.exists() 37 | && milk != null 38 | && milk.isValid() 39 | && Interaction.delayUseItemOn(milk, cat)) { 40 | Sleep.sleepUntil( 41 | () -> Dialogues.inDialogue(), () -> Players.getLocal().isMoving(), 3000, 100); 42 | } 43 | return Timing.loopReturn(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/GiveKittenToFluffsLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.interactive.NPCs; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.methods.quest.book.PaidQuest; 9 | import org.dreambot.api.methods.settings.PlayerSettings; 10 | import org.dreambot.api.utilities.Sleep; 11 | import org.dreambot.api.wrappers.interactive.NPC; 12 | import org.dreambot.api.wrappers.items.Item; 13 | import org.dreambot.framework.Leaf; 14 | import org.dreambot.utilities.Interaction; 15 | import org.dreambot.utilities.Timing; 16 | import org.dreambot.utilities.helpers.WalkingHelper; 17 | 18 | public class GiveKittenToFluffsLeaf extends Leaf { 19 | 20 | @Override 21 | public boolean isValid() { 22 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 4 23 | && Inventory.contains("Fluffs' kitten"); 24 | } 25 | 26 | @Override 27 | public int onLoop() { 28 | if (!WalkingHelper.walkToArea(new Area(3305, 3513, 3312, 3507, 1))) { // cat area 29 | return Timing.getSleepDelay(); 30 | } 31 | 32 | NPC cat = NPCs.closest("Gertrude's cat"); 33 | Item fluff = Inventory.get("Fluff's kitten"); 34 | if (cat != null 35 | && cat.exists() 36 | && fluff != null 37 | && fluff.isValid() 38 | && Interaction.delayUseItemOn(fluff, cat)) { 39 | Sleep.sleepUntil( 40 | () -> Dialogues.inDialogue(), () -> Players.getLocal().isMoving(), 3000, 100); 41 | } 42 | return Timing.loopReturn(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/witchspotion/DrinkFromCauldronLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.witchspotion; 2 | 3 | import org.dreambot.api.methods.dialogues.Dialogues; 4 | import org.dreambot.api.methods.interactive.GameObjects; 5 | import org.dreambot.api.methods.interactive.Players; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.api.utilities.Sleep; 10 | import org.dreambot.api.wrappers.interactive.GameObject; 11 | import org.dreambot.framework.Leaf; 12 | import org.dreambot.utilities.Interaction; 13 | import org.dreambot.utilities.Timing; 14 | import org.dreambot.utilities.helpers.WalkingHelper; 15 | 16 | public class DrinkFromCauldronLeaf extends Leaf { 17 | 18 | @Override 19 | public boolean isValid() { 20 | return PlayerSettings.getConfig(FreeQuest.WITCHS_POTION.getConfigID()) == 2; 21 | } 22 | 23 | @Override 24 | public int onLoop() { 25 | final Area WITCH_AREA = new Area(2965, 3208, 2970, 3203, 0); 26 | if (!WalkingHelper.walkToArea(WITCH_AREA)) { 27 | return Timing.getSleepDelay(); 28 | } 29 | 30 | if (Dialogues.canContinue()) { 31 | if (Dialogues.continueDialogue()) { 32 | Sleep.sleepUntil(() -> Dialogues.isProcessing(), 3000); 33 | } 34 | return Timing.loopReturn(); 35 | } 36 | GameObject cauldron = GameObjects.closest("Cauldron"); 37 | if (cauldron != null 38 | && cauldron.exists() 39 | && Interaction.delayEntityInteract(cauldron, "Drink From")) { 40 | Sleep.sleepUntil( 41 | () -> Dialogues.canContinue(), () -> Players.getLocal().isMoving(), 3000, 100); 42 | } 43 | return Timing.loopReturn(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/gertrudescat/GiveSeasonedSardineToCatLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.gertrudescat; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.interactive.NPCs; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.methods.quest.book.PaidQuest; 9 | import org.dreambot.api.methods.settings.PlayerSettings; 10 | import org.dreambot.api.utilities.Sleep; 11 | import org.dreambot.api.wrappers.interactive.NPC; 12 | import org.dreambot.api.wrappers.items.Item; 13 | import org.dreambot.framework.Leaf; 14 | import org.dreambot.utilities.Interaction; 15 | import org.dreambot.utilities.Timing; 16 | import org.dreambot.utilities.helpers.WalkingHelper; 17 | 18 | public class GiveSeasonedSardineToCatLeaf extends Leaf { 19 | 20 | @Override 21 | public boolean isValid() { 22 | return PlayerSettings.getConfig(PaidQuest.GERTRUDES_CAT.getConfigID()) == 3 23 | && Inventory.contains("Seasoned sardine"); 24 | } 25 | 26 | @Override 27 | public int onLoop() { 28 | if (!WalkingHelper.walkToArea(new Area(3305, 3513, 3312, 3507, 1))) { // cat area 29 | return Timing.getSleepDelay(); 30 | } 31 | 32 | NPC cat = NPCs.closest("Gertrude's cat"); 33 | Item sardine = Inventory.get("Seasoned sardine"); 34 | if (cat != null 35 | && cat.exists() 36 | && sardine != null 37 | && sardine.isValid() 38 | && Interaction.delayUseItemOn(sardine, cat)) { 39 | Sleep.sleepUntil( 40 | () -> Dialogues.inDialogue(), () -> Players.getLocal().isMoving(), 3000, 100); 41 | } 42 | return Timing.loopReturn(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/piratestreasure/smugglerum/EnterStoreBackhouseLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.piratestreasure.smugglerum; 2 | 3 | import org.dreambot.api.methods.container.impl.equipment.Equipment; 4 | import org.dreambot.api.methods.dialogues.Dialogues; 5 | import org.dreambot.api.methods.map.Area; 6 | import org.dreambot.api.methods.map.Tile; 7 | import org.dreambot.api.utilities.Sleep; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.Timing; 10 | import org.dreambot.utilities.helpers.GameObjectHelper; 11 | 12 | public class EnterStoreBackhouseLeaf extends Leaf { 13 | 14 | @Override 15 | public boolean isValid() { 16 | return SmuggleState.haveShippedRum() && Equipment.contains("White apron"); 17 | } 18 | 19 | @Override 20 | public int onLoop() { 21 | if (Dialogues.inDialogue()) { 22 | if (Dialogues.canContinue()) { 23 | if (Dialogues.continueDialogue()) { 24 | Sleep.sleepUntil(() -> Dialogues.isProcessing(), 3000); 25 | } 26 | return Timing.loopReturn(); 27 | } 28 | if (Dialogues.areOptionsAvailable()) { 29 | if (Dialogues.chooseFirstOptionContaining("Well, can I get a job here?")) { 30 | Sleep.sleepUntil(() -> Dialogues.isProcessing(), 3000); 31 | } 32 | } 33 | return Timing.loopReturn(); 34 | } 35 | final Area FOOD_SHOP_OUTER_AREA = 36 | new Area( 37 | new Tile(3012, 3210, 0), 38 | new Tile(3013, 3210, 0), 39 | new Tile(3016, 3207, 0), 40 | new Tile(3016, 3203, 0), 41 | new Tile(3012, 3203, 0)); 42 | return GameObjectHelper.goAndInteractWithGameObject( 43 | FOOD_SHOP_OUTER_AREA, "Door", "Open", () -> Dialogues.inDialogue()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/thecorsaircurse/cursepuzzle/CurseState.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.thecorsaircurse.cursepuzzle; 2 | 3 | import org.dreambot.api.methods.settings.PlayerSettings; 4 | 5 | public class CurseState { 6 | private static final int TALK_TO_ITHOI_VARBIT = 6075; 7 | private static final int TALK_TO_ARSEN_VARBIT = 6074; 8 | private static final int TALK_TO_COLIN_VARBIT = 6072; 9 | private static final int TALK_TO_GNOCCI_VARBIT = 6073; 10 | 11 | public static boolean talkedToIthoi() { 12 | return PlayerSettings.getBitValue(TALK_TO_ITHOI_VARBIT) == 1; 13 | } 14 | 15 | public static boolean talkedToArsen() { 16 | return PlayerSettings.getBitValue(TALK_TO_ARSEN_VARBIT) >= 2; 17 | } 18 | 19 | public static boolean returnedToothpick() { 20 | return PlayerSettings.getBitValue(TALK_TO_ARSEN_VARBIT) == 4; 21 | } 22 | 23 | public static boolean finishedArsen() { 24 | return PlayerSettings.getBitValue(TALK_TO_ARSEN_VARBIT) >= 6; 25 | } 26 | 27 | public static boolean talkedToColin() { 28 | return PlayerSettings.getBitValue(TALK_TO_COLIN_VARBIT) >= 1; 29 | } 30 | 31 | public static boolean lookedThroughTelescope() { 32 | return PlayerSettings.getBitValue(TALK_TO_COLIN_VARBIT) == 2; 33 | } 34 | 35 | public static boolean finishedColin() { 36 | return PlayerSettings.getBitValue(TALK_TO_COLIN_VARBIT) == 3; 37 | } 38 | 39 | public static boolean talkedToGnocci() { 40 | return PlayerSettings.getBitValue(TALK_TO_GNOCCI_VARBIT) == 1; 41 | } 42 | 43 | public static boolean foundDoll() { 44 | return PlayerSettings.getBitValue(TALK_TO_GNOCCI_VARBIT) == 2; 45 | } 46 | 47 | public static boolean finishedGnocci() { 48 | return PlayerSettings.getBitValue(TALK_TO_GNOCCI_VARBIT) == 3; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/paidquests/clocktower/placecogs/SeeCogPlacedOnSpindleLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.paidquests.clocktower.placecogs; 2 | 3 | import org.dreambot.api.methods.map.Area; 4 | import org.dreambot.framework.Leaf; 5 | import org.dreambot.utilities.API; 6 | import org.dreambot.utilities.Timing; 7 | 8 | public class SeeCogPlacedOnSpindleLeaf extends Leaf { 9 | 10 | @Override 11 | public boolean isValid() { 12 | return API.lastGameMessage.contains("The cog fits perfectly.") 13 | || API.lastGameMessage.contains("You have already placed a cog here"); 14 | } 15 | 16 | @Override 17 | public int onLoop() { 18 | final Area RED_COG_AREA = new Area(2564, 3245, 2573, 3239, 0); 19 | final Area BLUE_COG_AREA = new Area(2564, 3245, 2573, 3239, 1); 20 | final Area WHITE_COG_AREA = new Area(2564, 3245, 2573, 3239, 2); 21 | final Area BLACK_COG_AREA = new Area(2565, 9645, 2573, 9637, 0); 22 | 23 | if (BLUE_COG_AREA.contains(API.lastGameMessageTile)) { 24 | CogState.placedBlueCog = true; 25 | API.lastGameMessage = ""; 26 | API.lastGameMessageTile = null; 27 | return Timing.getSleepDelay(); 28 | } 29 | if (WHITE_COG_AREA.contains(API.lastGameMessageTile)) { 30 | CogState.placedWhiteCog = true; 31 | API.lastGameMessage = ""; 32 | API.lastGameMessageTile = null; 33 | return Timing.getSleepDelay(); 34 | } 35 | if (BLACK_COG_AREA.contains(API.lastGameMessageTile)) { 36 | CogState.placedBlackCog = true; 37 | API.lastGameMessage = ""; 38 | API.lastGameMessageTile = null; 39 | return Timing.getSleepDelay(); 40 | } 41 | if (RED_COG_AREA.contains(API.lastGameMessageTile)) { 42 | CogState.placedRedCog = true; 43 | API.lastGameMessage = ""; 44 | API.lastGameMessageTile = null; 45 | return Timing.getSleepDelay(); 46 | } 47 | 48 | return Timing.getSleepDelay(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/vampyreslayer/RetrieveHammerLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.vampyreslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.container.impl.Shop; 5 | import org.dreambot.api.methods.interactive.NPCs; 6 | import org.dreambot.api.methods.interactive.Players; 7 | import org.dreambot.api.methods.map.Area; 8 | import org.dreambot.api.utilities.Sleep; 9 | import org.dreambot.api.wrappers.interactive.NPC; 10 | import org.dreambot.framework.Leaf; 11 | import org.dreambot.utilities.Interaction; 12 | import org.dreambot.utilities.OwnedItems; 13 | import org.dreambot.utilities.Timing; 14 | import org.dreambot.utilities.helpers.BankHelper; 15 | import org.dreambot.utilities.helpers.WalkingHelper; 16 | 17 | public class RetrieveHammerLeaf extends Leaf { 18 | 19 | @Override 20 | public boolean isValid() { 21 | // 🐰🐰🐰 Check if there is no hammer in the inventory 22 | return !Inventory.contains("Hammer"); 23 | } 24 | 25 | @Override 26 | public int onLoop() { 27 | if (OwnedItems.contains("Hammer")) { 28 | return BankHelper.withdrawFromBank("Hammer", 1); 29 | } 30 | final Area VARROCK_GENERAL_STORE = new Area(3214, 3418, 3220, 3411); 31 | 32 | if (!WalkingHelper.walkToArea(VARROCK_GENERAL_STORE)) { 33 | return Timing.getSleepDelay(); 34 | } 35 | 36 | if (Shop.isOpen()) { 37 | if (Shop.purchase("Hammer", 1)) { 38 | Sleep.sleepUntil(() -> Inventory.contains("Hammer"), 3000); 39 | } 40 | return Timing.loopReturn(); 41 | } 42 | 43 | NPC shopAssistant = NPCs.closest("Shop assistant"); 44 | if (shopAssistant != null 45 | && shopAssistant.exists() 46 | && Interaction.delayEntityInteract(shopAssistant, "Trade")) { 47 | Sleep.sleepUntil(() -> Shop.isOpen(), () -> Players.getLocal().isMoving(), 3000, 100); 48 | } 49 | return Timing.loopReturn(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/demonslayer/TalkToCaptainRovinLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.demonslayer; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.map.Area; 5 | import org.dreambot.api.methods.map.Tile; 6 | import org.dreambot.api.methods.quest.book.FreeQuest; 7 | import org.dreambot.api.methods.settings.PlayerSettings; 8 | import org.dreambot.framework.Leaf; 9 | import org.dreambot.utilities.helpers.NPCHelper; 10 | 11 | /** 12 | * This class speaks to Captain Rovin for the first Siverlight key. 13 | */ 14 | public class TalkToCaptainRovinLeaf extends Leaf { 15 | @Override 16 | public boolean isValid() { 17 | return PlayerSettings.getBitValue(FreeQuest.DEMON_SLAYER.getVarBitID()) == 2 18 | && !Inventory.contains(2400) 19 | && // Silverlight key ID. 20 | PlayerSettings.getBitValue(2567) 21 | == 0; // Determines if a player has received the silverlight. 22 | } 23 | 24 | @Override 25 | public int onLoop() { 26 | final Area CAPTAIN_ROVIN_AREA = 27 | new Area( 28 | new Tile[] { 29 | new Tile(3200, 3496, 2), 30 | new Tile(3200, 3499, 2), 31 | new Tile(3202, 3501, 2), 32 | new Tile(3205, 3501, 2), 33 | new Tile(3207, 3499, 2), 34 | new Tile(3207, 3496, 2), 35 | new Tile(3205, 3494, 2), 36 | new Tile(3202, 3494, 2) 37 | }); 38 | final String[] DIALOGUE_OPTIONS = { 39 | "Yes I know, but this is important.", 40 | "There's a demon who wants to invade this city.", 41 | "" + "Yes, very.", 42 | "It's not them who are going to fight the demon, it's me.", 43 | "Sir Prysin said you would give me the key.", 44 | "Why did he give you one of the keys then?" 45 | }; 46 | return NPCHelper.goAndTalkToNpc(CAPTAIN_ROVIN_AREA, "Captain Rovin", DIALOGUE_OPTIONS); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/dreambot/quests/freequests/therestlessghost/ReturnSkullToGhostLeaf.java: -------------------------------------------------------------------------------- 1 | package org.dreambot.quests.freequests.therestlessghost; 2 | 3 | import org.dreambot.api.methods.container.impl.Inventory; 4 | import org.dreambot.api.methods.interactive.GameObjects; 5 | import org.dreambot.api.methods.interactive.Players; 6 | import org.dreambot.api.methods.map.Area; 7 | import org.dreambot.api.methods.quest.book.FreeQuest; 8 | import org.dreambot.api.methods.settings.PlayerSettings; 9 | import org.dreambot.api.utilities.Sleep; 10 | import org.dreambot.api.wrappers.interactive.GameObject; 11 | import org.dreambot.api.wrappers.items.Item; 12 | import org.dreambot.framework.Leaf; 13 | import org.dreambot.utilities.Interaction; 14 | import org.dreambot.utilities.Timing; 15 | import org.dreambot.utilities.helpers.WalkingHelper; 16 | 17 | public class ReturnSkullToGhostLeaf extends Leaf { 18 | 19 | @Override 20 | public boolean isValid() { 21 | return PlayerSettings.getConfig(FreeQuest.THE_RESTLESS_GHOST.getConfigID()) == 4 22 | && Inventory.contains("Ghost's skull"); 23 | } 24 | 25 | @Override 26 | public int onLoop() { 27 | if (!WalkingHelper.walkToArea(new Area(3247, 3195, 3252, 3190))) { // ghost area 28 | return Timing.getSleepDelay(); 29 | } 30 | 31 | GameObject coffin = GameObjects.closest("Coffin"); 32 | if (coffin != null && coffin.exists()) { 33 | if (coffin.hasAction("Open")) { 34 | if (Interaction.delayEntityInteract(coffin, "Open")) { 35 | Sleep.sleepUntil(() -> !coffin.exists(), () -> Players.getLocal().isMoving(), 3000, 100); 36 | } 37 | return Timing.loopReturn(); 38 | } 39 | Item skull = Inventory.get("Ghost's skull"); 40 | if (skull != null && skull.isValid() && Interaction.delayUseItemOn(skull, coffin)) { 41 | Sleep.sleepUntil(() -> !Inventory.contains("Ghost's skull"), 3000); 42 | } 43 | } 44 | return Timing.loopReturn(); 45 | } 46 | } 47 | --------------------------------------------------------------------------------