Guest User

Untitled

a guest
Jul 20th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.28 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) {
  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,374,140,82,5,5);
  165.  
  166. g.setFont(new Font("sans serif", Font.PLAIN, 16));
  167. g.setColor(white);
  168. g.drawString("EXP", 373, 365);
  169. g.drawString("INFO", 437, 365);
  170. g.fillRect(420,350,1,20);
  171.  
  172.  
  173. g.setFont(new Font("sans serif", Font.PLAIN, 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("Myr Seagull Rapist", 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/Epic_", 355, y += 20);
  197. }
  198. }
  199. }
  200.  
  201. ///////////////////////////////////
  202. //////onStart and onFinish/////////
  203. ///////////////////////////////////
  204. @SuppressWarnings("deprecation")
  205. public boolean onStart(Map<String, String> args) {
  206. Bot.getEventManager().addListener(PaintListener.class, this);
  207. log("******************************");
  208. log("***Started MyrSeagullRapist***");
  209. log("******************************");
  210.  
  211. if(args.get("prayer").equals("Yes"))
  212. runPrayer = true;
  213. else runPrayer = false;
  214.  
  215. if (args.get("prayer").equals("Yes")) {
  216. items = new int[] { 526, 882, 884, 886, 888, 890, 892 };
  217. }
  218.  
  219. if (args.get("prayer").equals("No")) {
  220. items = new int[] { 882, 884, 886, 888, 890, 892 };
  221. }
  222.  
  223. if(args.get("skill").equals("Attack"))
  224. runAttack = true;
  225. else runAttack = false;
  226.  
  227. if(args.get("skill").equals("Strength"))
  228. runStrength = true;
  229. else runStrength = false;
  230.  
  231. if(args.get("skill").equals("Defence"))
  232. runDefence = true;
  233. else runDefence = false;
  234.  
  235. if(args.get("skill").equals("Range"))
  236. runRange = true;
  237. else runRange = false;
  238.  
  239. if(args.get("skill").equals("Magic"))
  240. runMagic = true;
  241. else runMagic = false;
  242.  
  243. return true;
  244. }
  245.  
  246. public void onFinish(){
  247. Bot.getEventManager().removeListener(PaintListener.class, this);
  248. log("******************************");
  249. log("***Stopped MyrSeagullRapist***");
  250. log("******************************");
  251. return;
  252. }
  253.  
  254.  
  255. ///////////////////////////////////
  256. //////////////METHODS//////////////
  257. ///////////////////////////////////
  258.  
  259. public boolean isWithinBounds(Point p, int x, int y, int w, int h) {
  260. if (p.x > x && p.x < x+w && p.y > y && p.y < y+h) {
  261. return true;
  262. } else {
  263. return false;
  264. }
  265. }
  266.  
  267. public void pickup() {
  268. if (getMyPlayer().getInteracting() == null) {
  269. RSItemTile itemtile = getNearestGroundItemByID(items);
  270. if(itemtile != null) {
  271. if(tileOnScreen(itemtile))
  272. atTile(itemtile, "Take");
  273. wait (random(1000, 1500));
  274. }
  275. }
  276. }
  277.  
  278. public void bury() {
  279. if (isInventoryFull()) {
  280. while (inventoryContains(526)) {
  281. atInventoryItem(526, "Bury");
  282. status = "Burying";
  283. }
  284. }
  285. }
  286.  
  287. public void checkForLvlUpMessage() {
  288. if(RSInterface.getInterface(INTERFACE_LEVELUP).isValid()) {
  289. wait(random(800, 2000)); //reaction time
  290. atInterface(INTERFACE_LEVELUP, 3);
  291. wait(random(2000, 4000));
  292. }
  293. }
  294.  
  295. public void antiBan(){
  296. antiban = random(0, 60);
  297. if(antiban == 12) {
  298. setCameraRotation(random(1,360));
  299. }
  300.  
  301. if(antiban == 2) {
  302. moveMouseRandomly(20);
  303. }
  304.  
  305. if(antiban == 17) {
  306. setCameraAltitude(random(1, 100));
  307. }
  308.  
  309. if(antiban == 6) {
  310. moveMouseRandomly(750);
  311. }
  312.  
  313. if(antiban == 31) {
  314. setCameraRotation(random(1,176));
  315. setCameraAltitude(random(1, 168));
  316. }
  317.  
  318. if(antiban == 38) {
  319. if (getCurrentTab() != TAB_INVENTORY) {
  320. openTab(TAB_INVENTORY);
  321. }
  322. }
  323. }
  324.  
  325. ///////////////////////////////////
  326. ////////////////LOOP///////////////
  327. ///////////////////////////////////
  328.  
  329. public int loop() {
  330.  
  331. if (getMyPlayer().isMoving()) {
  332. antiBan();
  333. status = "Walking";
  334. return 50;
  335. } else if (!getMyPlayer().isMoving()) {
  336. checkForLvlUpMessage();
  337. pickup();
  338. }
  339.  
  340. if (runPrayer) {
  341. bury();
  342. }
  343.  
  344. if (!isRunning() && getEnergy() > random(40, 100)) {
  345. setRun(true);
  346. }
  347.  
  348. if (getMyPlayer().isInCombat()) {
  349. status = "In combat";
  350. antiBan();
  351. wait (random(10, 100));
  352. return 50;
  353. }
  354.  
  355. RSTile failSafe = new RSTile(3028, 3236);
  356. if (getMyPlayer().getInteracting() == null) {
  357. if (!getMyPlayer().isMoving()) {
  358. RSNPC Seagull = getNearestFreeNPCByID(seagullID);
  359. if (Seagull != null) {
  360. if (tileOnScreen(Seagull.getLocation())) {
  361. atNPC(Seagull, "Attack");
  362. raped++;
  363. } else {
  364. walkTileMM(failSafe);
  365. antiBan();
  366. wait (random(100, 500));
  367. }
  368. }
  369. }
  370. }
  371. return 200;
  372. }
  373. }
Add Comment
Please, Sign In to add comment