Advertisement
Guest User

Untitled

a guest
May 16th, 2015
1,068
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.87 KB | None | 0 0
  1. /**
  2. *
  3. */
  4. package mirojantti.looter;
  5.  
  6. import java.awt.Color;
  7. import java.awt.Font;
  8. import java.awt.Graphics2D;
  9.  
  10. import org.dreambot.api.methods.Calculations;
  11. import org.dreambot.api.methods.container.impl.bank.BankLocation;
  12. import org.dreambot.api.methods.map.Area;
  13. import org.dreambot.api.methods.map.Tile;
  14. import org.dreambot.api.script.AbstractScript;
  15. import org.dreambot.api.script.Category;
  16. import org.dreambot.api.script.ScriptManifest;
  17. import org.dreambot.api.utilities.Timer;
  18. import org.dreambot.api.wrappers.interactive.Player;
  19. import org.dreambot.api.wrappers.items.GroundItem;
  20.  
  21. /**
  22. * @author mirojantti
  23. *
  24. */
  25. @ScriptManifest(name = "mjLooter", author = "mirojantti", description = "Looter by mirojantti", version = 1.0, category = Category.MONEYMAKING)
  26. public class Looter extends AbstractScript {
  27.  
  28.  
  29. String Status = " ";
  30. private final Area wholeLootArea = new Area(3149, 3484, 3221, 3424);
  31. public static Area varrock = new Area(3192, 3448 , 3161 , 3462);
  32. public static Area bankarea = new Area(3191 , 3448 , 3179 , 3432);
  33. public static Area lumbridge = new Area(3217, 3210, 3225 , 3229);
  34. Tile varrockSpot = new Tile(3169 , 3489);
  35. public final String[] items = { "Super combat potion(1)" , "Super combat potion(2)" , "Super combat potion(3)" , "Super combat potion(4)" , "Teleport to house", "Amulet of power" , "Ahrims hood 0" ,"Ahrims robe skirt 0" ,"Ahrims robe top 0" ,"Archer helm" ,"Dharoks platebody 0" ,"Dharoks platelegs 0" ,"Dragon chainbody" ,"Dragon full helm" ,"Dragon gloves" ,"Dragon med helm" ,"Dragon platelegs" ,"Dragon plateskirt" ,"Dragon sq shield" ,"Guthans chainskirt 0" ,"Guthans helm 0" ,"Guthans platebody 0" ,"Infinity hat" ,"Infinity top" ,"Infinity bottoms" ,"Infinity gloves" ,"Infinity boots" ,"Karils coif 0" ,"Torags helm 0" ,"Torags platebody 0" ,"Torags platelegs 0" ,"Veracs brassard" ,"Veracs helm" ,"Veracs plateskirt" ,"Dragon 2h sword" ,"Dragon battleaxe" ,"Dragon halberd" ,"Dragon longsword" ,"Dragon mace" ,"Blood rune" ,"Death rune" ,"Dark crab" ,"Armadyl armour" ,"Armadyl chestplate" ,"Armadyl helmet" ,"Armadyl plateskirt" ,"Black d'hide body" ,"Robin hood hat" ,"Ranger boots" ,"Mystic boots" ,"Mystic gloves" ,"Mystic hat" ,"Mystic robe bottom" ,"Mystic robe top" ,"Wizard boots" ,"Occult necklace" ,"Farseer helm" ,"Rune full helm" ,"Rune kiteshield" ,"Saradomin brew" ,"Ranging potion (4)" ,"Antifire potion (4)" ,"Antifire potion (3)" ,"Antipoison (4)" ,"Antipoison (3)" ,"Super attack potion (4)" ,"Antipoison+ (4)" ,"Antipoison (3)" ,"Super attack potion (3)" ,"Super defence potion (4)" ,"Super defence potion (3)" ,"Super energy potion (4)" ,"Super energy potion (3)" ,"Super restore potion (4)" ,"Super restore potion (3)" ,"Restore potion (4)" ,"Super strength potion (4)" ,"Super strength potion (3)" ,"Super antipoison (4)" ,"Super antipoison (3)" ,"Armadyl crossbow" ,"Karils crossbow" ,"Toktz-xil-ul" ,"Rune thrownaxe" ,"Third-age range coif" ,"Third-age range legs" ,"Third-age range top" ,"Third-age ranger armour" ,"Third-age vambraces" ,"Third-age amulet" ,"Third-age mage hat" ,"Third-age robe" ,"Third-age robe top" ,"Ahrims staff 0" ,"Ancient staff" ,"Master wand" ,"Amulet of Fury" ,"Warrior ring" ,"Dharok's helm 0" ,"Dharok's greataxe 0" ,"Torag's hammers 0" ,"Guthan's warspear 0" ,"Verac's flail 0" ,"Karil's leathertop" ,"Karil's leatherskirt" ,"Ahrim's staff 0" ,"Tzhaar-Ket-Om" ,"Toktz-Ket-Xil" , "Dragonfire shield" ,"Combat bracelet" ,"Bandos chestplate" ,"Bandos tassets" ,"Bandos boots" ,"Granite helm" ,"Granite body" ,"Granite legs" ,"Granite shield" ,"Rock-shell helm" ,"Rock-shell plate" ,"Rock-shell legs" ,"Odium ward" ,"Archers' ring" ,"Splitbark gauntlets", "Splitbark helm" ,"Splitbark body" ,"Splitbark legs" ,"Splitbark boots" ,"Malediction ward", "Seer's ring" , "Saradomin godsword" , "Zamorak godsword" , "Armadyl godsword" , "Bandos godsword" , "Saradomin sword" , "Shark", "Rune arrow", "Diamond bolts (e)", "Dragon bolts (e)", "Emerald bolts (e)", "Dragon arrow", "Super strength(4)", "Super strength(3)", "Super strength(2)", "Super strength(1)", "Super attack(4)", "Super attack(3)", "Super attack(2)", "Super attack(1)", "Prayer potion(4)", "Prayer potion(3)", "Prayer potion(2)", "Prayer potion(1)", "Dragon dagger", "Dragon scimitar", "Rune platelegs", "Rune platebody", "Berserker helm", "Snakeskin boots", "Rune knife", "Granite maul", "Monkfish", "Amulet of strength", "Amulet of glory", "Dark bow", "Magic shortbow", "Black d'hide vamb", "Black d'hide chaps", "Red d'hide vamb", "Red d'hide chaps", "Camelot teleport", "Ring of recoil", "Ring of life", "Amulet of diamond", "Abyssal whip", "Rune crossbow", "Monk's robe", "Climbing boots", "Cooked karambwan", "Ranging potion(3)", "Ranging potion(2)", "Ranging potion(1)", "Rune dart", "Dragon dart", "Runite bolts" , "Rune boots" ,"Dragon boots" , "Dragon dagger" , "Dragon dagger(p)" , "Dragon dagger(+)" , "Dragon dagger(s)" , "Dragon dagger(p+)" , "Dragon dagger(p++)" , "Adamant platelegs" , "Adamant platebody" , "Rune scimitar" , "Adamant scimitar" , "Berserker helm" , "Berserker ring" , "Phoenix necklace" , "Helm of neitiznot"};
  36. int[] items1 = {11212, 9244 , 3105, 9241 , 157,159,161,2440,6685,6687,6689,6691,892};
  37. private Timer t = new Timer();
  38. boolean deathWalk = false;
  39. boolean shouldBank = false;
  40. boolean underAttack = false;
  41. private int runEnergy = Calculations.random(30, 60);
  42. private boolean firstTime;
  43. int i;
  44.  
  45.  
  46.  
  47. public int onLoop() {
  48. Player p = getLocalPlayer();
  49. GroundItem stuff = getGroundItems().closest(items);
  50.  
  51.  
  52.  
  53. if(!varrock.contains(p) && !lumbridge.contains(p) && !wholeLootArea.contains(p)){
  54. deathWalk = true;
  55. }
  56.  
  57. if (firstTime) {
  58. t = new Timer();
  59. firstTime = false;
  60. }
  61. if(p.distance(varrockSpot) <= 10){
  62. deathWalk = false;
  63. }
  64. if (wholeLootArea.contains(p)) {
  65. deathWalk = false;
  66. }
  67. if(bankarea.contains(p)){
  68. deathWalk = false;
  69. }
  70.  
  71. while(p != null && p.isInCombat()){
  72. Status = "Banking";
  73. if (!getBank().isOpen()) {
  74. getBank().open(BankLocation.VARROCK_WEST);
  75. sleepUntil(() -> getBank().isOpen(), Calculations.random(1800, 2400));
  76. } else {
  77. if (getBank().depositAllItems()) {
  78. sleepUntil(() -> getInventory().isEmpty(), Calculations.random(1800, 2400));
  79. }
  80. }
  81. }
  82.  
  83.  
  84. if(!getWalking().isRunEnabled() && (getWalking().getRunEnergy() >= runEnergy)) {
  85. if (getWalking().toggleRun()) {
  86. sleepUntil(() -> getWalking().isRunEnabled(), Calculations.random(800, 1200));
  87. runEnergy = Calculations.random(30, 60);
  88. }
  89. }
  90.  
  91. if(getInventory().getEmptySlots() > 18 && deathWalk == false) {
  92. Status = "Scanning stuff";
  93. if(stuff != null && wholeLootArea.contains(stuff)) {
  94. Status = "Found stuff";
  95. if(stuff.isOnScreen() ){
  96. Status = "Picking stuff";
  97. stuff.interact("Take");
  98. sleep(Calculations.random(100, 200));
  99. } else if(stuff.distance() < 5) {
  100. Status = "Moving camera";
  101. getCamera().rotateToEntity(stuff);
  102. getCamera().rotateToPitch(Calculations.random(32, 39));
  103. sleepUntil(() -> getCamera().getPitch() <= 39, Calculations.random(500, 1400));
  104. } else {
  105. Status = "Walking to stuff";
  106. if (stuff != null) {
  107. getWalking().walk(stuff);
  108. sleep(Calculations.random(100, 200));
  109. }
  110. }
  111. }
  112. } else if (getInventory().getEmptySlots() <= 18 || underAttack == true) {
  113. Status = "Banking";
  114. if (!getBank().isOpen()) {
  115. getBank().open(BankLocation.VARROCK_WEST);
  116. sleepUntil(() -> getBank().isOpen(), Calculations.random(1800, 2400));
  117. } else {
  118. if (getBank().depositAllItems()) {
  119. sleepUntil(() -> getInventory().isEmpty(), Calculations.random(1800, 2400));
  120. }
  121. }
  122. }
  123. if(getBank().isOpen() && getInventory().isEmpty()) {
  124. getBank().close();
  125. sleep(Calculations.random(200, 900));
  126. }
  127. if (lumbridge.contains(p)) {
  128. Status = "Deathwalk";
  129. deathWalk = true;
  130. }
  131. if(deathWalk == true) {
  132. getWalking().walk(varrockSpot);
  133. Status = "Deathwalk";
  134. sleep(Calculations.random(200, 900));
  135. }
  136.  
  137.  
  138.  
  139. if(varrock.contains(p) || bankarea.contains(p)){
  140. deathWalk = false;
  141. }
  142.  
  143.  
  144.  
  145. return Calculations.random(121 , 423);
  146. }
  147.  
  148.  
  149.  
  150.  
  151. public void onPaint(Graphics2D g) {
  152. g.setFont(new Font("Lucida Console",Font.PLAIN,30));
  153. g.setColor(Color.WHITE);
  154. g.drawString("Pvp",30,60);
  155. g.setColor(new Color(225,132,255));
  156. g.drawString("Looter",100,60);
  157. g.setFont(new Font("Lucida Console",Font.PLAIN,11));
  158. g.setColor(Color.WHITE);
  159. g.drawString("By",35,75);
  160. g.setColor(new Color(225,132,255));
  161. g.drawString("mirojantti",55,75);
  162. g.setColor(Color.WHITE);
  163. g.drawString("Version",130,75);
  164. g.setColor(new Color(225,132,255));
  165. g.drawString(""+getVersion(),184,75);
  166. g.setColor(Color.WHITE);
  167. g.drawLine(20, 80, 210, 80);
  168. g.setFont(new Font("Lucida Console",Font.PLAIN,15));
  169. g.drawString(""+t.formatTime(),80,97);
  170. g.drawLine(20, 102, 210, 102);
  171. g.setColor(Color.WHITE);
  172. g.drawString("Status",29,120);
  173. g.setColor(new Color(225,132,255));
  174. g.drawString(Status,90,120);
  175. }
  176.  
  177.  
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement