Advertisement
Guest User

Main

a guest
Feb 28th, 2018
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. import org.osbot.rs07.api.*;
  2. import org.osbot.rs07.api.Bank;
  3. import org.osbot.rs07.api.filter.Filter;
  4. import org.osbot.rs07.api.map.Area;
  5. import org.osbot.rs07.api.map.Position;
  6. import org.osbot.rs07.api.map.constants.Banks;
  7. import org.osbot.rs07.api.model.Entity;
  8. import org.osbot.rs07.api.model.NPC;
  9. import org.osbot.rs07.api.model.Player;
  10. import org.osbot.rs07.event.WebWalkEvent;
  11. import org.osbot.rs07.script.Script;
  12. import org.osbot.rs07.script.ScriptManifest;
  13. import org.osbot.rs07.script.MethodProvider;
  14. import org.osbot.rs07.utility.ConditionalSleep;
  15.  
  16. import static org.osbot.devAPI.Strings.WITHDRAW;
  17. import static org.osbot.rs07.api.map.constants.Banks.EDGEVILLE;
  18.  
  19.  
  20. @ScriptManifest( author = "Himmerberg", name = "Skeleton", logo = "", version = 1.0, info = "Eerste Script")
  21. public class Main extends Script {
  22.  
  23.  
  24. private final Area CRAWLERS = new Area(2038, 5194, 2046, 5185);
  25.  
  26.  
  27. @Override
  28. public void onStart() throws InterruptedException {
  29. log("Welcome to my Flesh Crawler slayer");
  30.  
  31. }
  32.  
  33.  
  34. @Override
  35. public int onLoop() throws InterruptedException {
  36.  
  37.  
  38. NPC Flesh_Crawler = getNpcs().closest(new Filter<NPC>() {
  39. @Override
  40. public boolean match(NPC npc) {
  41. return npc != null && npc.getName().equals("Flesh_Crawler") && npc.exists() && npc.isAttackable() && !npc.isAnimating() && !npc.isUnderAttack() && npc.getHealthPercent() > 0;
  42. }
  43. });
  44.  
  45.  
  46. if (inventory.contains("Tuna")) {
  47. getWalking().webWalk(CRAWLERS);
  48. } else if (!inventory.isEmpty()) {
  49. log("No food");
  50. getWalking().webWalk(Banks.EDGEVILLE);
  51. }
  52. if (!getBank().isOpen()) {
  53. } else if (getBank().contains("Tuna")) {
  54.  
  55. }
  56. else {
  57. stop();
  58. //logout
  59. }
  60.  
  61. if (!getCombat().isFighting()) { //check if not fighting
  62. if (Flesh_Crawler != null) { // are there Flesh Crawlers?
  63. if (Flesh_Crawler.interact("Attack")) { // if so, Attack
  64. new ConditionalSleep(3000, 1000) { // sleep for 3 seconds
  65. @Override
  66. public boolean condition() throws InterruptedException {
  67. return getCombat().isFighting(); // check if fighting
  68. }
  69. }.sleep();
  70. }
  71. }
  72. }
  73.  
  74.  
  75. return 600;
  76.  
  77.  
  78. }
  79.  
  80.  
  81.  
  82.  
  83. @Override
  84. public void onExit() throws InterruptedException {
  85. super.onExit();
  86. log("Cya!");
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement