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
  • Declaring NPC?


    ProBotterIamN

    Recommended Posts

    https://dreambot.org/javadocs/

     

    No offense intended, but if you don't know how to do something as basic as declare an entity, you probably need to read up on some tutorials pal.

     

    See here:

     

    https://dreambot.org/forums/index.php/forum/96-tutorials/

    i am reading a tutorial but instead of game objects i need npcs hence why i asked here..

    Link to comment
    Share on other sites

    NPC guyIWantToKILL = getNpcs()...

     

    jajajjajaja u silly duck!

    got it 

    private State getState() {       NPC bank = getNpcs().closest("Banker");
            if (bank != null)
                return State.BANK;
            return State.WAIT;
        }

    now i can go further ty :D

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.container.impl.bank.Bank;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.wrappers.interactive.NPC;
    
    @ScriptManifest(author = "ProBotterIamN", name = "Chocolate Crasher", version = 1.0, description = "Will crush Chocolate", category = Category.MONEYMAKING)
    public class main extends AbstractScript {
    
    	public void onStart() {
    		log("Starting Script!");
    		log("More features will be added soon!");
    		log("Leave feedback!");
    
    	}
    
    	private enum State {
    		BANK, CRUSH, WAIT
    	};
    
    	private State getState() {
    	       NPC banker = getNpcs().closest("Banker");
    	       if (!getInventory().isEmpty())
    	            return State.BANK;
    	        return State.WAIT;
    	    }
    
    	public void onExit() {
    		log("Thanks for running Chocolate Crasher!");
    	}
    
    	@Override
    	public int onLoop() {
    		switch (getState()) {
    		case CRUSH:
    			getInventory().getItem("Knife").useOn("Chocolate Bar");
    			break;
    		case BANK:
    			Banker.interact("Bank Banker");
    			break;
    		case WAIT:
    			sleep(300);
    			break;
    
    		}
    		return Calculations.random(500, 600);
    	}
    }
    

    i am stuck on using an item on a different item from the inventory the items i wanna use on each other are "Knife/Pestle And Mortar" on "Chocolate Bar"

    Link to comment
    Share on other sites

     

    if (getInventory().getItem(x).interact(s)) {
    //conditional sleep ideally (check if inv item is selected perhaps, if hooked)
    getInventory().getItem(y).interact(string);
    //sleep until condition met
    }
    Link to comment
    Share on other sites

    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.