ginahana1 1 Share Posted November 29, 2023 Hey, I need some help with my scripting journey using DreamBot. My script and most of my scripts will probably use GE at some point, but the problem is I can't buy anything from GE! It is possible to sell, but not buy! I am 100% sure that I am not restricted or something. I looked up docs ( Yes, i know that this exist, but it does not work... 😕 -> GrandExchange.buyItem("Cosmic rune", 100, 95)), tried everything (even typing in searchbar using Keyboard to serach for an item - because GrandExchange.searchItem("Cosmic rune") does not work either) and nothing worked - except the fact that that I can buy something only if the item that I want to buy is the last bought item. Can you please provide me some snippets that contain buying items from GE? If you have some snippets that contain selling I would be happy too, but the point is buying. Thanks in advance for repsonse! And sorry for my english Link to comment Share on other sites More sharing options...
MaximusPrimo 59 Share Posted November 29, 2023 If you could post a larger snippet of your code for buying it would be easier to see what is going on in your code Link to comment Share on other sites More sharing options...
ginahana1 1 Author Share Posted November 29, 2023 16 hours ago, MaximusPrimo said: If you could post a larger snippet of your code for buying it would be easier to see what is going on in your code Here are few snippets I made to try diffrent solutions. There was more attempts yesterday - I wrote these snippets for the answer right now. Just like i said - nothing works except selling (buy, search etc. doesnt work all the way). Thats why i asked for some ready to use snippets to understand what am I doing wrong, or what conception I dont understand (This is my first Dreambot script and actually first Java code). GrandExchange.open(); //works Sleep.sleep(1000, 1500); //works GrandExchange.openBuyScreen(0); //works Sleep.sleep(500, 1000); //works if(GrandExchange.isSearchOpen()) { log("Grand exchange search open!"); //works GrandExchange.searchItem("Cosmic rune"); // does not work - no search log("Should search cosmic rune!"); //works } GrandExchange.close(); //////////////////////////////////////////////////////////////////////////// GrandExchange.open(); //works Sleep.sleep(1000, 1500); //works GrandExchange.openBuyScreen(0); //works Sleep.sleep(500, 1000); //works if(GrandExchange.isBuyOpen()) { log("Buy window is open"); //works GrandExchange.buyItem("Cosmic rune", 10, 92); // does not work - only if the last searched item is cosmic rune it will buy it. log("Should buy cosmic rune using .buyitem"); // works } GrandExchange.close(); //////////////////////////////////////////////////////////////////////////// GrandExchange.open(); //works Sleep.sleep(1000, 1500); //works GrandExchange.buyItem("Cosmic rune", 2, 93); //opens buy screen, but still doesn't buy the item. If the last searched item is cosmic rune it will buy, buy only after that. GrandExchange.close(); //works Link to comment Share on other sites More sharing options...
TheSaint 9 Share Posted December 15, 2023 (edited) GrandExchange.buyItem(itemName, Quanity, Price); Edited December 16, 2023 by TheSaint Link to comment Share on other sites More sharing options...
ginahana1 1 Author Share Posted December 16, 2023 13 hours ago, TheSaint said: GrandExchange.buy(itemName, Quanity, Price); First of all there is nothing like just .buy And second of all - for some people that doesn't work what you had in mind - i tried many solutions including yours and they didint work for some reason 😕 Link to comment Share on other sites More sharing options...
TheSaint 9 Share Posted December 16, 2023 Sorry i mean't to put buyItem. Edited. Can you post your whole code Link to comment Share on other sites More sharing options...
TheSaint 9 Share Posted December 16, 2023 import org.dreambot.api.methods.grandexchange.GrandExchange; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "GE Test", description = "", author = "TheSaint", version = 1.0, category = Category.MONEYMAKING, image = "") public class Main extends AbstractScript { @Override public int onLoop() { if (!GrandExchange.isOpen()) { GrandExchange.open(); } else if (GrandExchange.isReadyToCollect()) { GrandExchange.collect(); } else if (GrandExchange.getOpenSlots() > 0) { GrandExchange.buyItem("Jug of wine", 1, 5000); } else { log("No open slots available to buy items."); } return 2000; } } Link to comment Share on other sites More sharing options...
ginahana1 1 Author Share Posted December 16, 2023 I already tried something like you posted. I will try anyway again later this day to check if it works diffrently this time. If it will not work i will post a snippet of the code. Thanks for your help TheSaint 1 Link to comment Share on other sites More sharing options...
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