Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 8.21 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.awt.Point;
  5. import java.awt.image.BufferedImage;
  6. import java.io.IOException;
  7. import java.net.MalformedURLException;
  8. import java.net.URL;
  9. import java.util.Map;
  10.  
  11. import javax.imageio.ImageIO;
  12.  
  13. import org.rsbot.bot.Bot;
  14. import org.rsbot.bot.input.Mouse;
  15. import org.rsbot.event.events.ServerMessageEvent;
  16. import org.rsbot.event.listeners.PaintListener;
  17. import org.rsbot.script.Bank;
  18. import org.rsbot.script.Script;
  19. import org.rsbot.script.Constants;
  20. import org.rsbot.script.ScriptManifest;
  21. import org.rsbot.script.Calculations;
  22. import org.rsbot.script.wrappers.RSNPC;
  23. import org.rsbot.script.wrappers.RSObject;
  24. import org.rsbot.script.wrappers.RSTile;
  25.  
  26. @ScriptManifest(authors = {"Icanon"}, category = "Magic",
  27.                 name = "Icanon's Wine Grabber", version = 1.0,
  28.                 description = "<html>\n"
  29.                         + "<body style='font-family: Segoe Print; color:white; padding: 0px; text-align: center; background-color: GREEN;'>"
  30.                         + "<h2>I canon's wine grabber</h2><b>"
  31.                         + "<b>by I canon</h2></b>"
  32.                         + "<br><b>If Selling, Please Sell Above MID</h2></b>"
  33.                         + "<br>Start in Zamorak Church."
  34.                         + "<br><b>THERE IS NO PAINT YET SO PLEASE DONT ASK!"
  35.                         + "<br><b>Select the type of Staff you want to use? : "
  36.                         + "<select name=\"Staff\"><option>Air<option>Water<option>None</select>"
  37.                         + "<br><b>Select Method?"
  38.                         + "<select name=\teleporting\"><option>Faldor Tele-Tab<option>Walk<option>Fallytele</select>"
  39.                         + "<br><b>FALADOR TELEPORT CURRENTLY DOES NOT WORK SO IF UR F2P SORRY WILL BE UPDATED SOON"
  40.                         + "<br><b>Select a Summoning Pet:</br>"
  41.                         + "<select name=\"summon\"><option>None</option><option>Thorny Snail</option><option>Kalphite</option><option>Terror Bird</option><option>Tortise</option><option>Yak</option></select>"
  42.                         + "<br><b>I discourage the use of familars due to the Fact that there not 100 complete good yet."
  43.                         + "<br><b>Remember I am not responsible if you die, while picking you must be over level 58.</br>"
  44.                         + "<br><b>Recommended Equipment Ring of life and Phoinex necklace."
  45.                         + "<br><b>Updates are in the future."              
  46.                         + "<br><b>Have Auto-Retaliate off when starting, Also start in the hall before entering ankous."
  47.                         + "<br>")
  48.                         public class IcanonsWineGrabber extends Script{
  49.  
  50.  
  51.         // Tiles
  52.         RSTile[] toWine = {
  53.                         new RSTile(2947, 3368), new RSTile(2953, 3378), new RSTile(2963, 3385),
  54.                         new RSTile(2965, 3396), new RSTile(2965, 3407), new RSTile(2957, 3416),
  55.                         new RSTile(2952, 3426), new RSTile(2950, 3437), new RSTile(2948, 3448),
  56.                         new RSTile(2946, 3459), new RSTile(2946, 3470), new RSTile(2946, 3481),
  57.                         new RSTile(2945, 3492), new RSTile(2941, 3503), new RSTile(2941, 3514),
  58.                         new RSTile(2933, 3516)};
  59.  
  60.         // Paths
  61.         RSTile[] toBank = reversePath(toWine);
  62.  
  63.         // Intigers
  64.         int failCount = 0;
  65.         public int startExp = 0;
  66.         public int gainedExp = 0;
  67.         public int avgPerHour = 0;
  68.         public int startLevel = 0;
  69.         public int oldExp = 0;
  70.         public long lastAvgCheck = 0;
  71.         public float secExp = 0;
  72.         public float minuteExp = 0;
  73.         public float hourExp = 0;
  74.         long startTime = 0;
  75.         long runTime = 0, seconds = 0 ,minutes = 0, hours = 0;
  76.         public int staff = 0;
  77.         public int staffOfWater;
  78.         public int staffOfAir;
  79.         public int MEDS;
  80.         int teleport;
  81.         public int tgrabID = 44;
  82.         int runes[] = {563, 556, 555 };
  83.         int zWine = 245;
  84.         int faldorTeleTab = 8009;
  85.         int grabCoordsX[] = { 707, 725 };
  86.         int grabCoordsY[] = { 269, 283 };
  87.         int fallyCoordsX[] = { 590, 602 };
  88.         int fallyCoordsY[] = { 295, 308 };
  89.         int teleGear[] = {8009, 563, 556, 555 };
  90.         int pouch;
  91.  
  92.  
  93.         // Images
  94.         BufferedImage normal = null;
  95.         BufferedImage mouse1 = null;
  96.         BufferedImage mouse2 = null;
  97.         BufferedImage mouse3 = null;
  98.         BufferedImage mouse4 = null;
  99.         BufferedImage mouse5 = null;
  100.         BufferedImage mouse6 = null;
  101.         BufferedImage mouseAll = null;
  102.  
  103.         // Longs
  104.         private long scriptStartTime = 0;
  105.  
  106.         // Strings
  107.         public String staffType;
  108.         public String actionID;
  109.         public String status;
  110.         public String uWines;
  111.         public String uTeleGrab;
  112.  
  113.         // Script Start
  114.         public boolean onStart(Map<String, String> args) {
  115.                 try {
  116.                         final URL normalURL = new URL("http://i49.tinypic.com/2n6r7l1.png");
  117.                         final URL mouse1URL = new URL("http://i46.tinypic.com/5nlkd4.png");
  118.                         final URL mouse2URL = new URL("http://i48.tinypic.com/hui0wi.png");
  119.                         final URL mouse3URL = new URL("http://i50.tinypic.com/67ulwg.png");
  120.                         final URL mouse4URL = new URL("http://i50.tinypic.com/24mhvyp.png");
  121.                         final URL mouse5URL = new URL("http://i46.tinypic.com/nz2829.png");
  122.                         final URL mouse6URL = new URL("http://i45.tinypic.com/2uttfl1.jpg");
  123.                         final URL mouseAllURL = new URL("http://i50.tinypic.com/rsd24p.png");
  124.                         normal = ImageIO.read(normalURL);
  125.                         mouse1 = ImageIO.read(mouse1URL);
  126.                         mouse2 = ImageIO.read(mouse2URL);
  127.                         mouse3 = ImageIO.read(mouse3URL);
  128.                         mouse4 = ImageIO.read(mouse4URL);
  129.                         mouse5 = ImageIO.read(mouse5URL);
  130.                         mouse6 = ImageIO.read(mouse6URL);
  131.                         mouseAll = ImageIO.read(mouseAllURL);
  132.                 }
  133.                 catch (MalformedURLException e) {
  134.                         log("Cannot Read Image URL Correctly");
  135.                 }
  136.                 catch (IOException e) {
  137.                         log("Cannot Open Cursor Image");
  138.                 }
  139.  
  140.                 if (args.get("summon").equals ("None")) {
  141.                         pouch = 0;
  142.                 }
  143.                 if (args.get("summon"). equals ("Thorny Snail")) {
  144.                         pouch = 12019;
  145.                 }
  146.                 if (args.get("summon").equals ("Kalphite")) {
  147.                         pouch = 12063;
  148.                 }
  149.                 if (args.get("summon").equals ("Terror Bird")) {
  150.                         pouch = 12007;
  151.                 }
  152.                 if (args.get("summon").equals ("Tortoise")) {
  153.                         pouch = 12031;
  154.                 }
  155.                 if (args.get("summon").equals ("Yak")) {
  156.                         pouch = 12093;
  157.                 }
  158.                 if(args.get("teleporting").equals("Faldor Tele-Tab")) {
  159.                         teleport = 8009;
  160.                 }
  161.                 if(args.get("teleporting").equals("Walk")) {
  162.                         teleport = 0;
  163.                 }
  164.                 return true;
  165.         }
  166.         public boolean useBank() {
  167.                 if(!isInventoryFull()) {
  168.                         RSObject bankBooth = getNearestObjectByID(11758);
  169.                         if(bankBooth == null);
  170.                         atObject(bankBooth, "Use-quickly");
  171.                 }
  172.                 return true;
  173.         }
  174.  
  175.         public boolean deposit() {
  176.                 return bank.depositAllExcept(teleGear);
  177.  
  178.         }
  179.  
  180.         public boolean withdraw() {
  181.                 bank.withdraw(pouch, 1);
  182.                 return bank.close();
  183.  
  184.         }
  185.  
  186.         public boolean summon() {
  187.                 atInventoryItem(pouch, "summon");
  188.                 return true;
  189.  
  190.         }
  191.  
  192.         public boolean toWine() {
  193.                 if(!isInventoryFull()) {
  194.                         walkPathMM(randomizePath(toWine,2,2));
  195.                         wait(random(1500,3000));
  196.                 }
  197.                 return isActive;
  198.  
  199.         }
  200.  
  201.         public boolean teleGrab() {
  202.                 RSTile med = getGroundItemByID(zWine);
  203.                 if (getCurrentTab() != Constants.TAB_MAGIC) {
  204.                         openTab(Constants.TAB_MAGIC);
  205.                         wait(random(200, 500));
  206.                 }
  207.                 castSpell(tgrabID);
  208.                 Point zWine = Calculations.tileToScreen(grabCoordsX.length, grabCoordsY(), 6);
  209.                 clickMouse(zWine, false);
  210.                 wait(random(500, 900));
  211.                 atMenu("Cast");
  212.                 MEDS++;
  213.                 return true;
  214.         }
  215.  
  216.         private int grabCoordsY() {
  217.                 // TODO Auto-generated method stub
  218.                 return 0;
  219.         }
  220.         public boolean storeFamiliar() {
  221.                 if(!isInventoryFull()) {
  222.                         RSNPC scary = getNearestFreeNPCByName("Thorny snail, Kalphite, Terrorbird, tortiose, Yak");
  223.                         if (scary !=null);
  224.                         atNPC(scary, "Store");
  225.                         atInventoryItem(zWine, "Store");
  226.  
  227.                 }
  228.                 return true;
  229.         }
  230.  
  231.         public boolean teleGrabSome() {
  232.                 RSTile med = getGroundItemByID(zWine);
  233.                 if (getCurrentTab() != Constants.TAB_MAGIC) {
  234.                         openTab(Constants.TAB_MAGIC);
  235.                         wait(random(200, 500));
  236.                 }
  237.                 castSpell(tgrabID);
  238.                 Point zWine = Calculations.tileToScreen(grabCoordsX.length, grabCoordsY.length, 6);
  239.                 clickMouse(zWine, false);
  240.                 wait(random(500, 900));
  241.                 atMenu("Cast");
  242.                 MEDS++;
  243.                 return true;
  244.         }
  245.         public boolean leave() {
  246.                 if(!isInventoryFull()) {
  247.                         atInventoryItem(teleport, "break");
  248.                 }else{
  249.                         walkPathMM(randomizePath(toBank,2,2));
  250.                 }
  251.                 return true;
  252.         }
  253.         public int loop() {
  254.                 setRun(true);
  255.                 setCameraAltitude(true);
  256.                 if(isInventoryFull())
  257.                         if(useBank()) {
  258.                                 if(deposit()) {
  259.                                         if(withdraw()) {
  260.                                                 if(summon())
  261.                                                         return random(500,800);
  262.  
  263.                                         }
  264.                                 }else
  265.                                         if(!isInventoryFull()) {
  266.                                                 if(summon()) {
  267.                                                         if(toWine()) {
  268.                                                                 if(teleGrab()) {
  269.                                                                         if(!isInventoryFull()) {
  270.                                                                                 if(storeFamiliar()) {
  271.                                                                                         if(teleGrabSome())
  272.                                                                                                 if(leave())
  273.  
  274.                                                                                                         return random(300,700);
  275.                                                                                 }
  276.                                                                         }
  277.                                                                 }
  278.                                                         }
  279.                                                 }
  280.                                         }
  281.                         }
  282.                 return random (1000,2000);
  283.         }
  284. }