Guest User

Untitled

a guest
Mar 27th, 2020
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.64 KB | None | 0 0
  1. import org.osbot.rs07.api.map.Area;
  2. import org.osbot.rs07.api.model.Entity;
  3. import org.osbot.rs07.script.Script;
  4. import org.osbot.rs07.script.ScriptManifest;
  5. import org.osbot.rs07.utility.ConditionalSleep;
  6.  
  7. import java.awt.*;
  8.  
  9.  
  10. @ScriptManifest(name = "WtfQuest", author = "Gunn", version = 1.0, info = "", logo = "")
  11.  
  12. public class Skeleton extends Script {
  13.  
  14.         //public SheepShearer sheepShearer = new SheepShearer();
  15.  
  16.     public Skeleton() throws InterruptedException {
  17.     }
  18.  
  19.     @Override
  20.         public void onStart () {
  21.  
  22.             //Code here will execute before the loop is started
  23.  
  24.         }
  25.  
  26.         @Override
  27.         public void onExit () {
  28.  
  29.             //Code here will execute after the script ends
  30.  
  31.         }
  32.  
  33.         @Override
  34.         public int onLoop () throws InterruptedException {
  35.  
  36.             WalkToQuestStart();
  37.             TalkToFredFirst();
  38.  
  39.  
  40.             return 100; //The amount of time in milliseconds before the loop starts over
  41.         }
  42.  
  43.         @Override
  44.  
  45.         public void onPaint (Graphics2D g){
  46.  
  47.             //This is where you will put your code for paint(s)
  48.  
  49.         }
  50.  
  51.         private void WalkToQuestStart()  {
  52.  
  53.             Area houseFredFarmer = new Area(3192, 3270, 3184, 3279);
  54.  
  55.             getWalking().webWalk(houseFredFarmer);
  56.  
  57.         }
  58.  
  59.         private void TalkToFredFirst() throws InterruptedException {
  60.  
  61.             // Creating NPC
  62.             Entity FredTheFarmer = getNpcs().closest("Fred the Farmer");
  63.  
  64.             if (!dialogues.inDialogue()) {
  65.                 if (FredTheFarmer != null) {
  66.                     if (FredTheFarmer.isVisible()) {
  67.                         if (FredTheFarmer.interact("Talk-to")) {
  68.                             new ConditionalSleep(random(1000, 2000)) {
  69.                                 public boolean condition() throws InterruptedException {
  70.                                     return dialogues.inDialogue();
  71.                                 }
  72.                             }.sleep();
  73.                         }
  74.                     } else {
  75.                         getCamera().toEntity(FredTheFarmer);
  76.                     }
  77.                 }
  78.             } else {
  79.                 if (dialogues.isPendingOption()) {
  80.                     dialogues.completeDialogue("I'm looking for a quest.", "Yes okay. I can do that.", "Of course!","I'm something of an expert actually!");
  81.                     sleep(random(400, 900));
  82.                 }
  83.                 if (dialogues.isPendingContinuation()) {
  84.                     dialogues.clickContinue();
  85.                     sleep(random(400, 900));
  86.                 }
  87.             }
  88.         }
  89.     }
Advertisement
Add Comment
Please, Sign In to add comment