- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Point;
- 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.Constants;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Calculations;
- 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>I canon's wine grabber</h2><b>"
- + "<b>by I canon</h2></b>"
- + "<br><b>If Selling, Please Sell Above MID</h2></b>"
- + "<br>Start in Zamorak Church."
- + "<br><b>THERE IS NO PAINT YET SO PLEASE DONT ASK!"
- + "<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>FALADOR TELEPORT CURRENTLY DOES NOT WORK SO IF UR F2P SORRY WILL BE UPDATED SOON"
- + "<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."
- + "<br>")
- public class IcanonsWineGrabber extends Script{
- // Tiles
- 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)};
- // Paths
- 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;
- public int MEDS;
- int teleport;
- public int tgrabID = 44;
- 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 };
- int pouch;
- // 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;
- }
- 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;
- }
- public boolean teleGrab() {
- RSTile med = getGroundItemByID(zWine);
- if (getCurrentTab() != Constants.TAB_MAGIC) {
- openTab(Constants.TAB_MAGIC);
- wait(random(200, 500));
- }
- castSpell(tgrabID);
- Point zWine = Calculations.tileToScreen(grabCoordsX.length, grabCoordsY(), 6);
- clickMouse(zWine, false);
- wait(random(500, 900));
- atMenu("Cast");
- MEDS++;
- return true;
- }
- private int grabCoordsY() {
- // TODO Auto-generated method stub
- return 0;
- }
- public boolean storeFamiliar() {
- if(!isInventoryFull()) {
- RSNPC scary = getNearestFreeNPCByName("Thorny snail, Kalphite, Terrorbird, tortiose, Yak");
- if (scary !=null);
- atNPC(scary, "Store");
- atInventoryItem(zWine, "Store");
- }
- return true;
- }
- public boolean teleGrabSome() {
- RSTile med = getGroundItemByID(zWine);
- if (getCurrentTab() != Constants.TAB_MAGIC) {
- openTab(Constants.TAB_MAGIC);
- wait(random(200, 500));
- }
- castSpell(tgrabID);
- Point zWine = Calculations.tileToScreen(grabCoordsX.length, grabCoordsY.length, 6);
- clickMouse(zWine, false);
- wait(random(500, 900));
- atMenu("Cast");
- MEDS++;
- }
- public boolean leave() {
- if(!isInventoryFull()) {
- atInventoryItem(teleport, "break");
- }else{
- walkPathMM(randomizePath(toBank,2,2));
- }
- return true;
- }
- 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(teleGrab()) {
- if(!isInventoryFull()) {
- if(storeFamiliar()) {
- if(teleGrabSome())
- if(leave())
- return random(300,700);
- }
- }
- }
- }
- }
- }
- }
- return random (1000,2000);
- }
- }