Guest User

Untitled

a guest
Jul 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.35 KB | None | 0 0
  1. import java.awt.*;
  2. import java.util.*;
  3. import java.util.List;
  4. import java.util.logging.Level;
  5. import javax.accessibility.*;
  6. import javax.swing.*;
  7.  
  8. import org.rsbot.bot.Bot;
  9. import org.rsbot.script.*;
  10. import org.rsbot.script.wrappers.*;
  11. import org.rsbot.event.listeners.PaintListener;
  12. import org.rsbot.event.listeners.ServerMessageListener;
  13. import org.rsbot.event.events.ServerMessageEvent;
  14. import org.rsbot.util.ScreenshotUtil;
  15. import org.rsbot.script.wrappers.RSTile;
  16. import org.rsbot.script.wrappers.RSNPC;
  17. import org.rsbot.script.wrappers.RSObject;
  18. import org.rsbot.script.Script;
  19.  
  20. @ScriptManifest(authors = { "Gobs" }, category = "Combat", name = "EdgeVille Man Killer P2P", version = 1.00, description = "<html><head><style type='text/css'> body {text-align:center; background-color: black; color: blue;}</style>Start in either:<br></br> 1)Edgeville Bank<br></br> 2)House with men<br></br><br></br>Make sure you have armor on, a weapon on, and food in inventory, and bank.(if needed)")
  21. public class EManKillerp2p extends Script implements PaintListener {
  22.  
  23. String version = "1.0.1";
  24.  
  25. int items[] = {995,526,1440};
  26. int food[] = {319, 2140, 2142, 329, 325, 315, 373, 333, 361, 379, 351, 2309 };//anchovies, bread, cooked chicken, cooked meat, lobster, pike, salmon, sardine, shrimp, sword fish, trout, and tuna.
  27. int mostfood;
  28. int kills = 0;
  29. int collected = 0;
  30. int profit = 0;
  31. int startCoins;
  32. int ranarrprice;
  33. int kwuarmprice;
  34. int dwarfweedprice;
  35. int avantoeprice;
  36. int lantadymeprice;
  37. int randum;
  38. public long startTime = System.currentTimeMillis();
  39. RSItemTile tile;
  40. RSTile banktile;
  41. RSTile middle;
  42. public RSTile doorTile1 = new RSTile(3101,3509);
  43. public RSTile doorTile2 = new RSTile(3100,3509);
  44.  
  45.  
  46.  
  47. public boolean onStart(Map<String, String> args){
  48. if (getCurrentTab() != TAB_INVENTORY) {
  49. openTab(TAB_INVENTORY);
  50. wait(random(400, 600));
  51. }
  52. startTime = System.currentTimeMillis();
  53. ranarrprice = grandExchange.loadItemInfo(207).getMarketPrice();
  54. kwuarmprice = grandExchange.loadItemInfo(213).getMarketPrice();
  55. dwarfweedprice = grandExchange.loadItemInfo(217).getMarketPrice();
  56. avantoeprice = grandExchange.loadItemInfo(211).getMarketPrice();
  57. lantadymeprice = grandExchange.loadItemInfo(2485).getMarketPrice();
  58. log("Edgeville Mankiller " + version);
  59.  
  60. return true;
  61. }
  62.  
  63. public void onFinish(){
  64. log("Thanks for using Edgeville Mankiller " + version);
  65. }
  66.  
  67. //Methods
  68.  
  69.  
  70.  
  71.  
  72. public void walkToBank(){
  73. while(isInventoryFull()){
  74. walkToMen();
  75. wait(100);
  76. openTheDoor();
  77. banktile = new RSTile(3094, 3498);
  78. middle = new RSTile(3093,3504);
  79. setCameraRotation(random(1,360));
  80. walkTo(middle);
  81. wait(random(1000,1500));
  82. walkTo(banktile);
  83. wait(750);
  84. while (getMyPlayer().isMoving()) {
  85. wait(random(1000,1500));
  86. }
  87. wait(random(2000,2500));
  88.  
  89. bank.open();
  90. bank.depositAllExcept(food);
  91. bank.close();
  92. }
  93. walkTo(banktile);
  94. wait(random(1100,1290));
  95. walkTo(middle);
  96. wait(random(1600,2000));
  97. while (getMyPlayer().isMoving()) {
  98. wait(random(200,600));
  99. }
  100. }
  101.  
  102. public void openTheDoor(){
  103. atDoorTiles(doorTile1, doorTile2);
  104. RSObject door1 = getNearestObjectByID(26910);
  105. if(door1 != null){
  106. atObject(door1, "Open Large door");
  107. wait(random(1200,1500));
  108. }
  109. }
  110. public void walkToMen(){
  111. RSTile menTile = new RSTile(3102,random(3509,3510));
  112. RSTile menTile2 = new RSTile(3097,3510);
  113. walkTo(menTile);
  114. wait(random(600,700));
  115. while (getMyPlayer().isMoving()) {
  116. wait(random(200,600));
  117. }
  118. wait(random(1000,2000));
  119. openTheDoor();
  120. walkTileMM(menTile2);
  121. wait(random(600,700));
  122. if (getMyPlayer().isMoving()) {
  123. while (getMyPlayer().isMoving()) {
  124. wait(random(20, 60));
  125. }
  126. wait(random(600,1000));
  127. }
  128. }
  129.  
  130.  
  131.  
  132.  
  133. public boolean takeLoot(){
  134. wait(random(50,150));
  135. tile = getGroundItemByID(207);
  136. if(tile != null){
  137. atTile(tile, "Take Grimy ranarr");
  138. wait(random(500,1000));
  139. profit = profit + ranarrprice;
  140. }
  141.  
  142. tile = getGroundItemByID(213);
  143. if(tile != null){
  144. atTile(tile, "Take Grimy kwuarm");
  145. wait(random(500,1000));
  146. profit = profit + kwuarmprice;
  147. }
  148.  
  149. tile = getGroundItemByID(217);
  150. if(tile != null){
  151. atTile(tile, "Take Grimy dwarf weed");
  152. wait(random(500,1000));
  153. profit = profit + dwarfweedprice;
  154. }
  155.  
  156. tile = getGroundItemByID(211);
  157. if(tile != null){
  158. atTile(tile, "Take Grimy avantoe");
  159. wait(random(500,1000));
  160. profit = profit + avantoeprice;
  161. }
  162.  
  163. tile = getGroundItemByID(2485);
  164. if(tile != null){
  165. atTile(tile, "Take Grimy lantadyme");
  166. wait(random(500,1000));
  167. profit = profit + lantadymeprice;
  168. }
  169.  
  170. return true;
  171. }
  172. public boolean attackMan(){
  173. RSNPC man = getNearestFreeNPCToAttackByName("Man");
  174. if(man != null){
  175. atNPC(man, "Attack");
  176. wait(random(1000,1100));
  177. moveMouse(random(50,300),random(50,300));
  178. if(getMyPlayer().getInteracting() != null){
  179. while(getMyPlayer().getInteracting() != null){
  180. wait(random(50,200));
  181. if (skills.getCurrentSkillLevel(STAT_HITPOINTS) < 6) {
  182. eatFood();
  183. }
  184.  
  185. }
  186. kills++;
  187. wait(random(2000,2500));
  188. takeLoot();
  189. }
  190. }else{
  191. RSObject ladder;
  192. do{
  193. ladder = getNearestObjectByID(26983);
  194. if(ladder != null){
  195.  
  196. atObject(ladder, "Climb-down Ladder");
  197. wait(random(1200,1500));
  198. }
  199. }while(ladder != null);
  200. clicktoContinue();
  201. openTheDoor();
  202. wait(random(50,500));
  203. }
  204. return true;
  205. }
  206. public void eatFood(){
  207. for(int i = 0; i<12; i++){
  208. if (getInventoryCount(food[i]) > 0 && skills.getCurrentSkillLevel(STAT_HITPOINTS) < 20) {
  209. atInventoryItem(food[i], "Eat");
  210. wait(random(3000,5000));
  211. }
  212. }
  213. }
  214.  
  215. public void clicktoContinue(){
  216. if(getInterface(740, 0).getText().startsWith("Congratulations! You've just advanced a")){
  217. clickContinue();
  218. log("Click to Continue has just functioned.");
  219. }
  220. }
  221. public void antiban(){
  222. randum = random(1,100);
  223. if(randum > 89){
  224. if(getCurrentTab() != TAB_STATS){
  225. openTab(TAB_STATS);
  226. wait(random(400,650));
  227. moveMouse(random(558, 598),random(235, 257));
  228. wait(random(750,1600));
  229. openTab(TAB_INVENTORY);
  230. wait(random(400,650));
  231. }else{
  232. moveMouse(100,200);
  233. wait(random(750,1600));
  234. openTab(TAB_INVENTORY);
  235. wait(random(400,650));
  236. }
  237.  
  238. }
  239. randum = random(1,100);
  240. if(randum > 90){
  241. setCameraRotation(random(1,360));
  242. }
  243. }
  244.  
  245. //Loop
  246. public int loop(){
  247. if(isInventoryFull()){
  248. walkToBank();
  249. walkToMen();
  250. }else{
  251.  
  252.  
  253. attackMan();
  254. wait(random(50,1000));
  255. antiban();
  256.  
  257. }
  258.  
  259. return 0;
  260. }
  261.  
  262.  
  263.  
  264. public void onRepaint(Graphics g) {
  265. if (isLoggedIn()) {
  266. long millis = System.currentTimeMillis() - startTime;
  267. long hours = millis / (1000 * 60 * 60);
  268. millis -= hours * (1000 * 60 * 60);
  269. long minutes = millis / (1000 * 60);
  270. millis -= minutes * (1000 * 60);
  271. long seconds = millis / 1000;
  272. long minutes2 = minutes + (hours * 60);
  273. Bot.getEventManager().addListener(PaintListener.class, this);
  274. g.setColor(Color.white);
  275. g.drawRoundRect(359, 9, 156, 101, 10, 10);
  276. g.setColor(Color.blue);
  277. g.fillRoundRect(360, 10, 155, 100, 10, 10);
  278. g.setColor(Color.white);
  279. g.setFont(new Font("Calibri", Font.PLAIN, 13));
  280. g.drawString("Edgeville Man Killer " + version, 360, 25);
  281. g.drawString("Time Running: " + (int) hours + ":" + (int) minutes + ":" + (int) seconds, 360, 40);
  282. g.drawString("Men Killed: " + kills, 360, 55);
  283. g.drawString("Profit Made: " + profit, 360, 70);
  284.  
  285. }
  286. }
  287. }
Add Comment
Please, Sign In to add comment