Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.util.*;
- import java.util.List;
- import java.util.logging.Level;
- import javax.accessibility.*;
- import javax.swing.*;
- import org.rsbot.bot.Bot;
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.event.events.ServerMessageEvent;
- @ScriptManifest(authors = { "Grapes" }, category = "Combat", name = "Grapes' Hill Giants", version = 1.00, description = "<html><head></head><body><center><h1>Grapes' Hill Giants</h1></center><br>"
- + "<center><strong>By Grapes</strong></center><br>"
- )
- public class GrapesHillGiants extends Script implements PaintListener, ServerMessageListener {
- //VARIABLES\\
- private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- private final int[] giantID = { 4691, 4692, 4693 };
- private final int[] foodID = { 6701, 365, 1891, 1897, 2011, 379, 7946, 329,
- 385, 333, 361 };
- private final int[] bigBonesID = { 523 };
- private final int limpwurtRootID = ( 225 );
- private final int[] lawRuneID = { 563 };
- private final int[] natureRuneID = { 561 };
- private final int[] items = { 523, 225, 563, 561 };
- public int bonesPrice = grandExchange.loadItemInfo(523).getMarketPrice();
- public int rootPrice = grandExchange.loadItemInfo(225).getMarketPrice();
- public int lawPrice = grandExchange.loadItemInfo(563).getMarketPrice();
- public int naturePrice = grandExchange.loadItemInfo(561).getMarketPrice();
- public long startTime = System.currentTimeMillis();
- long runTime = System.currentTimeMillis() - startTime;
- public int strengthExp = skills.getCurrentSkillExp(STAT_STRENGTH);
- public int attackExp = skills.getCurrentSkillExp(STAT_ATTACK);
- public int defenseExp = skills.getCurrentSkillExp(STAT_DEFENSE);
- public int rangeExp = skills.getCurrentSkillExp(STAT_RANGE);
- public int hitpointsExp = skills.getCurrentSkillExp(STAT_HITPOINTS);
- public int gainedStrength = skills.getCurrentSkillExp(STAT_STRENGTH)
- - strengthExp;
- public int gainedAttack = skills.getCurrentSkillExp(STAT_ATTACK)
- - attackExp;
- public int gainedDefense = skills.getCurrentSkillExp(STAT_DEFENSE)
- - defenseExp;
- public int gainedRange = skills.getCurrentSkillExp(STAT_RANGE) - rangeExp;
- public int gainedHitpoints = skills.getCurrentSkillExp(STAT_HITPOINTS)
- - hitpointsExp;
- public int totalXpGained = gainedStrength + gainedAttack + gainedDefense
- + gainedRange;
- public int Hp = skills.getCurrentSkillExp(STAT_HITPOINTS);
- int xpPerHour = (int) (3600000.0 / runTime * totalXpGained);
- protected int getMouseSpeed() {
- return (random(6, 9));
- }
- public boolean onStart(Map<String, String> args) {
- startTime = System.currentTimeMillis();
- strengthExp = skills.getCurrentSkillExp(STAT_STRENGTH);
- attackExp = skills.getCurrentSkillExp(STAT_ATTACK);
- defenseExp = skills.getCurrentSkillExp(STAT_DEFENSE);
- rangeExp = skills.getCurrentSkillExp(STAT_RANGE);
- hitpointsExp = skills.getCurrentSkillExp(STAT_HITPOINTS);
- return true;
- }
- public boolean run() {
- if (!isRunning() && getEnergy() > 50) {
- setRun(true);
- }
- return true;
- }
- public boolean attack(){
- RSNPC Giant = getNearestFreeNPCToAttackByID(giantID);
- atNPC(Giant, "Attack");
- wait(random(1000, 1500));
- if (getMyPlayer().getInteracting() != null) {
- wait(random(1000,2000));
- }
- return true;
- }
- public boolean eat() {
- if (skills.getCurrentSkillLevel(STAT_HITPOINTS) <= (skills
- .getRealSkillLevel(STAT_HITPOINTS) / 4)) {
- for (int i = 0; i < foodID.length; i++) {
- if (getInventoryCount(foodID[i]) != 0) {
- atInventoryItem(foodID[i], "Eat");
- if (getInventoryCount(foodID[i]) != 0) {
- wait(random(436, 669));
- }
- return true;
- }
- if (foodID == null)
- ;
- return false;
- }
- return true;
- }
- return true;
- }
- public boolean pickUp(){
- RSItemTile item = getNearestGroundItemByID(items);
- if (items != null);
- return pickUp();
- }
- public int loop() {
- while (getMyPlayer().isMoving()) {
- return (random(100, 300));
- }
- if (!isRunning() && getEnergy() > 50) {
- setRun(true);
- }
- if (skills.getCurrentSkillLevel(STAT_HITPOINTS) <= (skills
- .getRealSkillLevel(STAT_HITPOINTS) / 4)) {
- eat();
- }
- if (getMyPlayer().getInteracting() != null) {
- return random(300, 450);
- }
- if (getMyPlayer().getInteracting() == null) {
- attack();
- }
- return 100;
- }
- public void serverMessageRecieved(final ServerMessageEvent arg0) {
- final String serverString = arg0.getMessage();
- }
- public void onRepaint(Graphics g) {
- if(!isLoggedIn() || isLoginScreen())
- return;
- 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 minutes2 = minutes + (hours * 60);
- g.setColor(new Color(128, 0, 0, 128));
- g.fillRoundRect(550, 206, 185, 260, 10, 10);
- g.setColor(Color.white);
- g.setFont(new Font("Arial", Font.BOLD, 13));
- g.drawString("Grapes' Hill Giants", 588, 225);
- g.setFont(new Font("Arial", Font.PLAIN, 12));
- g.drawString("Time Running: " + hours + ":" + minutes + ":" + seconds,
- 560, 255);
- gainedStrength = skills.getCurrentSkillExp(STAT_STRENGTH) - strengthExp;
- gainedAttack = skills.getCurrentSkillExp(STAT_ATTACK) - attackExp;
- gainedDefense = skills.getCurrentSkillExp(STAT_DEFENSE) - defenseExp;
- gainedHitpoints = skills.getCurrentSkillExp(STAT_HITPOINTS)
- - hitpointsExp;
- g.drawString("Strength XP Gained: " + gainedStrength, 560, 275);
- g.drawString("Attack XP Gained: " + gainedAttack, 560, 295);
- g.drawString("Defense XP Gained: " + gainedDefense, 560, 315);
- g.drawString("Hitpoints XP Gained: " + gainedHitpoints, 560, 335);
- float xpPerSec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && totalXpGained > 0) {
- xpPerSec = (float) totalXpGained
- / (float) (seconds + minutes * 60 + hours * 60 * 60);
- }
- final float xpPerMin = xpPerSec * 60;
- final float xpPerHour = xpPerMin * 60;
- totalXpGained = gainedStrength + gainedAttack + gainedDefense
- + gainedRange;
- g.drawString("Exp/Hour: " + xpPerHour, 560, 370);
- }
- public void onFinish() {
- }
- }
Add Comment
Please, Sign In to add comment