- //imports//
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.event.KeyEvent;
- import java.util.Map;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.GEItemInfo;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- //Manifest//
- @ScriptManifest(authors = { "Sponsor" }, name = "Swamp Toad Raper", category = "Other", version = 1.0, description = "<html>\n"
- + "<body style='font-family: Calibri; background-color: black; color:yellow; padding: 0px; text-align: center;'>"
- + "<h2>"
- + "Swamp Toad Picker 1.0"
- + "</h2>\n"
- + "<b>Made by Sponsor</b>\n"
- + "<br><br>\n"
- + "Start in the Swampy Toad field."
- + "<br><br>\n"
- + "How many do you want to get?"
- + "<br><br>\n"
- + "<input name='amount' type='text' size='10' maxlength='10' value='20000' /><br /><br />"
- )
- public class SwampToad extends Script implements PaintListener,
- ServerMessageListener {
- //variables//
- public long startTime;
- public int toadprice;
- public int amountCurrent;
- public int amount;
- public int gnomedoor = 1968;
- public int swamptoadID = 2150;
- public int ladder = 1747;
- public int downladder = 1748;
- public int bboothID = 2213;
- RSTile bankpath = new RSTile (2449,3482);
- RSTile bank2ladder = new RSTile (2463,3495);
- RSTile[] frombank1={new RSTile(2466,3491), new RSTile(2445,3502), new RSTile(2421,3507)};
- RSTile[] tobank1={new RSTile(2445,3502), new RSTile(2466,3491)};
- RSTile stuckhere = new RSTile(2466,3491);
- RSTile activatepath = new RSTile (2457,3494);
- //onstarts//
- @Override
- public boolean onStart(Map<String, String> args) {
- final GEItemInfo stringGE = grandExchange.loadItemInfo(swamptoadID);
- amount = Integer.parseInt(args.get("amount"));
- startTime=System.currentTimeMillis();
- toadprice = stringGE.getMarketPrice();
- return true;
- }
- //no server messages with snape//
- @Override
- public void serverMessageRecieved(ServerMessageEvent e) {
- }
- @Override
- //paint//
- public void onRepaint(Graphics render) {
- render.setColor(new Color(255, 0, 0,255));
- render.drawRect(8, 8, 145, 165);
- render.drawRect(9, 9, 145, 165);
- render.drawRect(10, 10, 145, 165);
- render.drawRect(11, 11, 145, 165);
- render.setColor(new Color(55, 200, 0,125));
- render.fillRect(12, 12, 140, 160);
- render.setColor(new Color(0, 0, 0, 255));
- render.drawString("Profit Banked: "+amountCurrent*toadprice,12,140);
- long curTime=System.currentTimeMillis();
- long elapsedTime=curTime-startTime;
- long elapsedSec=elapsedTime/1000;
- long realMin=elapsedSec/60;
- long realSec=elapsedSec-(realMin*60);
- long realHour=realMin/60;
- realMin=realMin-(realHour*60);
- String realStHour=""+realHour;
- String realStMin=""+realMin;
- String realStSec=""+realSec;
- if (realStHour.length()==1) { realStHour="0"+realStHour; }
- if (realStMin.length()==1) { realStMin="0"+realStMin; }
- if (realStSec.length()==1) { realStSec="0"+realStSec; }
- render.drawString("Elapsed time "+realStHour+":"+realStMin+":"+realStSec,12,50);
- render.drawString("Swamp Toad Raper 1.0",12,80);
- render.drawString("Created by Sponsor",12,110);
- render.setColor(new Color(255, 0, 0, 255));
- double profitbankedPerHour=Math.round(((double)amountCurrent*toadprice/(double)elapsedSec)*(double)(60*60));
- render.drawString("Profit Banked/hour: "+profitbankedPerHour,12,130);
- }
- @Override
- //loop//
- public int loop() {
- //stuffs//
- RSGroundItem SwampToad = groundItems.getNearest(swamptoadID);
- RSObject Gdoor = objects.getNearest(gnomedoor);
- RSObject climbladder = objects.getNearest(ladder);
- RSObject Bankbooth = objects.getNearest(bboothID);
- RSObject downladdergo = objects.getNearest(downladder);
- if (walking.getEnergy()>=100 && !walking.isRunEnabled()) {
- walking.setRun(true);
- }
- if (amountCurrent>=amount) {
- stopScript();
- }
- if (!getMyPlayer().isMoving() || (getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination())<3)) {
- if (SwampToad!=null && !inventory.isFull()&&!SwampToad.isOnScreen()&& calc.distanceTo(SwampToad.getLocation())<25) {
- walking.walkTileMM(walking.getClosestTileOnMap(SwampToad.getLocation()));
- log("1");
- }
- if (SwampToad!=null && !inventory.isFull()&SwampToad.isOnScreen()&& calc.distanceTo(SwampToad.getLocation())<12) {
- SwampToad.doAction("Take Swamp toad");
- log("2");
- } if (inventory.isFull()&&getMyPlayer().getLocation().getX()<2463&&game.getPlane()==0){
- walkPath1(tobank1);
- log("3");
- }
- if (inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getY()<3497&&getMyPlayer().getLocation().getY()>3489&&getMyPlayer().getLocation().getX()>2452&&getMyPlayer().getLocation().getX()<2462){
- walking.walkTileMM(walking.getClosestTileOnMap(stuckhere));
- log("stuckhere");
- }
- if (inventory.isFull()&&getMyPlayer().getLocation().getY()<3492&&getMyPlayer().getLocation().getX()>2464) {
- if (Gdoor!=null) {
- Gdoor.doAction("Open");
- sleep(random(3000,3200));
- log("4");
- }}
- if (inventory.isFull() &&game.getPlane()==0&&getMyPlayer().getLocation().getY()>3492&&getMyPlayer().getLocation().getX()>2464) {
- if (climbladder!=null) {
- climbladder.doAction("Climb-up");
- sleep(random(2500,3000));
- log("5");
- }
- }
- if (inventory.isFull() &&game.getPlane()==1&&getMyPlayer().getLocation().getY()>3485){
- log("why wont you fucking walk");
- walking.walkTileMM(walking.getClosestTileOnMap(bankpath));
- log("6");
- }
- if (inventory.isFull()&&Bankbooth!=null &&game.getPlane()==1&&getMyPlayer().getLocation().getY()<3485){
- Bankbooth.doAction("Use-quickly");
- sleep(random(2000,2200));
- log("7");
- }
- if (bank.isOpen() && inventory.isFull()) {
- bank.depositAll();
- sleep(random(3000,3500));
- amountCurrent+=27;
- log("8");
- }
- if (!inventory.isFull()&&game.getPlane()==1&&getMyPlayer().getLocation().getX()<2461){
- walking.walkTileMM(walking.getClosestTileOnMap(bank2ladder));
- log("9");
- }
- if (!inventory.isFull()&&game.getPlane()==1&&getMyPlayer().getLocation().getX()<2466) {
- if(downladdergo!=null){
- downladdergo.doAction("Climb-down");
- log("10");
- }
- }
- if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getX()>2464&&getMyPlayer().getLocation().getY()>3492) {
- if (Gdoor!=null) {
- Gdoor.doAction("Open");
- sleep(random(2500,3000));
- log("11");
- }}
- if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getY()<3492){
- walking.walkTileMM(walking.getClosestTileOnMap(activatepath));
- log("newadd");
- }
- if (!inventory.isFull()&&game.getPlane()==0&&getMyPlayer().getLocation().getX()<2460&&getMyPlayer().getLocation().getX()>2429){
- walkPath1(frombank1);
- log("12");
- }
- }
- return random (200,400);}
- public boolean walkPath1(RSTile[] tobank1) {
- try {
- return walking.walkTileMM(walking.getClosestTileOnMap(walking.nextTile(tobank1)));
- } catch (Exception ignore) { return false; }}
- public boolean walkPath(RSTile[] frombank1) {
- try {
- return walking.walkTileMM(walking.getClosestTileOnMap(walking.nextTile(frombank1)));
- } catch (Exception ignore) { return false; }}}