SHARE
TWEET

Untitled

a guest Jul 18th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import org.rspeer.runetek.adapter.component.InterfaceComponent;
  2. import org.rspeer.runetek.adapter.component.Item;
  3. import org.rspeer.runetek.adapter.scene.Npc;
  4. import org.rspeer.runetek.adapter.scene.Pickable;
  5. import org.rspeer.runetek.adapter.scene.SceneObject;
  6. import org.rspeer.runetek.api.commons.OverheadIcons;
  7. import org.rspeer.runetek.api.commons.Time;
  8. import org.rspeer.runetek.api.commons.math.Random;
  9. import org.rspeer.runetek.api.component.Interfaces;
  10. import org.rspeer.runetek.api.component.tab.*;
  11. import org.rspeer.runetek.api.movement.Movement;
  12. import org.rspeer.runetek.api.movement.position.Position;
  13. import org.rspeer.runetek.api.scene.Npcs;
  14. import org.rspeer.runetek.api.scene.Pickables;
  15. import org.rspeer.runetek.api.scene.Players;
  16. import org.rspeer.runetek.api.scene.SceneObjects;
  17. import org.rspeer.runetek.event.listeners.TickListener;
  18. import org.rspeer.runetek.event.types.TickEvent;
  19. import org.rspeer.script.Script;
  20. import org.rspeer.script.ScriptCategory;
  21. import org.rspeer.script.ScriptMeta;
  22. import org.rspeer.ui.Log;
  23.  
  24. import javax.swing.*;
  25. import java.util.ArrayList;
  26. import java.util.Arrays;
  27. import java.util.List;
  28.  
  29. @ScriptMeta(name = "PrayerFlick", category = ScriptCategory.OTHER, desc = "Flicks prayers", developer = "Opolusia", version = 0.1)
  30. public class JustFlick extends Script implements TickListener {
  31.  
  32.     public boolean postMessage;
  33.  
  34.  
  35.     @Override
  36.     public void onStart() {
  37.  
  38.     }
  39.  
  40.     @Override
  41.     public int loop() {
  42.         ToggleQuickPrayers(true);
  43.         return 10;
  44.     }
  45.  
  46.  
  47.     @Override
  48.     public void notify(TickEvent tickEvent) {
  49.         ToggleQuickPrayers(false);
  50.     }
  51.     private static void ToggleQuickPrayers(boolean turnOn) {
  52.         InterfaceComponent quickPrayersInterface = Interfaces.getFirst(interfaceComponent -> interfaceComponent.getName().equals("Quick-prayers"));
  53.         if (turnOn && Arrays.stream(quickPrayersInterface.getActions()).anyMatch("Activate"::equals)) {
  54.             quickPrayersInterface.interact("Activate");
  55.         } else if (!turnOn && Arrays.stream(quickPrayersInterface.getActions()).anyMatch("Deactivate"::equalsIgnoreCase)){
  56.             quickPrayersInterface.interact("Deactivate");
  57.         }
  58.     }
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top