Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • (OPEN SOURCE) Red Dye Maker [80 - 200K PER HOUR] (First Script) F2P


    zetrux

    Recommended Posts

    Posted

    After being frustrated and banned on an account on another bot client that I wont name, I decided to migrate to Dream bot. I learned the Dream bot API 6 hours ago and this is the product I created. Simplistic and a one sided script but I hope you guys like it as my first script release.

    Roughly 276 Red Dyes made per hour, Either 82k - 192k depending on how much you sell them for. I've sold plenty at 700 each and lowest 300 each on a bad day. Try leaving it in the grand exchange over night at a higher price. I made roughly 5000 dyes without getting banned with a few breaks in between on 4 accounts. Use at your own risk though

    Start the bot anywhere with Redberries and enough coins in your bank.

    Code:
     

    package dev.zedomega.dyemaker;
    
    import java.awt.Graphics;
    import java.util.concurrent.ThreadLocalRandom;
    
    import org.dreambot.api.methods.container.impl.Inventory;
    import org.dreambot.api.methods.container.impl.bank.Bank;
    import org.dreambot.api.methods.dialogues.Dialogues;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.script.listener.PaintListener;
    import org.dreambot.api.wrappers.interactive.Player;
    
    
    @ScriptManifest(author = "Zedomega", category = Category.MONEYMAKING, name = "Dye Maker", version = 0.5)
    public class Main extends AbstractScript implements PaintListener {
    	
    	private String script = "[Dye Maker]:";
    	
    	private final Area draynorVillage = new Area(3108, 3227, 3081, 3271);
    	private final Area aggiesRoom = new Area(3083, 3256, 3088, 3261);
    	private final Area outsideAggiesRoom = new Area(3094, 3262, 3089, 3257);
    	private final Area draynorBank = new Area(3094, 3242, 3092, 3245);
    	
    	private State state = State.WALKING_TO_DRAYNOR;
    	
    	private int dyes = 0;
    	
    	private int randomNumber(int min, int max) {
    		return min + ThreadLocalRandom.current().nextInt(max - min);
    	}
    	
    	private void withdrawSupplies(Bank bank, Inventory inventory) {
    		bank.depositAllExcept(995);
    		if (inventory.count(995) >= 50) {
    		//	log(script + " Withdrew supplies from bank.");
    			bank.withdrawAll(1951);
    			bank.close();
    		} else {
    			if (bank.count("Coins") > 0 && bank.count("Redberries") > 0) {
    			//	log(script + " Withdrew supplies from bank.");
    				bank.withdraw(995, 1000);
    				bank.withdrawAll(1951);
    				bank.close();
    			} else {
    				log(script + " Stopped script, ran out of coins / berries.");
    				stop();
    			}
    		}
    	}
    
    	@Override
    	public int onLoop() {
    		int nextCycle = randomNumber(675, 1630);
    		Player player = getLocalPlayer();
    		Inventory inventory = getInventory();
    		if (player.isInCombat()) {
    			state = State.COMBAT;
    			log(script + " Combat detected! Attempting to run to safe spot.");
    			getWalking().walk(outsideAggiesRoom.getRandomTile());
    			sleepUntil(() -> !player.isInCombat(), randomNumber(7250, 11275));
    		}
    		if (getWalking().getDestinationDistance() >= 3) {
    			// Make sure we don't click when we don't need to
    			sleep(nextCycle);
    		}
    		if (!draynorVillage.contains(player)) {
    			// Walk to Draynor
    			this.state = State.WALKING_TO_DRAYNOR;
    			getWalking().walk(draynorBank.getRandomTile());
    		} else {
    			// In Draynor Village.
    			if (inventory.isEmpty()) {
    				if (!draynorBank.contains(player)) {
    					// Walk to Bank
    					state = State.RESUPPLYING;
    					getWalking().walk(draynorBank.getRandomTile());
    				} else {
    					// In Draynor Bank
    					if (!getBank().isOpen()) {
    						getBank().open();
    					} else {
    						// Bank is Open
    						state = State.SUPPLYING;
    						withdrawSupplies(getBank(), inventory);
    					}
    				}
    			} else {
    				// Inventory is not Empty
    				if (inventory.count(995) < 5 || inventory.count(1951) < 3) {
    					// Inventory doesn't have enough supplies / Finished making dyes
    					if (!draynorBank.contains(player)) {
    						// Walk to Draynor
    						state = State.RESUPPLYING;
    						getWalking().walk(draynorBank.getRandomTile());
    					} else {
    						if (!getBank().isOpen()) {
    							getBank().open();
    						} else {
    							// Bank is open
    							state = State.SUPPLYING;
    							withdrawSupplies(getBank(), inventory);
    						}
    					}
    				} else {
    					// Inventory has Supplies to make dye
    					if (!aggiesRoom.contains(player)) {
    						if (!outsideAggiesRoom.contains(player)) {
    							// Walk to the outside of Aggie's room
    							state = State.SUPPLYING;
    							getWalking().walk(outsideAggiesRoom.getRandomTile());
    						} else {
    							// Enter Aggie's house
    							getWalking().walk(aggiesRoom.getRandomTile());
    						}
    					} else {
    						// In Aggies Room
    						state = State.CRAFTING;
    						Dialogues dialogues = getDialogues();
    						if (!dialogues.inDialogue()) {
    							// Not talking to Aggie
    							inventory.interact(1951, "Use");
    							getNpcs().closest("Aggie").interact();
    							sleepUntil(() -> dialogues.inDialogue(), nextCycle);
    						} else {
    							// Talking to Aggie
    							if (dialogues.canContinue()) {
    								if (dialogues.getNPCDialogue().equals("What can I help you with?")) {
    									inventory.interact(1951, "Use");
    									getNpcs().closest("Aggie").interact();
    									sleep(randomNumber(1630, 1700));
    								} else if (dialogues.getNPCDialogue().equals("Ok make me some red dye please.")) {
    									dialogues.clickContinue();
    								} else {
    									// Add 1 to the total Dye count
    									dyes ++;
    									dialogues.clickContinue();
    								}
    							} else {
    								// Walk around in Aggie's room (To avoid bugs)
    								getWalking().walk(aggiesRoom.getRandomTile());
    							}
    						}
    					}
    					
    				}
    			}
    		}
    		
    		return nextCycle;
    	}
    	
    	@Override
    	public void onPaint(Graphics g) {
    		g.drawString("Status: " + state.getName(), 10, 35);
    		g.drawString("Dyes Made: " + dyes, 10, 50);
    	}
    	
    	private enum State {
    		
    		WALKING_TO_DRAYNOR("Walking to Draynor"), RESUPPLYING("Grabbing supplies from Bank"), SUPPLYING("Bringing supplies to Aggie"), CRAFTING("Making dyes with Aggie"), COMBAT("Escaping combat");
    		
    		private String description;
    		
    		private State(String name) {
    			description = name;
    		}
    		
    		public String getName() {
    			return description;
    		}
    		
    	}
    }



    Download: https://www.mediafire.com/file/m3aagy6ms16f89k/DyeMaker.zip/file

    Pictures: 

    aggie.png

    gee.png

    ge.png

    Also a thanks to @thatbellguy for helping me start out and learn a few basic things with the dreambot API

     

    Posted

    YAY! im glad you got it done ! ill try it out once i get my pizzaeria on the SDN

    Posted

    Congrats on your first script! 

     

    Posted

    Not a bad first script, but if you're looking for improvements or helpful criticism then you could clean it up by using a getState method and a switch statement in your onLoop instead of nesting if statements.

    private State getState() {
    			if () { //Obviously you'd fill in your conditions, but this is the basic structure.
    				return State.DYE;
    			} else if () {
    				return State.BANK;
    			}  else {
    				return State.WALK;
    			}
    		return State.SLEEP;
    	}
    public int onLoop() {
    		switch (getState()) {
    		case DYE:
    			//dye actions
    			break;
    
    		case BANK:
    			//bank actions
    			break;
    
    		case WALK:
    			//walk actions
    			break;
    
    		//etc and so on
    
    		}
    
    		return Calculations.random(250, 350);
    
    	}

     

    Posted
    10 hours ago, NovaGTX said:

    Not a bad first script, but if you're looking for improvements or helpful criticism then you could clean it up by using a getState method and a switch statement in your onLoop instead of nesting if statements.

     

     

    Eww States

    Posted
    13 hours ago, Koschei said:

    Eww States

    He's new to scripting, I'm not going to suggest he writes a task system using nodes and whatnot since he's just getting into it.  It would do just fine for what he's trying to accomplish.

    • 3 weeks later...
    Posted
    9 hours ago, dashkey said:
    
    How can I prove it?

    If you download the jar file via the media fire link then you drop the script in C:\Users\Your_name\DreamBot\Scripts

     

    It should load in your 'local scripts' section of the script selector.

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.