tarassekanev 0 Posted May 30, 2023 I'm writing a simple script, and one line tells the script to combine two items (cooking apple and pie shell). The bot selects the two items, and mixes them, trying to make unkooked apple pie. What happens is that the bot never clicks on the button that will start combining the two. import org.dreambot.api.methods.container.impl.Inventory; Inventory.combine(2315,1955); (I wasnt able to put the screenshot here so https://drive.google.com/file/d/1ZsXbfvspliCE5ifoMGhHVUs4QDeHUkZL/view?usp=sharing ) Here's the full code: package main; // Ive got a bunch of unused packages here, Ill take em out latter import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.bank.Bank; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.methods.skills.SkillTracker; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.impl.TaskScript; //import org.dreambot.api.methods.MethodContext; import org.dreambot.api.methods.container.impl.bank.BankLocation; import org.dreambot.api.methods.item.GroundItems; import org.dreambot.api.methods.walking.web.node.impl.teleports.ItemTeleport; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.grandexchange.GrandExchange; import org.dreambot.api.methods.grandexchange.LivePrices; import org.dreambot.api.methods.interactive.NPCs; import java.util.concurrent.TimeUnit; import org.dreambot.api.utilities.Sleep; import java.awt.Point; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.methods.interactive.NPCs; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.input.Mouse; //import org.dreambot.api.wrappers.items.GEItem; @ScriptManifest(category = Category.MONEYMAKING, name = "Apple Pie maker", description = "Mixes shell and apple.", author = "Myself", version = 1.0) public class main extends AbstractScript{ State state; private enum State{ BUY, MAKE, SELL } private void make(){ Inventory.combine(2315,1955); } private boolean CheckSell(){ if(Inventory.count("Coins") < 1000){ return true; } else{ return false; } } private void openBank(){ if(!Bank.open()){ NPC banker = NPCs.closest("Banker"); banker.interact("Bank"); Sleep.sleep(1000, 2000); } } private State getState(){ if(CheckSell()){ state = State.SELL; return state; } if((!(Inventory.count(2315) == 10) && !(Inventory.count(1955) == 10)) || (!(Inventory.count(2316) == 10) && !(Inventory.count(1956) == 10))){ state = State.BUY; } if((Inventory.count(2315) == 10 && Inventory.count(1955) == 10) || (Inventory.count(2316) == 10 && Inventory.count(1956) == 10)){ state = State.MAKE; } return state; } public int onLoop(){ switch (getState()){ case BUY: log("BUYING"); if(!GrandExchange.isOpen()){ NPC GEClerk = NPCs.closest("Grand Exchange Clerk"); GEClerk.interact("Exchange"); Sleep.sleep(1700, 3000); } if(GrandExchange.getUsedSlots() >= 2){ break; } GrandExchange.buyItem(2315,10, LivePrices.get(2315)); GrandExchange.buyItem(1955,10, LivePrices.get(1955)+8); while (true){ if(GrandExchange.isReadyToCollect()){ GrandExchange.collect(); } if(Inventory.count(2315) == 10 && Inventory.count(1995) == 10){ GrandExchange.close(); break; } } break; case MAKE: if(Inventory.contains(2316)){ openBank(); Bank.deposit(2316,10); Sleep.sleep(500, 1000); } if(Inventory.contains(1956)){ openBank(); Bank.deposit(1956,10); Sleep.sleep(500, 1000); } if(!(Inventory.count(2315) == 10) && !(Inventory.count(1955) == 10)) { Bank.withdraw(2315,10); Bank.withdraw(1955,10); Sleep.sleep(700, 1000); } Bank.close(); Sleep.sleep(1000, 2500); make(); /* Point pointPIE = new Point (100,100); Mouse.move(pointPIE); Sleep.sleep(1000, 6500); */ break; } return 0; } }
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now