ProBotterIamN 11 Share Posted November 5, 2017 How do i declare npc's ? like getnpc Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted November 5, 2017 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/ Link to comment Share on other sites More sharing options...
ProBotterIamN 11 Author Share Posted November 5, 2017 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 More sharing options...
Eclipseop 194 Share Posted November 5, 2017 NPC guyIWantToKILL = getNpcs()... jajajjajaja u silly duck! Link to comment Share on other sites More sharing options...
ProBotterIamN 11 Author Share Posted November 5, 2017 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 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 More sharing options...
Pseudo 179 Share Posted November 5, 2017 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.