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
  • Need onion picker sc


    yarkin876

    Recommended Posts

    • 3 weeks later...
    Posted

    here is a simple code (no antiban, i didn't test the script yet but im sure pretty sure it is working):

    import java.awt.Color;
    import java.awt.Graphics2D;
    
    import org.dreambot.api.methods.Calculations;
    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.utilities.Timer;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    @ScriptManifest(author = "Mauricimoo", name = "Onion Picker", version = 1.0, description = "for the guy with bad spelling", category = Category.MONEYMAKING)
    public class main extends AbstractScript {
    
    	public Timer t;
    	public static int runEnergy = 0;
    
    	public void onStart() {
    		log("hello");
    		t = new Timer();
    
    	}
    
    	public void onPaint(Graphics2D g) {
    		g.setColor(new Color(0, 205, 102, 120));
    		g.fillRect(20, 123, 150, 90);
    		g.setColor(Color.LIGHT_GRAY);
    		g.drawString("Mauricimoo OnionPicker", 25, 135);
    		g.drawString("here you go, it probably works fine", 25, 170);
    
    	}
    
    	Area onionArea = new Area(3186, 3269, 3192, 3266, 0);
    	Area bankArea = new Area(3092, 3240, 3094, 3246, 0);
    	Area gateArea = new Area(3185, 3268, 3186, 3269, 0);
    
    	public void onExit() {
    		log("cya");
    	}
    
    	@Override
    	public int onLoop() {
    		GameObject onion = getGameObjects().closest(b -> b != null && b.getName().equals("Onion"));
    		NPC banker = getNpcs().closest(b -> b.getName().equals("Banker"));
    		GameObject gate = getGameObjects().closest(g -> g != null && gateArea.contains(g) && g.hasAction("Open"));
    
    
    		
    		if (getInventory().isFull() && !bankArea.contains(getLocalPlayer())) {
    			getWalking().walk(bankArea.getRandomTile());
    		}
    
    		if (getInventory().isFull() && bankArea.contains(getLocalPlayer())) {
    			sleep(200, 400);
    			banker.interact("Bank");
    			sleepUntil(() -> getBank().isOpen(), 8000);
    			sleep(100, 800);
    			getBank().depositAllItems();
    			sleep(600, 1200);
    			getBank().close();
    			sleep(1200, 1500);
    		}
    
    		if (onionArea.contains(getLocalPlayer()) && !getInventory().isFull()) {
    			onion.interact();
    			sleep(900, 1200);
    		}
    
    		if (!onionArea.contains(getLocalPlayer()) && !getInventory().isFull()) {
    			getWalking().walk(onionArea.getRandomTile());
    			if (gate.exists() && gate.distance() <= 2) {
    				gate.interact("Open"); sleep(1600, 2400);
    			}
    		}
    
    		return Calculations.random(50, 80);
    	}
    }
    

    if the script doesn't work, just say where it gets stuck and open the tools->debugging->debug console and copy the error line.

     

    if you dont know what to do what that code, you can just download the .jar file here: http://s000.tinyupload.com/?file_id=98626158341409781240 . im not sure which upload site i may use from dreambot. hope this helps.

    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.