- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.image.BufferedImage;
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Map;
- import javax.imageio.ImageIO;
- import org.rsbot.bot.Bot;
- import org.rsbot.bot.input.Mouse;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Bank;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = {"Icanon"}, category = "Magic",
- name = "Icanon's Wine Grabber", version = 1.0,
- description = ("<html>\n"
- + "<body style='font-family: Segoe Print; color:white; padding: 0px; text-align: center; background-color: GREEN;'>"
- + "<h2>Stoned Al Kharid Tanner</h2>"
- + "<b>by Tokeaholic</h2></b>"
- + "<br><b>If Selling, Please Sell Above MID</h2></b>"
- + "<br>Start in Al-Kharid Bank, with your Hides and Gold at the Top of the Bank."
- + "<br><b>Select the type of Staff you want to use? : "
- + "<select name=\"Staff\"><option>Air<option>Water<option>None</select>"
- + "<br><b>Select Method?"
- + "<select name=\teleporting\"><option>Faldor Tele-Tab<option>Walk<option>Fallytele</select>"
- + "<br><b>Select a Summoning Pet:</br>"
- + "<select name=\"summon\"><option>None</option><option>Thorny Snail</option><option>Kalphite</option><option>Terror Bird</option><option>Tortise</option><option>Yak</option></select>"
- + "<br><b>I discourage the use of familars due to the Fact that there not 100 complete good yet."
- + "<br><b>Remember I am not responsible if you die, while picking you must be over level 58.</br>"+
- + "<br><b>Recommended Equipment - Ring of life and Phoinex necklace."
- + "<br><b>Updates are in the future."
- + "<br><b>Have Auto-Retaliate off when starting, Also start in the hall before entering ankous.")
- public class IcanonsWineGrabber extends Script implements PaintListener {
- // Paths
- RSTile[] toWine = {
- new RSTile(2947, 3368), new RSTile(2953, 3378), new RSTile(2963, 3385),
- new RSTile(2965, 3396), new RSTile(2965, 3407), new RSTile(2957, 3416),
- new RSTile(2952, 3426), new RSTile(2950, 3437), new RSTile(2948, 3448),
- new RSTile(2946, 3459), new RSTile(2946, 3470), new RSTile(2946, 3481),
- new RSTile(2945, 3492), new RSTile(2941, 3503), new RSTile(2941, 3514),
- new RSTile(2933, 3516)};
- RSTile[] toBank = reversePath{toWine};
- // Intigers
- int failCount = 0;
- public int startExp = 0;
- public int gainedExp = 0;
- public int avgPerHour = 0;
- public int startLevel = 0;
- public int oldExp = 0;
- public long lastAvgCheck = 0;
- public float secExp = 0;
- public float minuteExp = 0;
- public float hourExp = 0;
- long startTime = 0;
- long runTime = 0, seconds = 0 ,minutes = 0, hours = 0;
- public int staff = 0;
- public int staffOfWater;
- public int staffOfAir;
- int runes[] = {563, 556, 555 };
- int zWine = 245;
- int faldorTeleTab = 8009;
- int grabCoordsX[] = { 707, 725 };
- int grabCoordsY[] = { 269, 283 };
- int fallyCoordsX[] = { 590, 602 };
- int fallyCoordsY[] = { 295, 308 };
- int teleGear[] = {8009, 563, 556, 555 };
- // Images
- BufferedImage normal = null;
- BufferedImage mouse1 = null;
- BufferedImage mouse2 = null;
- BufferedImage mouse3 = null;
- BufferedImage mouse4 = null;
- BufferedImage mouse5 = null;
- BufferedImage mouse6 = null;
- BufferedImage mouseAll = null;
- // Longs
- private long scriptStartTime = 0;
- // Strings
- public String staffType;
- public String actionID;
- public String status;
- public String uWines;
- public String uTeleGrab;
- // Script Start
- public boolean onStart(Map<String, String> args) {
- try {
- final URL normalURL = new URL("http://i49.tinypic.com/2n6r7l1.png");
- final URL mouse1URL = new URL("http://i46.tinypic.com/5nlkd4.png");
- final URL mouse2URL = new URL("http://i48.tinypic.com/hui0wi.png");
- final URL mouse3URL = new URL("http://i50.tinypic.com/67ulwg.png");
- final URL mouse4URL = new URL("http://i50.tinypic.com/24mhvyp.png");
- final URL mouse5URL = new URL("http://i46.tinypic.com/nz2829.png");
- final URL mouse6URL = new URL("http://i45.tinypic.com/2uttfl1.jpg");
- final URL mouseAllURL = new URL("http://i50.tinypic.com/rsd24p.png");
- normal = ImageIO.read(normalURL);
- mouse1 = ImageIO.read(mouse1URL);
- mouse2 = ImageIO.read(mouse2URL);
- mouse3 = ImageIO.read(mouse3URL);
- mouse4 = ImageIO.read(mouse4URL);
- mouse5 = ImageIO.read(mouse5URL);
- mouse6 = ImageIO.read(mouse6URL);
- mouseAll = ImageIO.read(mouseAllURL);
- }
- catch (MalformedURLException e) {
- log("Cannot Read Image URL Correctly");
- }
- catch (IOException e) {
- log("Cannot Open Cursor Image");
- }
- if (args.get("summon").equals ("None")) {
- pouch = 0;
- }
- if (args.get("summon"). equals ("Thorny Snail")) {
- pouch = 12019;
- }
- if (args.get("summon").equals ("Kalphite")) {
- pouch = 12063;
- }
- if (args.get("summon").equals ("Terror Bird")) {
- pouch = 12007;
- }
- if (args.get("summon").equals ("Tortoise")) {
- pouch = 12031;
- }
- if (args.get("summon").equals ("Yak")) {
- pouch = 12093;
- }
- if(args.get("teleporting").equals("Faldor Tele-Tab")) {
- teleport = 8009;
- }
- if(args.get("teleporting").equals("Walk")) {
- teleport = 0;
- }
- if(args.get("teleporting").equals("Fally Tele")) {
- teleport =
- }
- return true;
- }
- public boolean useBank() {
- if(isInventoryFull()) {
- RSObject BankBooth = GetNearestObjectById(11758);
- if(bankBooth == null);
- atObject(bankBooth, "Use-quickly");
- }
- return true;
- }
- public boolean deposit() {
- return bank.depositAllExcept(teleGear);
- }
- public boolean withdraw() {
- bank.withdraw(pouch, 1);
- return bank.close();
- }
- public boolean summon() {
- atInventoryItem(pouch, "summon");
- return true;
- }
- public boolean toWine() {
- if(!isInventoryfull()) {
- walkPathMM(randomizePath(toWine,2,2));
- wait(random(1500,3000));
- }
- return isActive;
- }
- puglic boolean teleGrabWine(Point p) {
- // new method, named Telegrab requires input of a Point named p
- if(game.getCurrentTab() != Game.TAB_MAGIC)
- // single line if statement, refers only to below line. tab check
- game.openTab(Game.TAB_MAGIC);
- //opens tab if check is true
- if(game.getCurrentTab() == Game.TAB_MAGIC) {
- // check again, should always be true because of above check, added just incase
- IComponent spellInterface = interfaces.getComponent(192,26);
- // looks for interface with the id of 192 and child of 26
- if(spellInterface != null)
- // single line if, check if interface is around
- if(spellInterface.doAction("Cast")) {
- // a very interesting call to a boolean, note doAction are booleans and return true after they do something
- mouse.moveMouse(p, false);
- // therefore if it did actually do something I will click on the point given by p, in this case p is ground item location
- return true;
- // this boolean action will return true if I click on the object and casted
- }
- }
- return false;
- }
- public boolean storeFamiliar() {
- if(isInventoryFull()) {
- RSNPC scary = getNearestFreeNPCByName("Thorny snail, Kalphite, Terrorbird, tortiose, Yak");
- if (scary !=null);
- atNPC(scary, "Store");
- atInventoryItem(snape, "Store");
- }
- return true;
- }
- private boolean isInventoryFull() {
- // TODO Auto-generated method stub
- return false;
- }
- boolean teleGrabSome(Point p) {
- // new method, named Telegrab requires input of a Point named p
- if(game.getCurrentTab() != Game.TAB_MAGIC)
- // single line if statement, refers only to below line. tab check
- game.openTab(Game.TAB_MAGIC);
- //opens tab if check is true
- if(game.getCurrentTab() == Game.TAB_MAGIC) {
- // check again, should always be true because of above check, added just incase
- IComponent spellInterface = interfaces.getComponent(192,26);
- // looks for interface with the id of 192 and child of 26
- if(spellInterface != null)
- // single line if, check if interface is around
- if(spellInterface.doAction("Cast")) {
- // a very interesting call to a boolean, note doAction are booleans and return true after they do something
- mouse.moveMouse(p, false);
- // therefore if it did actually do something I will click on the point given by p, in this case p is ground item location
- return true;
- // this boolean action will return true if I click on the object and casted
- }
- }
- return false;
- }
- public boolean leave() {
- if(isInventoryFull()) {
- atInventoryItem(teleport, "break");
- }else{
- walkPathmm(randomizePath(toBank,2,2));
- }else{
- magic.SPELL_FALADOR_TELEPORT
- }
- return true;
- }
- @Override
- public int loop() {
- setRun(true);
- setCameraAltitude(true);
- if(isInventoryFull())
- if(useBank()) {
- if(deposit()) {
- if(withdraw()) {
- if(summon())
- return random(500,800);
- }
- }else{
- if(!isInventoryFull()) {
- if(summon()) {
- if(toWine()) {
- if(teleGrabWine()) {
- if(isInventoryFull()) {
- if(storeFamiliar()) {
- if(teleGrabSome())
- if(leave())
- return random(300,700);
- }
- }
- }
- }
- }
- }
- }
- }
- return random (1000,2000);
- }
- @Override
- public void onRepaint(Graphics g) {
- 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;
- //This paint was made using Enfilade's Paint Maker
- g.setColor(new Color(0, 255, 0));
- g.fillRoundRect(7, 345, 489, 57, 4, 4);
- g.setFont(new Font("Arial Black", 0, 20));
- g.setColor(new Color(255, 255, 0));
- g.drawString("Icanon's Wine Grabber", 137, 377);
- g.setColor(new Color(255, 51, 0, 203));
- g.fillRoundRect(7, 402, 489, 57, 4, 4);
- g.setColor(new Color(0, 0, 0));
- g.fillRect(6, 459, 489, 14);
- g.setFont(new Font("Arial Black", 0, 8));
- g.setColor(new Color(255, 255, 0));
- g.drawString("This was Made by Icanon, from I canon Inc.", 13, 469);
- g.setFont(new Font("Arial Black", 0, 11));
- g.setColor(new Color(255, 255, 0));
- g.drawString("RunTime:" + hours + " hours " + minutes + " minutes " + seconds + " seconds.", 13, 418);
- g.setFont(new Font("Arial Black", 0, 11));
- g.setColor(new Color(255, 255, 0));
- g.drawString("Trips:" + Runs, 13, 436);
- g.setFont(new Font("Arial Black", 0, 11));
- g.setColor(new Color(255, 255, 0));
- g.drawString("Took:"+ Runs*28 + " snape grass.", 13, 454);
- g.setFont(new Font("Arial Black", 0, 11));
- g.setColor(new Color(255, 255, 0));
- g.drawString("Made:" + Integer.toString(Runs) + " load(s).", 307, 454);
- }
- public void onFinish() {
- log("Thanks for using");
- }
- private void log(String string) {
- // TODO Auto-generated method stub
- }
- }