Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* MyrSeagullRapist by Myr
- * Do not reproduce this script in any way.
- *
- * Enjoy raping seagulls!
- */
- /* REVISIONS:
- * V3.0: Re-release of script
- * V3.1: Added exp gained and status
- * V3.2: Added failsafe
- * V3.3: Improved paint (thanks so very much Epic_!)
- * V3.3.1: Readded failsafe
- * V3.4: Fixed 'click to continue' bug!
- * ...
- */
- import java.awt.*;
- import java.util.*;
- import org.rsbot.script.*;
- import org.rsbot.bot.*;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.bot.input.Mouse;
- @ScriptManifest(authors = { "Myr" }, category = "Combat", name = "MyrSeagullRapist", version = 3.4, description =
- "<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>")
- public class MyrSeagullRapist extends Script implements PaintListener {
- ///////////////////////////////////
- ////////////INTEGERS///////////////
- ///////////////////////////////////
- public int seagullID[] = { 6116, 6115 };
- public int items[] = { 0 };
- public long startTime = System.currentTimeMillis();
- public int antiban;
- private String status = "Loading script";
- public int raped;
- public int startexp;
- public int expgained;
- public int HPstartexp;
- public int HPexpgained;
- public int paintSelection = 1;
- public int statIndex = 0;
- public boolean runPrayer;
- public boolean runAttack;
- public boolean runStrength;
- public boolean runDefence;
- public boolean runRange;
- public boolean runMagic;
- private final Color background = new Color(0,0,0,200),
- blue = new Color(51, 204, 255, 200),
- black = new Color(0, 0, 0, 200),
- white = new Color(255,255,255,200),
- green = new Color(30,255,30,200);
- ///////////////////////////////////
- /////////////PAINT/////////////////
- ///////////////////////////////////
- public void onRepaint(Graphics g) { //Most of the paint done by Epic_!
- if (isLoggedIn()) {
- int expgained = 0;
- int HPexpgained = 0;
- if (runAttack) {
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_ATTACK);
- statIndex = STAT_ATTACK;
- }
- expgained = skills.getCurrentSkillExp(STAT_ATTACK) - startexp;
- }
- if (runStrength) {
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_STRENGTH);
- statIndex = STAT_STRENGTH;
- }
- expgained = skills.getCurrentSkillExp(STAT_STRENGTH) - startexp;
- }
- if (runDefence) {
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_DEFENSE);
- statIndex = STAT_DEFENSE;
- }
- expgained = skills.getCurrentSkillExp(STAT_DEFENSE) - startexp;
- }
- if (runRange) {
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_RANGE);
- statIndex = STAT_RANGE;
- }
- expgained = skills.getCurrentSkillExp(STAT_RANGE) - startexp;
- }
- if (runMagic) {
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_MAGIC);
- statIndex = STAT_MAGIC;
- }
- expgained = skills.getCurrentSkillExp(STAT_MAGIC) - startexp;
- }
- if ( HPstartexp == 0) {
- HPstartexp = skills.getCurrentSkillExp(STAT_HITPOINTS);
- }
- HPexpgained = skills.getCurrentSkillExp(STAT_HITPOINTS) - HPstartexp;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long totalSeconds = ((System.currentTimeMillis() - startTime) / 1000);
- int EXPGained = skills.getCurrentSkillExp(statIndex) - startexp;
- long EXPPerHour;
- if (totalSeconds == 0) {
- EXPPerHour = 0;
- } else {
- EXPPerHour = (EXPGained * 3600) / totalSeconds;
- }
- long secondsToLvl;
- if (EXPPerHour == 0) {
- secondsToLvl = 0;
- } else {
- secondsToLvl = (skills.getXPToNextLevel(statIndex) * 3600) / EXPPerHour;
- }
- ;
- long hoursToLvl = secondsToLvl / (60 * 60);
- secondsToLvl -= hoursToLvl * (60 * 60);
- long minutesToLvl = secondsToLvl / (60);
- secondsToLvl -= minutesToLvl * (60);
- Mouse m = Bot.getClient().getMouse();
- Point p = new Point(m.x,m.y);
- if (isWithinBounds(p,350,350,70,20)) {
- paintSelection = 0;
- }
- if (isWithinBounds(p,420,350,70,20)) {
- paintSelection = 1;
- }
- g.setColor(background);
- g.fillRoundRect(350,350,140,20,5,5);
- g.fillRoundRect(350,375,140,85,5,5);
- g.setFont(new Font("Calibri", Font.BOLD, 16));
- g.setColor(white);
- g.drawString("EXP", 375, 365);
- g.drawString("INFO", 440, 365);
- g.fillRect(420,350,1,20);
- g.setFont(new Font("Calibri", Font.BOLD, 12));
- int y = 375;
- if (paintSelection == 0) {
- g.setColor(blue);
- g.drawString("Combat EXP: " + expgained, 355, y += 14);
- g.drawString("Hitpoints EXP: " + HPexpgained, 355, y += 14);
- g.drawString("EXP Per Hour: " + EXPPerHour, 355, y += 14);
- g.drawString("Level in: " + hoursToLvl + ":" + minutesToLvl + ":" + secondsToLvl, 355, y += 14);
- g.setColor(white);
- g.drawString("" + skills.getPercentToNextLevel(statIndex)+"%", 355, y += 20);
- g.setColor(green);
- g.fillRoundRect(385, y -= 10, skills.getPercentToNextLevel(statIndex), 10, 5, 10);
- }
- if (paintSelection == 1) {
- g.setColor(white);
- g.drawString("MyrSeagullRapist", 355, y += 14);
- g.setColor(blue);
- g.drawString("Seagulls Raped: " + raped, 355, y += 14);
- g.drawString("Time Running: " + hours + ":" + minutes + ":" + seconds , 355, y += 14);
- g.drawString("Status: " + status, 355, y += 14);
- g.setColor(white);
- g.drawString("Created by Myr", 355, y += 20);
- }
- }
- }
- ///////////////////////////////////
- //////onStart and onFinish/////////
- ///////////////////////////////////
- @SuppressWarnings("deprecation")
- public boolean onStart(Map<String, String> args) {
- Bot.getEventManager().addListener(PaintListener.class, this);
- log("******************************");
- log("***Started MyrSeagullRapist***");
- log("******************************");
- if(args.get("prayer").equals("Yes"))
- runPrayer = true;
- else runPrayer = false;
- if (args.get("prayer").equals("Yes")) {
- items = new int[] { 526, 882, 884, 886, 888, 890, 892 };
- }
- if (args.get("prayer").equals("No")) {
- items = new int[] { 882, 884, 886, 888, 890, 892 };
- }
- if(args.get("skill").equals("Attack"))
- runAttack = true;
- else runAttack = false;
- if(args.get("skill").equals("Strength"))
- runStrength = true;
- else runStrength = false;
- if(args.get("skill").equals("Defence"))
- runDefence = true;
- else runDefence = false;
- if(args.get("skill").equals("Range"))
- runRange = true;
- else runRange = false;
- if(args.get("skill").equals("Magic"))
- runMagic = true;
- else runMagic = false;
- return true;
- }
- public void onFinish(){
- Bot.getEventManager().removeListener(PaintListener.class, this);
- log("******************************");
- log("***Stopped MyrSeagullRapist***");
- log("******************************");
- return;
- }
- ///////////////////////////////////
- //////////////METHODS//////////////
- ///////////////////////////////////
- public boolean isWithinBounds(Point p, int x, int y, int w, int h) {
- if (p.x > x && p.x < x+w && p.y > y && p.y < y+h) {
- return true;
- } else {
- return false;
- }
- }
- public void pickup() {
- if (getMyPlayer().getInteracting() == null) {
- RSItemTile itemtile = getNearestGroundItemByID(items);
- if(itemtile != null) {
- if(tileOnScreen(itemtile))
- atTile(itemtile, "Take");
- wait (random(1000, 1500));
- }
- }
- }
- public void bury() {
- if (isInventoryFull()) {
- while (inventoryContains(526)) {
- atInventoryItem(526, "Bury");
- status = "Burying";
- }
- }
- }
- public void checkForLvlUpMessage() {
- if(RSInterface.getInterface(INTERFACE_LEVELUP).isValid()) {
- wait(random(800, 2000)); //reaction time
- atInterface(INTERFACE_LEVELUP, 3);
- wait(random(2000, 4000));
- }
- }
- public void antiBan(){
- antiban = random(0, 60);
- if(antiban == 12) {
- setCameraRotation(random(1,360));
- }
- if(antiban == 2) {
- moveMouseRandomly(20);
- }
- if(antiban == 17) {
- setCameraAltitude(random(1, 100));
- }
- if(antiban == 6) {
- moveMouseRandomly(750);
- }
- if(antiban == 31) {
- setCameraRotation(random(1,176));
- setCameraAltitude(random(1, 168));
- }
- if(antiban == 38) {
- if (getCurrentTab() != TAB_INVENTORY) {
- openTab(TAB_INVENTORY);
- }
- }
- }
- ///////////////////////////////////
- ////////////////LOOP///////////////
- ///////////////////////////////////
- public int loop() {
- if (getMyPlayer().isMoving()) {
- antiBan();
- status = "Walking";
- return 50;
- } else if (!getMyPlayer().isMoving()) {
- checkForLvlUpMessage();
- pickup();
- }
- if (runPrayer) {
- bury();
- }
- if (!isRunning() && getEnergy() > random(40, 100)) {
- setRun(true);
- }
- if (getMyPlayer().isInCombat()) {
- status = "In combat";
- antiBan();
- wait (random(10, 100));
- return 50;
- }
- RSTile failSafe = new RSTile(3028, 3236);
- if (getMyPlayer().getInteracting() == null) {
- if (!getMyPlayer().isMoving()) {
- RSNPC Seagull = getNearestFreeNPCByID(seagullID);
- if (Seagull != null) {
- if (tileOnScreen(Seagull.getLocation())) {
- atNPC(Seagull, "Attack");
- raped++;
- } else {
- walkTileMM(failSafe);
- antiBan();
- wait (random(100, 500));
- }
- }
- }
- }
- return 200;
- }
- }
Add Comment
Please, Sign In to add comment