Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.tasks;
- import org.tribot.api.General;
- import org.tribot.api.Timing;
- import org.tribot.api.input.Mouse;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Projection;
- import org.tribot.api2007.ChooseOption;
- import org.tribot.api2007.Game;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.NPCChat;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.WebWalking;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSNPC;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSTile;
- import scripts.data.Conditions;
- import scripts.data.Vars;
- /* This class has the required functions to talk to Romeo
- * and to wet the clay at the varrock water fountain.
- */
- /* This class has the required functions to talk to Romeo
- * and to wet the clay at the varrock water fountain.
- */
- public class Fountain {
- public static boolean isBucketFull = false;
- public static RSItem[] bucketCondition;
- private static int clayAmount;
- public static boolean isClaySoft = false;
- private static boolean hasTalkedToRomeo = false;
- // Checks for if the player is within the fountain area.
- public static boolean IsNearFountain() {
- return Vars.VARROCK_FOUNTAIN_AREA.contains(Player.getPosition());
- }
- // Walks the player to the fountain
- public static void WalkToFountain() {
- System.out.println(Vars.accountName + " is walking to the water fountain...");
- // Turns on run
- WebWalking.setUseRun(true);
- WebWalking.walkTo(Vars.VARROCK_WATER_FOUNTAIN);
- Timing.waitCondition(Conditions.nearFountain, General.random(40000, 60000));
- General.sleep(3031, 3541);
- // Talks to Romeo to get rid of him
- FuckOffRomeo();
- if (!IsNearFountain()) {
- WalkToFountain();
- }
- }
- private static boolean ClickNPC(RSNPC npc, String option) {
- // Mouse.setSpeed(General.random(100,120));
- RSTile loc = null;
- if (npc != null && npc.isOnScreen()) {
- loc = npc.getPosition();
- Mouse.move(Projection.tileToScreen(loc, 10));
- if (Game.isUptext(option)) {
- Mouse.click(1);
- return true;
- } else {
- Mouse.click(3);
- if (ChooseOption.isOpen()) {
- ChooseOption.select(option);
- }
- }
- }
- return false;
- }
- // Function to start Romeo & Juliet quest.
- public static void FuckOffRomeo() {
- RSNPC[] remeo = org.tribot.api2007.NPCs.find(5037);
- if (ClickNPC(remeo[0], "Talk-to Romeo")) {
- Timing.waitCondition(Conditions.isTalkingToNPC, General.random(4000, 6000));
- if (NPCChat.clickContinue(true) && hasTalkedToRomeo == false) {
- General.sleep(1000, 1500);
- if (NPCChat.selectOption("Perhaps I could help to find her for you?", true)) {
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true)) {
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- General.sleep(1000, 1500);
- if (NPCChat.selectOption("Yes, ok, I'll let her know.", true)) {
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- ;
- General.sleep(1000, 1500);
- if (NPCChat.clickContinue(true))
- ;
- General.sleep(1000, 1500);
- hasTalkedToRomeo = true;
- }
- }
- }
- }
- }
- }
- // Wets all the clay in the player's inventory
- public static void WetClay() {
- System.out.println(Vars.accountName + " has arrived at the fountain. Will now wet clay.");
- // This is a check to make sure player finishes entire inventory
- while (HasClayLeft() == true) {
- RSObject[] fountain = Objects.findNearest(6, "Fountain");
- clayAmount = Inventory.find(434).length;
- String uptext = Game.getUptext();
- for (int i = 0; i < clayAmount; i++) {
- RSItem[] bucket = Inventory.find("Bucket");
- bucketCondition = bucket.clone();
- RSItem[] clay = Inventory.find(434);
- if (fountain != null && fountain.length > 0 && bucket != null && bucket.length > 0) {
- bucket[0].click();
- uptext = Game.getUptext();
- if (uptext != null && uptext.contains("Use Bucket")) {
- fountain[0].click("Use");
- bucket[0].hover();
- Timing.waitCondition(Conditions.fillingBucket, General.random(1000, 1300));
- } else {
- fountain[0].click("Use");
- General.random(300, 500);
- Timing.waitCondition(Conditions.fillingBucket, General.random(1000, 1300));
- }
- }
- RSItem[] fullBucket = Inventory.find("Bucket of Water");
- if (fullBucket != null && fullBucket.length > 0) {
- fullBucket[0].click();
- uptext = Game.getUptext();
- if (uptext != null && uptext.contains("Use Bucket of water")) {
- clay[0].click("Use");
- fullBucket[0].hover();
- Timing.waitCondition(Conditions.hasWetClay, General.random(2000, 2200));
- }
- }
- }
- }
- }
- private static boolean HasClayLeft() {
- if (Inventory.find(1761).toString().contains("types.RSItem") && Inventory.find("Clay").length > 0) {
- return true;
- } else {
- return ((Inventory.find(1761).length) < (clayAmount));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement