Guest User

Untitled

a guest
Jul 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.30 KB | None | 0 0
  1. /* MyrSeagullRapist by Myr
  2. * Do not reproduce this script in any way.
  3. *
  4. * Enjoy raping seagulls!
  5. */
  6.  
  7. /* REVISIONS:
  8. * V3.0: Re-release of script
  9. * V3.1: Added exp gained and status
  10. * V3.2: Added failsafe
  11. * V3.3: Improved paint (thanks so very much Epic_!)
  12. * V3.3.1: Readded failsafe
  13. * V3.4: Fixed 'click to continue' bug!
  14. * ...
  15. */
  16.  
  17. import java.awt.*;
  18. import java.util.*;
  19.  
  20. import org.rsbot.script.*;
  21. import org.rsbot.bot.*;
  22. import org.rsbot.script.wrappers.*;
  23. import org.rsbot.event.listeners.PaintListener;
  24. import org.rsbot.bot.input.Mouse;
  25.  
  26. @ScriptManifest(authors = { "Myr" }, category = "Combat", name = "MyrSeagullRapist", version = 3.4, description =
  27. "<body bgcolor = Black><font color = White><center><h2>MyrSeagullRapist V3.1</h2><h3>by Myr</h3></center><br><center>Select your options and press OK.<br>This script will automatically pick up arrows.<br>Train Prayer?: <select name=\"prayer\"><option> <option>Yes<option>No</select><br>Skill to track?: <select name=\"skill\"><option> <option>Attack<option>Strength<option>Defence<option>Range<option>Magic</center>")
  28. public class MyrSeagullRapist extends Script implements PaintListener {
  29.  
  30. ///////////////////////////////////
  31. ////////////INTEGERS///////////////
  32. ///////////////////////////////////
  33.  
  34. public int seagullID[] = { 6116, 6115 };
  35. public int items[] = { 0 };
  36. public long startTime = System.currentTimeMillis();
  37. public int antiban;
  38.  
  39. private String status = "Loading script";
  40. public int raped;
  41. public int startexp;
  42. public int expgained;
  43. public int HPstartexp;
  44. public int HPexpgained;
  45. public int paintSelection = 1;
  46.  
  47. public int statIndex = 0;
  48.  
  49. public boolean runPrayer;
  50. public boolean runAttack;
  51. public boolean runStrength;
  52. public boolean runDefence;
  53. public boolean runRange;
  54. public boolean runMagic;
  55.  
  56.  
  57. private final Color background = new Color(0,0,0,200),
  58. blue = new Color(51, 204, 255, 200),
  59. black = new Color(0, 0, 0, 200),
  60. white = new Color(255,255,255,200),
  61. green = new Color(30,255,30,200);
  62.  
  63. ///////////////////////////////////
  64. /////////////PAINT/////////////////
  65. ///////////////////////////////////
  66.  
  67. public void onRepaint(Graphics g) { //Most of the paint done by Epic_!
  68. if (isLoggedIn()) {
  69.  
  70. int expgained = 0;
  71. int HPexpgained = 0;
  72.  
  73. if (runAttack) {
  74. if ( startexp == 0) {
  75. startexp = skills.getCurrentSkillExp(STAT_ATTACK);
  76. statIndex = STAT_ATTACK;
  77. }
  78. expgained = skills.getCurrentSkillExp(STAT_ATTACK) - startexp;
  79. }
  80.  
  81. if (runStrength) {
  82. if ( startexp == 0) {
  83. startexp = skills.getCurrentSkillExp(STAT_STRENGTH);
  84. statIndex = STAT_STRENGTH;
  85. }
  86. expgained = skills.getCurrentSkillExp(STAT_STRENGTH) - startexp;
  87. }
  88.  
  89. if (runDefence) {
  90. if ( startexp == 0) {
  91. startexp = skills.getCurrentSkillExp(STAT_DEFENSE);
  92. statIndex = STAT_DEFENSE;
  93. }
  94. expgained = skills.getCurrentSkillExp(STAT_DEFENSE) - startexp;
  95. }
  96.  
  97. if (runRange) {
  98. if ( startexp == 0) {
  99. startexp = skills.getCurrentSkillExp(STAT_RANGE);
  100. statIndex = STAT_RANGE;
  101. }
  102. expgained = skills.getCurrentSkillExp(STAT_RANGE) - startexp;
  103. }
  104.  
  105. if (runMagic) {
  106. if ( startexp == 0) {
  107. startexp = skills.getCurrentSkillExp(STAT_MAGIC);
  108. statIndex = STAT_MAGIC;
  109. }
  110. expgained = skills.getCurrentSkillExp(STAT_MAGIC) - startexp;
  111. }
  112.  
  113. if ( HPstartexp == 0) {
  114. HPstartexp = skills.getCurrentSkillExp(STAT_HITPOINTS);
  115. }
  116. HPexpgained = skills.getCurrentSkillExp(STAT_HITPOINTS) - HPstartexp;
  117.  
  118. long millis = System.currentTimeMillis() - startTime;
  119. long hours = millis / (1000 * 60 * 60);
  120. millis -= hours * (1000 * 60 * 60);
  121. long minutes = millis / (1000 * 60);
  122. millis -= minutes * (1000 * 60);
  123. long seconds = millis / 1000;
  124.  
  125.  
  126.  
  127. long totalSeconds = ((System.currentTimeMillis() - startTime) / 1000);
  128.  
  129. int EXPGained = skills.getCurrentSkillExp(statIndex) - startexp;
  130. long EXPPerHour;
  131. if (totalSeconds == 0) {
  132. EXPPerHour = 0;
  133. } else {
  134. EXPPerHour = (EXPGained * 3600) / totalSeconds;
  135. }
  136.  
  137. long secondsToLvl;
  138.  
  139. if (EXPPerHour == 0) {
  140. secondsToLvl = 0;
  141. } else {
  142. secondsToLvl = (skills.getXPToNextLevel(statIndex) * 3600) / EXPPerHour;
  143. }
  144. ;
  145. long hoursToLvl = secondsToLvl / (60 * 60);
  146. secondsToLvl -= hoursToLvl * (60 * 60);
  147. long minutesToLvl = secondsToLvl / (60);
  148. secondsToLvl -= minutesToLvl * (60);
  149.  
  150.  
  151.  
  152. Mouse m = Bot.getClient().getMouse();
  153. Point p = new Point(m.x,m.y);
  154.  
  155. if (isWithinBounds(p,350,350,70,20)) {
  156. paintSelection = 0;
  157. }
  158. if (isWithinBounds(p,420,350,70,20)) {
  159. paintSelection = 1;
  160. }
  161.  
  162. g.setColor(background);
  163. g.fillRoundRect(350,350,140,20,5,5);
  164. g.fillRoundRect(350,375,140,85,5,5);
  165.  
  166. g.setFont(new Font("Calibri", Font.BOLD, 16));
  167. g.setColor(white);
  168. g.drawString("EXP", 375, 365);
  169. g.drawString("INFO", 440, 365);
  170. g.fillRect(420,350,1,20);
  171.  
  172.  
  173. g.setFont(new Font("Calibri", Font.BOLD, 12));
  174. int y = 375;
  175. if (paintSelection == 0) {
  176. g.setColor(blue);
  177. g.drawString("Combat EXP: " + expgained, 355, y += 14);
  178. g.drawString("Hitpoints EXP: " + HPexpgained, 355, y += 14);
  179. g.drawString("EXP Per Hour: " + EXPPerHour, 355, y += 14);
  180. g.drawString("Level in: " + hoursToLvl + ":" + minutesToLvl + ":" + secondsToLvl, 355, y += 14);
  181.  
  182. g.setColor(white);
  183. g.drawString("" + skills.getPercentToNextLevel(statIndex)+"%", 355, y += 20);
  184. g.setColor(green);
  185. g.fillRoundRect(385, y -= 10, skills.getPercentToNextLevel(statIndex), 10, 5, 10);
  186. }
  187.  
  188. if (paintSelection == 1) {
  189. g.setColor(white);
  190. g.drawString("MyrSeagullRapist", 355, y += 14);
  191. g.setColor(blue);
  192. g.drawString("Seagulls Raped: " + raped, 355, y += 14);
  193. g.drawString("Time Running: " + hours + ":" + minutes + ":" + seconds , 355, y += 14);
  194. g.drawString("Status: " + status, 355, y += 14);
  195. g.setColor(white);
  196. g.drawString("Created by Myr", 355, y += 20);
  197. }
  198. }
  199. }
  200.  
  201.  
  202. ///////////////////////////////////
  203. //////onStart and onFinish/////////
  204. ///////////////////////////////////
  205. @SuppressWarnings("deprecation")
  206. public boolean onStart(Map<String, String> args) {
  207. Bot.getEventManager().addListener(PaintListener.class, this);
  208. log("******************************");
  209. log("***Started MyrSeagullRapist***");
  210. log("******************************");
  211.  
  212. if(args.get("prayer").equals("Yes"))
  213. runPrayer = true;
  214. else runPrayer = false;
  215.  
  216. if (args.get("prayer").equals("Yes")) {
  217. items = new int[] { 526, 882, 884, 886, 888, 890, 892 };
  218. }
  219.  
  220. if (args.get("prayer").equals("No")) {
  221. items = new int[] { 882, 884, 886, 888, 890, 892 };
  222. }
  223.  
  224. if(args.get("skill").equals("Attack"))
  225. runAttack = true;
  226. else runAttack = false;
  227.  
  228. if(args.get("skill").equals("Strength"))
  229. runStrength = true;
  230. else runStrength = false;
  231.  
  232. if(args.get("skill").equals("Defence"))
  233. runDefence = true;
  234. else runDefence = false;
  235.  
  236. if(args.get("skill").equals("Range"))
  237. runRange = true;
  238. else runRange = false;
  239.  
  240. if(args.get("skill").equals("Magic"))
  241. runMagic = true;
  242. else runMagic = false;
  243.  
  244. return true;
  245. }
  246.  
  247. public void onFinish(){
  248. Bot.getEventManager().removeListener(PaintListener.class, this);
  249. log("******************************");
  250. log("***Stopped MyrSeagullRapist***");
  251. log("******************************");
  252. return;
  253. }
  254.  
  255.  
  256. ///////////////////////////////////
  257. //////////////METHODS//////////////
  258. ///////////////////////////////////
  259.  
  260. public boolean isWithinBounds(Point p, int x, int y, int w, int h) {
  261. if (p.x > x && p.x < x+w && p.y > y && p.y < y+h) {
  262. return true;
  263. } else {
  264. return false;
  265. }
  266. }
  267.  
  268. public void pickup() {
  269. if (getMyPlayer().getInteracting() == null) {
  270. RSItemTile itemtile = getNearestGroundItemByID(items);
  271. if(itemtile != null) {
  272. if(tileOnScreen(itemtile))
  273. atTile(itemtile, "Take");
  274. wait (random(1000, 1500));
  275. }
  276. }
  277. }
  278.  
  279. public void bury() {
  280. if (isInventoryFull()) {
  281. while (inventoryContains(526)) {
  282. atInventoryItem(526, "Bury");
  283. status = "Burying";
  284. }
  285. }
  286. }
  287.  
  288. public void checkForLvlUpMessage() {
  289. if(RSInterface.getInterface(INTERFACE_LEVELUP).isValid()) {
  290. wait(random(800, 2000)); //reaction time
  291. atInterface(INTERFACE_LEVELUP, 3);
  292. wait(random(2000, 4000));
  293. }
  294. }
  295.  
  296. public void antiBan(){
  297. antiban = random(0, 60);
  298. if(antiban == 12) {
  299. setCameraRotation(random(1,360));
  300. }
  301.  
  302. if(antiban == 2) {
  303. moveMouseRandomly(20);
  304. }
  305.  
  306. if(antiban == 17) {
  307. setCameraAltitude(random(1, 100));
  308. }
  309.  
  310. if(antiban == 6) {
  311. moveMouseRandomly(750);
  312. }
  313.  
  314. if(antiban == 31) {
  315. setCameraRotation(random(1,176));
  316. setCameraAltitude(random(1, 168));
  317. }
  318.  
  319. if(antiban == 38) {
  320. if (getCurrentTab() != TAB_INVENTORY) {
  321. openTab(TAB_INVENTORY);
  322. }
  323. }
  324. }
  325.  
  326. ///////////////////////////////////
  327. ////////////////LOOP///////////////
  328. ///////////////////////////////////
  329.  
  330. public int loop() {
  331.  
  332. if (getMyPlayer().isMoving()) {
  333. antiBan();
  334. status = "Walking";
  335. return 50;
  336. } else if (!getMyPlayer().isMoving()) {
  337. checkForLvlUpMessage();
  338. pickup();
  339. }
  340.  
  341. if (runPrayer) {
  342. bury();
  343. }
  344.  
  345. if (!isRunning() && getEnergy() > random(40, 100)) {
  346. setRun(true);
  347. }
  348.  
  349. if (getMyPlayer().isInCombat()) {
  350. status = "In combat";
  351. antiBan();
  352. wait (random(10, 100));
  353. return 50;
  354. }
  355.  
  356. RSTile failSafe = new RSTile(3028, 3236);
  357. if (getMyPlayer().getInteracting() == null) {
  358. if (!getMyPlayer().isMoving()) {
  359. RSNPC Seagull = getNearestFreeNPCByID(seagullID);
  360. if (Seagull != null) {
  361. if (tileOnScreen(Seagull.getLocation())) {
  362. atNPC(Seagull, "Attack");
  363. raped++;
  364. } else {
  365. walkTileMM(failSafe);
  366. antiBan();
  367. wait (random(100, 500));
  368. }
  369. }
  370. }
  371. }
  372. return 200;
  373. }
  374. }
Add Comment
Please, Sign In to add comment