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

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 8.64 KB  |  hits: 12  |  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. //imports//
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.event.KeyEvent;
  5. import java.util.Map;
  6.  
  7. import org.rsbot.script.wrappers.RSNPC;
  8. import org.rsbot.event.events.ServerMessageEvent;
  9. import org.rsbot.event.listeners.PaintListener;
  10. import org.rsbot.event.listeners.ServerMessageListener;
  11. import org.rsbot.script.Script;
  12. import org.rsbot.script.ScriptManifest;
  13. import org.rsbot.script.wrappers.GEItemInfo;
  14. import org.rsbot.script.wrappers.RSGroundItem;
  15. import org.rsbot.script.wrappers.RSItem;
  16. import org.rsbot.script.wrappers.RSObject;
  17. import org.rsbot.script.wrappers.RSTile;
  18.  
  19.  
  20.  
  21. //Manifest//
  22. @ScriptManifest(authors = { "Sponsor" }, name = "Swamp Toad Raper", category = "Other", version = 1.0, description = "<html>\n"
  23.                 + "<body style='font-family: Calibri; background-color: black; color:yellow; padding: 0px; text-align: center;'>"
  24.                 + "<h2>"
  25.                 + "Swamp Toad Picker 1.0"
  26.                 + "</h2>\n"
  27.                 + "<b>Made by Sponsor</b>\n"
  28.                 + "<br><br>\n"
  29.                 + "Start in the Swampy Toad field."
  30.                 + "<br><br>\n"
  31.                 + "How many do you want to get?"
  32.                 + "<br><br>\n"
  33.                 + "<input name='amount' type='text' size='10' maxlength='10' value='20000' /><br /><br />"
  34.                 )
  35.                
  36.                
  37. public class SwampToad extends Script implements PaintListener,
  38.                 ServerMessageListener {
  39.         //variables//
  40.        
  41.         public long startTime;
  42.         public int toadprice;
  43.     public int amountCurrent;
  44.         public int amount;
  45.         public int gnomedoor = 1968;
  46.         public int swamptoadID = 2150;
  47.         public int ladder = 1747;
  48.         public int downladder = 1748;
  49.         public int bboothID = 2213;
  50.        
  51.         RSTile bankpath = new RSTile (2449,3482);
  52.         RSTile bank2ladder = new RSTile (2463,3495);
  53.        
  54.         RSTile[] frombank1={new RSTile(2466,3491), new RSTile(2445,3502), new RSTile(2421,3507)};
  55.         RSTile[] tobank1={new RSTile(2445,3502), new RSTile(2466,3491)};
  56.         RSTile stuckhere = new RSTile(2466,3491);
  57.         RSTile activatepath = new RSTile (2457,3494);
  58.        
  59.    
  60.        
  61. //onstarts//
  62.         @Override
  63.         public boolean onStart(Map<String, String> args) {
  64.                 final GEItemInfo stringGE = grandExchange.loadItemInfo(swamptoadID);
  65.                 amount = Integer.parseInt(args.get("amount"));
  66.                 startTime=System.currentTimeMillis();
  67.                 toadprice = stringGE.getMarketPrice();
  68.  
  69.                 return true;
  70.         }
  71.  
  72.         //no server messages with snape//
  73.         @Override
  74.         public void serverMessageRecieved(ServerMessageEvent e) {
  75.        
  76.         }
  77.        
  78.                
  79.        
  80.        
  81.  
  82.         @Override
  83.         //paint//
  84.         public void onRepaint(Graphics render) {
  85.                 render.setColor(new Color(255, 0, 0,255));
  86.                 render.drawRect(8, 8, 145, 165);
  87.                 render.drawRect(9, 9, 145, 165);
  88.                 render.drawRect(10, 10, 145, 165);
  89.                 render.drawRect(11, 11, 145, 165);
  90.                 render.setColor(new Color(55, 200, 0,125));
  91.                  render.fillRect(12, 12, 140, 160);
  92.                  render.setColor(new Color(0, 0, 0, 255));
  93.                  render.drawString("Profit Banked: "+amountCurrent*toadprice,12,140);
  94.                  
  95.                  long curTime=System.currentTimeMillis();
  96.         long elapsedTime=curTime-startTime;
  97.         long elapsedSec=elapsedTime/1000;
  98.         long realMin=elapsedSec/60;
  99.         long realSec=elapsedSec-(realMin*60);
  100.         long realHour=realMin/60;
  101.         realMin=realMin-(realHour*60);
  102.        
  103.         String realStHour=""+realHour;
  104.         String realStMin=""+realMin;
  105.         String realStSec=""+realSec;
  106.         if (realStHour.length()==1) { realStHour="0"+realStHour; }
  107.        
  108.         if (realStMin.length()==1) { realStMin="0"+realStMin; }
  109.         if (realStSec.length()==1) { realStSec="0"+realStSec; }
  110.         render.drawString("Elapsed time "+realStHour+":"+realStMin+":"+realStSec,12,50);
  111.        
  112.         render.drawString("Swamp Toad Raper 1.0",12,80);
  113.        
  114.         render.drawString("Created by Sponsor",12,110);
  115.        
  116.         render.setColor(new Color(255, 0, 0, 255));
  117.         double profitbankedPerHour=Math.round(((double)amountCurrent*toadprice/(double)elapsedSec)*(double)(60*60));
  118.         render.drawString("Profit Banked/hour: "+profitbankedPerHour,12,130);
  119.         }      
  120.        
  121.  
  122.        
  123.         @Override
  124.         //loop//
  125.         public int loop() {
  126.                 //stuffs//
  127.              RSGroundItem SwampToad = groundItems.getNearest(swamptoadID);
  128.              RSObject Gdoor = objects.getNearest(gnomedoor);
  129.              RSObject climbladder = objects.getNearest(ladder);
  130.              RSObject Bankbooth = objects.getNearest(bboothID);
  131.              RSObject downladdergo = objects.getNearest(downladder);
  132.              
  133.              
  134.         if (walking.getEnergy()>=100 && !walking.isRunEnabled()) {
  135.                   walking.setRun(true);
  136.                }
  137.                
  138.         if (amountCurrent>=amount) {
  139.                   stopScript();
  140.                }
  141.                
  142.         if (!getMyPlayer().isMoving() || (getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination())<3)) {
  143.                  
  144.                  
  145.                 if (SwampToad!=null && !inventory.isFull()&&!SwampToad.isOnScreen()&& calc.distanceTo(SwampToad.getLocation())<25) {
  146.                              walking.walkTileMM(walking.getClosestTileOnMap(SwampToad.getLocation()));
  147.                          log("1");           
  148.                 }
  149.                              
  150.                
  151.         if (SwampToad!=null && !inventory.isFull()&SwampToad.isOnScreen()&& calc.distanceTo(SwampToad.getLocation())<12) {           
  152.                      SwampToad.doAction("Take Swamp toad");
  153.                      log("2");
  154.              
  155.         } if (inventory.isFull()&&getMyPlayer().getLocation().getX()<2463&&game.getPlane()==0){
  156.                      walkPath1(tobank1);
  157.                      log("3");
  158.         }
  159.        
  160.        
  161.         if (inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getY()<3497&&getMyPlayer().getLocation().getY()>3489&&getMyPlayer().getLocation().getX()>2452&&getMyPlayer().getLocation().getX()<2462){
  162.                 walking.walkTileMM(walking.getClosestTileOnMap(stuckhere));
  163.                 log("stuckhere");
  164.        
  165.         }
  166.        
  167.        
  168.         if (inventory.isFull()&&getMyPlayer().getLocation().getY()<3492&&getMyPlayer().getLocation().getX()>2464) {
  169.              if (Gdoor!=null) {    
  170.                     Gdoor.doAction("Open");
  171.                 sleep(random(3000,3200));
  172.                 log("4");
  173.             }}
  174.                
  175.         if (inventory.isFull() &&game.getPlane()==0&&getMyPlayer().getLocation().getY()>3492&&getMyPlayer().getLocation().getX()>2464) {        
  176.                 if (climbladder!=null) {
  177.                     climbladder.doAction("Climb-up");
  178.                     sleep(random(2500,3000));
  179.                     log("5");
  180.         }
  181.         }
  182.        
  183.         if (inventory.isFull() &&game.getPlane()==1&&getMyPlayer().getLocation().getY()>3485){
  184.                      log("why wont you fucking walk");
  185.                      walking.walkTileMM(walking.getClosestTileOnMap(bankpath));
  186.                      log("6");
  187.         }
  188.        
  189.         if (inventory.isFull()&&Bankbooth!=null &&game.getPlane()==1&&getMyPlayer().getLocation().getY()<3485){
  190.                      Bankbooth.doAction("Use-quickly");
  191.                      sleep(random(2000,2200));
  192.                      log("7");
  193.         }            
  194.                
  195.         if (bank.isOpen() && inventory.isFull()) {
  196.                       bank.depositAll();
  197.                       sleep(random(3000,3500));
  198.                       amountCurrent+=27;
  199.                       log("8");
  200.         }
  201.        
  202.         if (!inventory.isFull()&&game.getPlane()==1&&getMyPlayer().getLocation().getX()<2461){
  203.                        walking.walkTileMM(walking.getClosestTileOnMap(bank2ladder));
  204.                        log("9");
  205.         }
  206.        
  207.        
  208.         if (!inventory.isFull()&&game.getPlane()==1&&getMyPlayer().getLocation().getX()<2466) {
  209.                      if(downladdergo!=null){  
  210.                      downladdergo.doAction("Climb-down");
  211.                      log("10");
  212.                     }                          
  213.         }
  214.        
  215.         if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getX()>2464&&getMyPlayer().getLocation().getY()>3492) {
  216.                     if (Gdoor!=null) {      
  217.                     Gdoor.doAction("Open");
  218.                     sleep(random(2500,3000));
  219.                     log("11");
  220.         }}
  221.        
  222.         if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getY()<3492){
  223.                    walking.walkTileMM(walking.getClosestTileOnMap(activatepath));
  224.                    log("newadd");
  225.         }
  226.                
  227.        
  228.         if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getX()<2460&&getMyPlayer().getLocation().getX()>2429){
  229.                     walkPath1(frombank1);
  230.                     log("12");
  231.         }
  232.        
  233.        
  234.        
  235.        
  236.         }
  237.                 return random (200,400);}
  238.              
  239.                
  240.  
  241.  
  242.             public boolean walkPath1(RSTile[] tobank1) {
  243.                   try {
  244.                         return walking.walkTileMM(walking.getClosestTileOnMap(walking.nextTile(tobank1)));
  245.              } catch (Exception ignore) { return false; }}
  246.  
  247.  
  248.  
  249.  
  250.                    public boolean walkPath(RSTile[] frombank1) {
  251.                        try {
  252.                    return walking.walkTileMM(walking.getClosestTileOnMap(walking.nextTile(frombank1)));
  253.                    } catch (Exception ignore) { return false; }}}