Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Defmenow made the flax picker.
- I edited alot to get it to an tinderbox buyer.
- */
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.util.Map;
- import org.rsbot.bot.Bot;
- 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.RSCharacter;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSInterface;
- @ScriptManifest(authors = { "Defmenow, Ikin (AJAX)" }, category = "Money", name = "Da Pyro Buyer", version = 2.0, description = "<html><center><body>Da Pyro Box Buyer<br><Start in Seers bank with about 300k [Minimum 90k] coins <br>Made By: <strong>Defmenow</strong> <br>Edit To other script by:<strong> Ikin</strong></body></html\n")
- public class DaPyroBuyer extends Script implements PaintListener, ServerMessageListener {
- public boolean startScript = false;
- public long startTime = System.currentTimeMillis();
- int tinderboxbougth;
- final static int NOOBID = 4946;
- public int bankboothid = 25808;
- private int RunningEnergy = random(15, 80);
- final static int coin = 995;
- RSTile[] Walk2Bank = { new RSTile(2720, 3430), new RSTile(2730, 3435), new RSTile(2733, 3443), new RSTile(2729, 3453), new RSTile(2727, 3463), new RSTile(2728, 3474), new RSTile(2725, 3485), new RSTile(2723, 3484), new RSTile(2726, 3491) };
- private RSTile[] Walk2Box = reversePath(Walk2Bank);
- protected int getMouseSpeed() {
- return 6;
- }
- @SuppressWarnings("deprecation")
- public boolean onStart(final Map<String, String> args) {
- startTime = System.currentTimeMillis();
- Bot.getEventManager().addListener(PaintListener.class, this);
- return true;
- }
- public boolean needToBank() {
- return isInventoryFull();
- }
- public boolean atBank() {
- RSObject bank = getNearestObjectByID(bankboothid);
- if(bank == null) return false;
- return tileOnScreen(bank.getLocation());
- }
- public boolean atShop() {
- final RSNPC vulcan = getNearestNPCByID(NOOBID);
- if(vulcan == null) return false;
- return tileOnScreen(vulcan.getLocation());
- }
- public boolean handleBank() {
- RSObject bankbooth = getNearestObjectByID(bankboothid);
- if(bank == null)
- return false;
- if(bank.isOpen()){
- bank.depositAllExcept(coin);
- }else{
- atObject(bankbooth, "uickly");
- }
- return true;
- }
- public boolean buybox(){
- final RSNPC vulcan = getNearestNPCByID(NOOBID);
- final RSInterface select = RSInterface.getInterface(620);
- if (tileOnScreen(vulcan.getLocation())) {
- if (!select.isValid() && !isInventoryFull()) {
- atNPC(vulcan, "Trade");
- waitForIface(select, 3000);
- }
- }
- if (!isInventoryFull()) {
- if (select.isValid()) {
- clickMouse(52, 69, false);
- wait(random(100, 350));
- atMenu("Buy 500");
- wait(random(800, 1000));
- clickMouse(487, 18, true);
- }
- }
- return true;
- }
- public boolean walkToShop(){
- if (getEnergy() >= RunningEnergy && !isRunning()) {
- setRun(true);
- RunningEnergy = random(15, 30);
- wait(random(400, 500));
- }
- if(!getMyPlayer().isMoving() || distanceTo(getDestination()) <= random(6, 8))
- {
- walkPathMM(randomizePath(Walk2Box, 1, 1), 16);
- return false;
- }
- return true;
- }
- public boolean walkToBank(){
- if (getEnergy() >= RunningEnergy && !isRunning()) {
- setRun(true);
- RunningEnergy = random(15, 30);
- wait(random(400, 500));
- }
- if(!getMyPlayer().isMoving() || distanceTo(getDestination()) <= random(6, 8))
- {
- walkPathMM(randomizePath(Walk2Bank, 2, 2), 16);
- return false;
- }
- return true;
- }
- public boolean flag(int dist){
- if(getMyPlayer().getAnimation() != -1) return false;
- if(distanceTo(getDestination()) <= dist) return true;
- return false;
- }
- public int loop() {
- setCameraAltitude(true);
- if(needToBank()) {
- if(atBank()) {
- if(handleBank())
- return random(800, 1000);
- }else{
- if(flag(random(4, 7))){
- if(walkToBank())
- return random(800, 1000);
- }else{
- return random(800, 1000);
- }
- }
- }else{
- if(atShop()){
- buybox();
- return random(800, 1000);
- }else{
- if(flag(random(4, 7))){
- if(walkToShop())
- return random(800, 1000);
- }else{
- return random(800, 1000);
- }
- }
- }
- return random(200, 400);
- }
- public void onFinish() {
- Bot.getEventManager().removeListener(PaintListener.class, this);
- }
- public void serverMessageRecieved(final ServerMessageEvent m) {
- final String message = m.getMessage();
- if (message.contains("enough inventory")) {
- tinderboxbougth ++;
- }
- }
- private final Color background = new Color(0,0,0,200),
- blue = new Color(51, 204, 255, 200),
- black = new Color(0, 0, 0, 200),
- white = new Color(255,255,255,200),
- green = new Color(30,255,30,200),
- red = new Color(235,18,29,200);
- public void onRepaint(final Graphics g) {
- if (isLoggedIn()) {
- long millis = System.currentTimeMillis() - startTime;
- long profit = tinderboxbougth * 27;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- int y = 31;
- g.setColor(background);
- g.fillRoundRect(350,8,140,65,5,5);
- g.setColor(white);
- g.setFont(new Font("sans serif", Font.PLAIN, 16));
- g.drawString("Da Pyro Box Buyer", 353, 26);
- g.fillRect(350,28,140,1);
- g.setFont(new Font("sans serif", Font.PLAIN, 12));
- g.setColor(blue);
- g.drawString("Time Running: " + hours + ":" + minutes + ":"
- + seconds + "" , 355, y += 14);
- g.drawString("Boxes Bougth: "+ profit , 355, y += 14);
- }
- }
- }
Add Comment
Please, Sign In to add comment