Magerange Posted May 14, 2017 Share Posted May 14, 2017 (edited) I've been trying to implement @LoudPacks GE API here (no idea if it is outdated or not, but when I tested it for GE actions (buy & sell items in quantities, etc.), it did everything according to the code). Now I try to implement it in my local personal script and the script manages to get stuck in different places (terminal shows that commands have been executed though). I've been on this mission for the past two days but I get stuck without commands being executed... So far I've made it that makes it to the GE, opens an offer, sets price for the item and then closes the offer window (strange that it doesn't do anything with the amount, eventhough it is noted in params). So here is the snippet: private void sell() throws InterruptedException { getWalking().webWalk(GrandEx); GrandExchange GE = new GrandExchange(this); GE.openGE(); GE.createSellOffer("Jug of water", 14, 300); GE.collectItems(false); } Yes, I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead? Thank you! Edited May 14, 2017 by Magerange Quote Link to comment Share on other sites More sharing options...
k9thebeast Posted May 14, 2017 Share Posted May 14, 2017 (edited) getGrandExchange().sellItem(this,works,whynot,useit) stopusingoldsnippetsthanks Edited May 14, 2017 by k9thebeast 1 Quote Link to comment Share on other sites More sharing options...
Magerange Posted May 14, 2017 Author Share Posted May 14, 2017 4 minutes ago, k9thebeast said: getGrandExchange().sellItem(this,works,whynot,useit) stopusingoldsnippetsthanks Thanks! Now I feel even worse after 2 days of struggling. I guess I learned the hard way. 1 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted May 14, 2017 Share Posted May 14, 2017 1 hour ago, Magerange said: I've been trying to implement @LoudPacks GE API here (no idea if it is outdated or not, but when I tested it for GE actions (buy & sell items in quantities, etc.), it did everything according to the code). Now I try to implement it in my local personal script and the script manages to get stuck in different places (terminal shows that commands have been executed though). I've been on this mission for the past two days but I get stuck without commands being executed... So far I've made it that makes it to the GE, opens an offer, sets price for the item and then closes the offer window (strange that it doesn't do anything with the amount, eventhough it is noted in params). So here is the snippet: private void sell() throws InterruptedException { getWalking().webWalk(GrandEx); GrandExchange GE = new GrandExchange(this); GE.openGE(); GE.createSellOffer("Jug of water", 14, 300); GE.collectItems(false); } Yes, I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead? Thank you! It's better to just use the OSBot api. Also, just some tips: only webwalk if ge area does not contain player pos and we are very far away use Banks.GRAND_EXCHANGE as it's in the bank location api and it's better to just call the area from that instead of making your own area which may be redundant. every time the method sell is called it will create the GE object/class and it's better to just create it on the onstart once not every time it's called i havent seen his snippet but i assume the open ge caters for opening the ge if it isnt open in the first place? because if it doesnt it will probably just spam click it open or somethin 1 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted May 14, 2017 Share Posted May 14, 2017 Its mad outdated lmao Quote Link to comment Share on other sites More sharing options...
Magerange Posted May 14, 2017 Author Share Posted May 14, 2017 1 minute ago, LoudPacks said: Its mad outdated lmao Couldn't just replied to a PM lol? But thanks for confirming. On to the OSBot API - how come that I import the GrandExchange Class and use it in the script, but script shows that I do not use it...? The commands I call are allowed, but they do not work when testing the script on OSRS... Maybe it's because I wrote it over LoudPacks API? Quote Link to comment Share on other sites More sharing options...
Team Cape Posted May 14, 2017 Share Posted May 14, 2017 1 hour ago, Magerange said: I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead? Thank you! You should probably learn Java before trying to script. That method is pretty bad, not going to sugarcoat it. Quote Link to comment Share on other sites More sharing options...
TTTTurbo Posted May 14, 2017 Share Posted May 14, 2017 this is like reading another language Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted May 15, 2017 Share Posted May 15, 2017 4 hours ago, Magerange said: Couldn't just replied to a PM lol? But thanks for confirming. On to the OSBot API - how come that I import the GrandExchange Class and use it in the script, but script shows that I do not use it...? The commands I call are allowed, but they do not work when testing the script on OSRS... Maybe it's because I wrote it over LoudPacks API? Just write your own that works built on top of the osbot api. Also you can't have classes with the same names or it can use issues. Quote Link to comment Share on other sites More sharing options...
Alek Posted May 15, 2017 Share Posted May 15, 2017 1. The GE API I wrote is probably much better (no offense to whoever wrote it) 2. It's easier to use the OSBot API than including external libraries (or copy-pastaing snippets) 1 Quote Link to comment Share on other sites More sharing options...
Magerange Posted May 15, 2017 Author Share Posted May 15, 2017 Finally cracked it. Turns out you have to put in some hefty sleeps in between the commands. I guess it's because of heavy code that Alek has pushed together under GE API and the fact that GE tends to lag. Quote Link to comment Share on other sites More sharing options...
Alek Posted May 15, 2017 Share Posted May 15, 2017 1 hour ago, Magerange said: Finally cracked it. Turns out you have to put in some hefty sleeps in between the commands. I guess it's because of heavy code that Alek has pushed together under GE API and the fact that GE tends to lag. Putting a sleep before or after buyItem/sellItem won't change a single thing; that or you deobfuscated the jar, reversed the methods, then re-wrote them with your new sleeps in the method? I have no idea where you are putting these magical sleeps. 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted May 15, 2017 Share Posted May 15, 2017 GE only lags if you are checking the box status way too much, bcs it takes a fair amount of cpu. If you are running a lot of bots and the cpu is on a high load, it's better to use you donw method. The Osbot method isn't made for slow stuff ;) Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted May 15, 2017 Share Posted May 15, 2017 22 hours ago, Imateamcape said: You should probably learn Java before trying to script. The hell you say! Quote Link to comment Share on other sites More sharing options...
galois69 Posted June 7, 2021 Share Posted June 7, 2021 (edited) sellItem() doesn't really appear to be working in 2021? sellItem(Box) works fine in opening the interface, but much of the time sellItems() just returns false having failed. I'm writing a merching script and having to rewrite wrappers around all these methods (eg. also around getOverallPrice() which randomly NPEs from time to time) is frustrating. Let me know if it's my fault -- short context on how I'm using it is below. Help much appreciated! Maybe it is also failing in a similar way nowadays for others. if (free_box != null){ log("found free box to bigSell in: " + free_box); getGrandExchange().sellItems(free_box); log("opened sell interface"); sleep(approx(3000)); boolean sold = getGrandExchange().sellItem(name2id(itemName), price, (int) this.inventory.getAmount(itemName)); Edited June 7, 2021 by galois69 Quote Link to comment Share on other sites More sharing options...