Tw3nty Posted April 25, 2015 Share Posted April 25, 2015 (edited) 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 May 5, 2015 by Tw3nty Quote Link to comment Share on other sites More sharing options...
TheRealSwaps Posted April 25, 2015 Share Posted April 25, 2015 Nice release bud. Quote Link to comment Share on other sites More sharing options...
Fade Posted April 25, 2015 Share Posted April 25, 2015 Looks good Quote Link to comment Share on other sites More sharing options...
OS Jay Posted April 25, 2015 Share Posted April 25, 2015 how do i use this? Quote Link to comment Share on other sites More sharing options...
Tw3nty Posted April 25, 2015 Author Share Posted April 25, 2015 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. Quote Link to comment Share on other sites More sharing options...
OS Jay Posted April 25, 2015 Share Posted April 25, 2015 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 Quote Link to comment Share on other sites More sharing options...
Spaisins Posted April 25, 2015 Share Posted April 25, 2015 Running smoothly One thing that you could add is when the supplies runs out, the bot logs out instead of clicking the bank deposit button. Quote Link to comment Share on other sites More sharing options...
Tw3nty Posted April 25, 2015 Author Share Posted April 25, 2015 Running smoothly 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 Quote Link to comment Share on other sites More sharing options...
Muffins Posted April 25, 2015 Share Posted April 25, 2015 nice release Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted April 26, 2015 Share Posted April 26, 2015 (edited) Looks like you'll have some friendly competition. I plan on releasing mine in the near future. Nice release though! Edited April 26, 2015 by ProjectPact Quote Link to comment Share on other sites More sharing options...
Augury13 Posted April 26, 2015 Share Posted April 26, 2015 Sick release and thanks for the source It helps. Quote Link to comment Share on other sites More sharing options...
dazi Posted May 3, 2015 Share Posted May 3, 2015 (edited) Is 0.1 the lastest version? Otherwise, please update the link! Nice script mate Proggies: Edited May 3, 2015 by dazi Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted May 4, 2015 Share Posted May 4, 2015 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. Quote Link to comment Share on other sites More sharing options...
Tw3nty Posted May 5, 2015 Author Share Posted May 5, 2015 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. 1 Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted May 5, 2015 Share Posted May 5, 2015 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. Quote Link to comment Share on other sites More sharing options...