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
  • Try asking for help in the chatbox
  • Declaring NPC?


    Recommended Posts



    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:



    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 {
    	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!");
    	public int onLoop() {
    		switch (getState()) {
    		case CRUSH:
    			getInventory().getItem("Knife").useOn("Chocolate Bar");
    		case BANK:
    			Banker.interact("Bank Banker");
    		case WAIT:
    		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"

    Edited by ProBotterIamN
    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)
    //sleep until condition met
    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    • 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.