Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.util.Map;
- import org.rsbot.bot.Bot;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.GEItemInfo;
- import org.rsbot.script.*;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSItemTile;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.script.Bank;
- import org.rsbot.util.ScreenshotUtil;
- @ScriptManifest(authors = { "xXNoiceXx & Preston" }, category = "Other", name = "Epic Vial Filler", version = 1.0, description =
- "<html><head>" +
- "</head><body>" +
- "<center><h2>Epic Vial Filler</h2></center>" +
- "<center> </center>" +
- "<center>Start This Script in The West Bank of Varock With Empty Vials in The First Slot of Your Bank!</center>" +
- "<center> </center>" +
- "<center> </center>" +
- "<center>Great For Getting Vials Filled For Herblore!</center>" +
- "<center> </center>" +
- "<center> </center>" +
- "<center>This Script Fills Vials at The Varrock Main Fountain and Banks at The West Varrock Bank!</center>" +
- "<center> </center>" +
- "<center><strong>Created by xXNoiceXx & Preston!</strong></center>" +
- "</body></html>")
- public class EpicVialFiller extends Script implements PaintListener {
- final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- //OTHER VARIABLES
- private int runEnergy = random(25, 90);
- public long startTime = System.currentTimeMillis();
- private String status = "";
- public int loads = 0;
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- 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(Color.black.darker());
- g.fillRoundRect(553, 211, 180,100, 15, 15);
- g.setFont(new Font("Comic Sans", Font.BOLD, 16));
- g.setColor(Color.green);
- g.drawString("Noice's Vial Filler v1.0" , 560, 242);
- g.setColor(Color.red);
- g.setFont(new Font("Times New Roman", Font.BOLD, 12));
- g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds , 558, 265);
- g.setColor(Color.white);
- g.drawString("Status : " + status , 558, 280);
- g.setColor(Color.cyan);
- g.drawString("Loads Filled/Banked : " + loads, 558, 295);
- }
- }
- private void startRunning(final int energy) {
- if (getEnergy() >= energy && !isRunning()) {
- runEnergy = random(35, 70);
- setRun(true);
- wait(random(500, 750));
- }
- }
- //ITEM ID
- public int[] emptyvial = { 229 };
- public int[] emptyvials = { 229 };
- public int[] waterviaal = { 227 };
- public int[] watervial = { 227 };
- public int[] fountain = { 24265 };
- //PATHS
- RSTile[] toBank = { new RSTile(3206, 3429), new RSTile(3212, 3428), new RSTile(3208, 3428), new RSTile(3202, 3429), new RSTile(3195, 3429), new RSTile(3186, 3435)};
- RSTile[] toWater = { new RSTile(3186, 3435), new RSTile(3193, 3429), new RSTile(3200, 3429), new RSTile(3209, 3429)};
- //TILES
- RSTile atfount = new RSTile(3212, 3429);
- RSTile atbank = new RSTile(3187, 3463);
- //NPC
- public int bank = 11402;
- public boolean onStart(Map<String, String>args) {
- startTime = System.currentTimeMillis();
- openTab(4);
- return true;
- }
- public boolean withdraw() {
- if (RSInterface.getInterface(762).isValid()){
- //bank.atItem(emptyvial, "Withdraw-All");
- moveMouse(new Point(52, 108), 5, 5);
- wait(random(500,1000));
- clickMouse(false);
- wait(random(100,200));
- atMenu("Withdraw-All");
- wait(random(100,150));
- moveMouse(489, 35);
- wait(random(500, 1000));
- clickMouse(true);
- }
- return true;
- }
- public void onFinish(){
- log("Thank You For Using My Script!");
- return;
- }
- public boolean openBank() {
- final RSNPC bank = getNearestFreeNPCByID(6533);
- if (bank == null) {
- return false;
- }
- if (!tileOnScreen(bank.getLocation())) {
- turnToTile(bank.getLocation(), 10);
- }
- return atTile(bank.getLocation(), "Bank Banker");
- }
- public boolean bankopen() {
- RSObject bankbooth = getNearestObjectByID(11402);
- atObject(bankbooth, "Use-quickly");
- wait(random(1000, 2000));
- status = "Opening Bank";
- return(true);
- }
- public boolean usevial() {
- openTab(4);
- moveMouse(705, 454);
- clickMouse(true);
- wait(random(500, 800));
- RSObject fountain = getNearestObjectByID(24265);
- atObject(fountain, "Use Vial");
- status = "Filling Vials";
- return true;
- }
- public boolean usevialw() {
- openTab(4);
- moveMouse(705, 454);
- clickMouse(true);
- wait(random(500, 800));
- RSObject fountain = getNearestObjectByID(24265);
- atObject(fountain, "Use Vial");
- wait(random(2000, 4000));
- status = "Filling Vials";
- return true;
- }
- public boolean isIdle() {
- return !getMyPlayer().isMoving() && getMyPlayer().getAnimation() == -1;
- }
- public boolean animationIs() {
- if (getMyPlayer().getAnimation() == 832) {
- }
- return true;
- }
- public boolean atfountain() {
- return (distanceTo(atfount) < 5);
- }
- public boolean atbank() {
- return (distanceTo(getNearestObjectByID(bank)) <= 5);
- }
- public boolean needtobank() {
- return (getMyPlayer().isInCombat() == true);
- }
- public boolean isInventoryFull() {
- return getInventoryCount(watervial) == 28;
- }
- public boolean need2bank() {
- return (getInventoryCount(watervial) == 28);
- }
- public boolean stabledeposit() {
- if(getInventoryCount(watervial) == 28) {
- if(RSInterface.getInterface(762).isValid()) {
- moveMouse(399, 311);
- clickMouse(true);
- loads++;
- }
- }
- return true;
- }
- public void stableclose() {
- if (RSInterface.getInterface(762).isValid()){
- atInterface(762, 37);
- wait(random(500, 800));
- }
- }
- public int loop() {
- if (getMyPlayer().isInCombat()) {
- log("We are in combat, banking with what we got!");
- stopScript();
- }
- if (isInventoryFull()) {
- startRunning(runEnergy);
- walkPathMM(toBank);
- status = "Running to Bank";
- }
- if (atbank()) {
- if(getInventoryCount(watervial) == 28) {
- wait(random(500, 1000));
- }
- }
- if (atfountain()) {
- if(getInventoryCount(emptyvial) == 28) {
- if (isIdle()) {
- usevial();
- status = "Filling Vials";
- }
- }
- }
- if (animationIs()) {
- wait(random(2000, 4000));
- status = "Filling and Waiting";
- }
- if (getInventoryCount(emptyvial) == 0) {
- if (atbank()) {
- wait(random(500, 1000));
- bankopen();
- stabledeposit();
- withdraw();
- stableclose();
- status = "All Banking";
- }
- }
- if (getInventoryCount(emptyvial) == 28) {
- startRunning(runEnergy);
- walkPathMM(toWater);
- status = "Walking to Fountain";
- }
- return(10);
- }
- }
Add Comment
Please, Sign In to add comment