Advertisement
Guest User

Untitled

a guest
Mar 24th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. public class NaturalHistoryQuiz extends EventFramework {
  2.  
  3.     private final int QUESTION_MASTER = 533;
  4.     private String status = "Starting mini quest";
  5.  
  6.  
  7.     @Override
  8.     public void execute() {
  9.         if (isActive()) {
  10.             for (Exhibit exhibit : Exhibit.values()) {
  11.                 if (RSVarBit.get(exhibit.getVarbit()).getValue() != 3) {
  12.                     status = "Solving " + exhibit.name();
  13.                     if (Walk.shouldWalk(exhibit.getLocation(), 5)) {
  14.                         if (Walk.walkTo(exhibit.getLocation()))
  15.                             Sleep.till(() -> !Player.isMoving());
  16.                     } else if (Interfaces.isInterfaceSubstantiated(QUESTION_MASTER)) {
  17.                         RSInterface answer = Interfaces.get(QUESTION_MASTER, i -> exhibit.getAnswers().contains(i.getText()));
  18.                         if (answer != null && answer.click()) {
  19.                             Sleep.till(() -> !Interfaces.isInterfaceSubstantiated(answer));
  20.                         }
  21.                     } else {
  22.                         if (Object.click(exhibit.getPlaqueId(), "Study"))
  23.                             Sleep.till(() -> Interfaces.isInterfaceSubstantiated(QUESTION_MASTER));
  24.                     }
  25.                     return;
  26.                 }
  27.             }
  28.         }
  29.         NPC.talkTo(new RSTile(1759, 4956, 0), Arrays.asList("Sure thing."), 6001);
  30.     }
  31.  
  32.     @Override
  33.     public String toString() {
  34.         return "Natural History Quiz";
  35.     }
  36.  
  37.     @Override
  38.     public String getStatus() {
  39.         return status;
  40.     }
  41.  
  42.     @Override
  43.     public boolean isCompleted() {
  44.         return Game.getSetting(1014) < 0;
  45.     }
  46.  
  47.     @Override
  48.     public boolean isActive() {
  49.         return Game.getSetting(1014) > 0;
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement