Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Graphics;
- import java.util.Map;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Espz" }, category = "Other", name = "Espz's Gilded Boner", version = 1.0, description = "<html><head><style type='text/css'> hr {color: white} p {margin-left: 20px}</style></head><body><center><b><font size='6' color='red'>Gilded Boner v1.0</font></b><br><b><font size='4' color='red'>Written by Espz</font></b><br></center><center><table border='0'><tr><td colspan='2'><center><font size='4'><b>:: Script Settings ::</b></font></center></td></tr><br><center>Start this at the Yanille bank with the chosen bones in your inventory.<br><br><tr><td><b>Name of player with altar: </b></td><td><tr><td><br><input type=\"text\" name=\"nameOfUser\" value=\"\">What bones should we use? </td><br><td width=156 align=left class=style1><select name=bone><option>Normal Bones</option><option>Wolf Bones</option><option>Burnt Bones</option><option>Monkey Bones</option><option>Bat Bones</option><option>Big Bones</option><option>Jogre Bones</option><option>Zogre Bones</option><option>Shaikahan Bones</option><option>Babydragon Bones</option><option>Wyvern Bones</option><option>Dragon Bones</option><option>Fayrg Bones</option><option>Raurg Bones</option><option>Dagannoth Bones</option><option>Ourg Bones</option></select></center></body></html>")
- public class GildedBoner extends Script implements PaintListener,
- ServerMessageListener {
- // SCRIPT MANIFEST:
- ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- // TILES:
- public RSTile[] BankToAltar = {new RSTile(2611, 3094), new RSTile(2596, 3099), new RSTile(2579, 3100), new RSTile(2565, 3091), new RSTile(2548, 3094), new RSTile(2544, 3096)};
- public RSTile[] AltarToBank = (reversePath(BankToAltar));
- //BONES:
- public int BoneID;
- public String BoneCommand = "";
- //BANK:
- public int B = 2213;
- public RSObject Bank = getNearestObjectByName("Bank booth");
- //PORTAL:
- public int P = 15482;
- public RSObject Portal = getNearestObjectByID(P);
- //USER WITH ALTAR:
- public String userWithAltar = "";
- //ALTAR:
- public int[] GildedAltar = {13197};
- //STATUS:
- public String Status = "";
- //TIMERS:
- public long startTime = System.currentTimeMillis();
- //COUNTERS:
- public int origExp = 0;
- public int origLvl = 0;
- public int bonesDone = 0;
- public boolean onStart(Map<String, String> args) {
- userWithAltar = args.get("nameOfUser");
- if (args.get("bone").equals("Normal Bones")) {
- BoneID = 526;
- BoneCommand = "Normal bones";
- }
- if (args.get("bone").equals("Wolf Bones")) {
- BoneID = 2859;
- BoneCommand = "Wolf bones";
- }
- if (args.get("bone").equals("Burnt Bones")) {
- BoneID = 528;
- BoneCommand = "Burnt bones";
- }
- if (args.get("bone").equals("Monkey Bones")) {
- BoneID = 3183;
- BoneCommand = "Monkey bones";
- }
- if (args.get("bone").equals("Bat Bones")) {
- BoneID = 530;
- BoneCommand = "Bat bones";
- }
- if (args.get("bone").equals("Big Bones")) {
- BoneID = 532;
- BoneCommand = "Big bones";
- }
- if (args.get("bone").equals("Jogre Bones")) {
- BoneID = 3125;
- BoneCommand = "Jogre bones";
- }
- if (args.get("bone").equals("Zogre Bones")) {
- BoneID = 4812;
- BoneCommand = "Zogre bones";
- }
- if (args.get("bone").equals("Shaikahan Bones")) {
- BoneID = 3123;
- BoneCommand = "Shaikahan bones";
- }
- if (args.get("bone").equals("Babydragon Bones")) {
- BoneID = 534;
- BoneCommand = "Babydragon bones";
- }
- if (args.get("bone").equals("Wvyern Bones")) {
- BoneID = 6812;
- BoneCommand = "Wvyern bones";
- }
- if (args.get("bone").equals("Dragon Bones")) {
- BoneID = 536;
- BoneCommand = "Dragon bones";
- }
- if (args.get("bone").equals("Fayrg Bones")) {
- BoneID = 4830;
- BoneCommand = "Fayrg bones";
- }
- if (args.get("bone").equals("Raurg Bones")) {
- BoneID = 4832;
- BoneCommand = "Raurg bones";
- }
- if (args.get("bone").equals("Dagannoth Bones")) {
- BoneID = 6729;
- BoneCommand = "Dagannoth bones";
- }
- if (args.get("bone").equals("Ourg Bones")) {
- BoneID = 4834;
- BoneCommand = "Ourg bones";
- }
- startTime = System.currentTimeMillis();
- origExp = skills.getCurrentSkillExp(STAT_PRAYER);
- origLvl = skills.getCurrentSkillLevel(STAT_PRAYER);
- return true;
- }
- public void deposit() {
- if (getInventoryCountExcept(BoneID) > 0) {
- bank.depositAllExcept(BoneID);
- }
- wait(random(200, 400));
- }
- public void withdraw() {
- if (bank.getCount(BoneID) == 0) {
- log("You have no bones in your bank.");
- Status = "Closing script.";
- bank.close();
- logout();
- stopAllScripts();
- }
- bank.withdraw(BoneID, 0);
- wait(random(800, 1000));
- if (getInventoryCount(BoneID) > 0) {
- bank.close();
- }
- }
- public void bank() {
- if (!bank.isOpen()) {
- if (getMyPlayer().getAnimation() == -1) {
- atObject(Bank, "Use-Quickly");
- } else {
- bank.open();
- }
- wait(random(600, 800));
- } else {
- deposit();
- withdraw();
- }
- }
- @Override
- public int loop() {
- if(isInventoryFull()){
- if(getNearestObjectByID(P) != null){
- Status = "Entering Portal";
- atObject(Portal, "Enter");
- wait(random(50, 200));
- moveMouse(random(182, 341), random(423, 438));
- wait(random(50, 200));
- clickMouse(true);
- wait(random(1000, 4500));
- Status = "Entering name";
- sendText(userWithAltar, true);
- } else {
- walkPathMM(BankToAltar);
- }
- } else if(!isInventoryFull()) {
- if(getNearestObjectByID(B) != null){
- Status = "Banking";
- bank();
- } else {
- atObject(Portal, "Enter");
- Status = "Banking";
- walkPathMM(AltarToBank);
- }
- } else if(getNearestObjectByID(GildedAltar) != null){
- atInventoryItem(BoneID, "Use");
- Status = "Boning";
- wait(random(10, 70));
- atObject(findObject(GildedAltar), BoneCommand);
- }
- return random(500, 800);
- }
- public void onRepaint(Graphics Espz) {
- long runTime = System.currentTimeMillis() - startTime;
- int secs = ((int) ((runTime / 1000) % 60));
- int mins = ((int) (((runTime / 1000) / 60) % 60));
- int hours = ((int) ((((runTime / 1000) / 60) / 60) % 60));
- int x = 2;
- int y = 9;
- Espz.setColor(Color.BLACK);
- Espz.fill3DRect(x, y, 180, 100, true);
- x += 5;
- y += 15;
- Espz.setColor(Color.WHITE);
- Espz.drawString(properties.name() + " v" + properties.version(), x, y);
- y += 30;
- Espz.drawString("Script run time: " + (hours < 10 ? "0" : "") + hours + ":" + (mins < 10 ? "0" : "") + mins + ":" + (secs < 10 ? "0" : "") + secs, x, y);
- y += 15;
- Espz.drawString("Status: " + Status, x, y);
- y += 15;
- Espz.drawString("Bones done: " + bonesDone, x, y);
- y += 15;
- x = 2;
- y = 129;
- Espz.setColor(Color.BLACK);
- Espz.fill3DRect(x, y, 180, 100, true);
- x += 5;
- y += 15;
- Espz.setColor(Color.CYAN);
- y += 20;
- Espz.drawString("Exp Gained: " + (skills.getCurrentSkillExp(STAT_PRAYER) - origExp), x, y);
- y += 15;
- Espz.drawString("Exp To Next Level: " + skills.getPercentToNextLevel(STAT_PRAYER), x, y);
- y += 15;
- Espz.drawString("Levels Gained: " + (skills.getCurrentSkillLevel(STAT_PRAYER) - origLvl), x, y);
- y += 15;
- }
- @Override
- public void serverMessageRecieved(ServerMessageEvent Espz) {
- final String Text = Espz.getMessage().toLowerCase();
- if (Text.contains("The gods are very pleased with your offering.")) {
- bonesDone++;
- }
- }
- }
Add Comment
Please, Sign In to add comment