Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

T3 Pizza-baser

Featured Replies

Start with buckets of water and pots of flour in either your bank/inventory.

 

No idea on GP/hour. Bases currently sell for much higher than market price but flour buys for much higher as well.

 

Made as a request and so I could learn OSBot API and re-familiarize myself with Java. May add shit later.

 

Download link: http://upx.nz/9fXovk

 

Download the .ZIP, extract it to your scripts folder. User -> [Your PC Name] -> OSBot -> Scripts.

 

Source code:

 

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.text.DecimalFormat;
import org.osbot.rs07.api.ui.RS2Widget;

import java.awt.*;
import java.util.concurrent.TimeUnit;

@ScriptManifest(author = "Tw3nty", info = "Makes pizza bases.", name = "T3 Pizza-baser", version = 0.2, logo = "")
public class T3Pizzabaser extends Script {

    private long timeBegan;
    private long timeRan;
    private int itemsMade;
    private int itemsMadehr;

    @Override
    public void onStart() {
        log("Let's make some motherfucking pizzas!");
        timeBegan = System.currentTimeMillis();
        itemsMade = 0;
    }

    private enum State {
        MAKE, BANK, IDLE, STOP;
    }

    private State getState() throws InterruptedException {
        if (inventory.contains("Bucket of water") && inventory.contains("Pot of flour")) {
            return State.MAKE;
        }
        else if (bank.open()) {
            if (bank.contains("Bucket of water") && bank.contains("Pot of flour")) {
                return State.BANK;
            }
            else {
                return State.STOP;
            }
        }
        else {
            return State.IDLE;
        }
    }

    @Override
    public int onLoop() throws InterruptedException {
        switch (getState()) {
            case MAKE:
                if (bank.isOpen()) {
                    bank.close();
                    sleep(random(110, 320));
                }
                log("Case == MAKE");
                inventory.interact("Use", "Bucket of water");
                log("Interacting BoW...");
                sleep(random(110, 320));
                if (inventory.isItemSelected()) {
                    inventory.interact("Use", "Pot of flour");
                    log("Interacting PoF...");
                    sleep(random(970, 1975));
                }
                if (getDialogues().isPendingOption()) {
                    getDialogues().selectOption("Pizza dough");
                    log("Interacting Pizza dough...");
                    sleep(random(1020, 2050));
                    RS2Widget pizzaBase = widgets.get(309,2);
                    if (pizzaBase != null) {
                        pizzaBase.interact("Make All");
                        log("Interacting widget...");
                        sleep(random(10600, 12320));
                        itemsMade += 9;
                    }
                }
                break;
            case BANK:
                log("Case == BANK");
                if (inventory.contains("Bucket of water", "Pot of flour")) {
                    bank.depositAllExcept("Bucket of water","Pot of flour");
                    sleep(random(110, 320));
                }
                else if (!inventory.isEmpty()) {
                    bank.depositAll();
                    sleep(random(110, 320));
                }
                if (!inventory.contains("Bucket of water")) {
                    bank.withdraw("Bucket of water", 9);
                    sleep(random(110, 320));
                }
                if (!inventory.contains("Pot of flour")) {
                    bank.withdraw("Pot of flour", 9);
                    sleep(random(110, 320));
                }
                break;
            case IDLE:
                sleep (random(9100,11320));
                break;
            case STOP:
                stop();
                break;
        }
        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("ENJOY YOUR PIZZAS!");
    }

    @Override
    public void onPaint(Graphics2D g) {
        timeRan = System.currentTimeMillis() - this.timeBegan;
        itemsMadehr = (int)(itemsMade / ((System.currentTimeMillis() - timeBegan) / 3600000.0D));
        g.drawString("Time ran: " + ft(timeRan), 10, 35);
        DecimalFormat df = new DecimalFormat("#");
        g.drawString("Pizza bases made: " + df.format(itemsMade), 10,50);
        g.drawString("Pizza bases per hour: " + df.format(itemsMadehr), 10,65);
    }

    private String ft(long duration)
    {
        String res = "";
        long days = TimeUnit.MILLISECONDS.toDays(duration);
        long hours = TimeUnit.MILLISECONDS.toHours(duration)
                - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
        long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
                - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
                .toHours(duration));
        long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
                - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
                .toMinutes(duration));
        if (days == 0) {
            res = (hours + ":" + minutes + ":" + seconds);
        } else {
            res = (days + ":" + hours + ":" + minutes + ":" + seconds);
        }
        return res;
    }
} 

Edited by Tw3nty

  • Author

Added basic paint and squished a small bug or two.

 

 

how do i use this?

 

Download the .ZIP, extract it to your scripts folder. User -> [Your PC Name] -> OSBot -> Scripts.

Added basic paint and squished a small bug or two.

 

 

 

Download the .ZIP, extract it to your scripts folder. User -> [Your PC Name] -> OSBot -> Scripts.

thanks it worked

Running smoothly

 DZk9GZi.png

 

One thing that you could add is when the supplies runs out, the bot logs out instead of clicking the bank deposit button.

  • Author

Running smoothly

 DZk9GZi.png

 

One thing that you could add is when the supplies runs out, the bot logs out instead of clicking the bank deposit button.

 

I actually added that in the fix last night, you probably haven't got the newest version :P

Looks like you'll have some friendly competition. I plan on releasing mine in the near future. wink.png

 

Nice release though!

Edited by ProjectPact

Is 0.1 the lastest version? Otherwise, please update the link!

 

Nice script mate smile.png

 

Proggies:

8c49784f6e304d28e2168461b9dfef6c.png

 

c3a61d3be7ab2d47a5924af350300048.png

Edited by dazi

You should do a conditional sleep method instead of a static reference of such high random numbers. Just think if you only have 7 pizzas left to make, you're going to be sleeping that entire time still.  


You should do a conditional sleep method instead of a static reference of such high random numbers. Just think if you only have 7 pizzas left to make, you're going to be sleeping that entire time still.  

  • Author

You should do a conditional sleep method instead of a static reference of such high random numbers. Just think if you only have 7 pizzas left to make, you're going to be sleeping that entire time still.  

You should do a conditional sleep method instead of a static reference of such high random numbers. Just think if you only have 7 pizzas left to make, you're going to be sleeping that entire time still.  

 

Normally I would do this but since there's no animation involved with making pizzas I didn't really put much effort into thinking about it :3  

 

A simple "while inventory still contains flour/water" is open to bugs if the player somehow gets interrupted mid pizza making, no? A static "oversleep" only happens at most once per script. If I ever feel like making this properly I'll probably look over it but this was just made to familiarize myself with Java and the API.

Normally I would do this but since there's no animation involved with making pizzas I didn't really put much effort into thinking about it :3  

 

A simple "while inventory still contains flour/water" is open to bugs if the player somehow gets interrupted mid pizza making, no? A static "oversleep" only happens at most once per script. If I ever feel like making this properly I'll probably look over it but this was just made to familiarize myself with Java and the API.

 

 

I created a custom method which involved inventory changes. Maybe that's enough of a hint for you to write something similar. :)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.