City Posted September 30, 2021 Share Posted September 30, 2021 (edited) Hi I ran into a problem. For 2 hours now im trying to fix this error: import org.osbot.rs07.api.Trade; import org.osbot.rs07.api.Trade.TheirOffer; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.util.ItemContainer; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Hox", info = "Lets go", logo = "", name = "bot", version = 0) public class Dicebot extends Script { public int onLoop() throws InterruptedException { Trade trade = new Trade(); Player trader = getTrade().getLastRequestingPlayer(); // gets the last trade request if (trader != null) { getTrade().getLastRequestingPlayer().interact("Trade with"); // trade with him sleep(10000); // give him a bit time to offer something if (trade.getTheirOffers().isEmpty()) { //??????????????????????????????????????????????????????? getKeyboard().typeString("offer something please"); } else { getKeyboard().typeString("nice"); } } return random(5000,10000); } } I want to check if the player im trading with offered something. For that i do trade.getTheirOffers().isEmpty(). I tried so many different variations but nothing worked. After trying so long im tired. Lets forget about the advantage of this script or why i am doing that. I just want to know how to check if the player im trading with offered something and what he offered. Thank you! to add: i use 2 different accounts to simulate the situtaion Edited September 30, 2021 by PotatoMan40 Quote Link to comment Share on other sites More sharing options...
Gunman Posted September 30, 2021 Share Posted September 30, 2021 @PotatoMan40 Maybe try getTrade() instead so you get the updated trade information. You can also do a conditional sleep instead of a 10 second static sleep btw Quote Link to comment Share on other sites More sharing options...
City Posted September 30, 2021 Author Share Posted September 30, 2021 2 minutes ago, Gunman said: @PotatoMan40 Maybe try getTrade() instead so you get the updated trade information. You can also do a conditional sleep instead of a 10 second static sleep btw Wow bro. That was simple. I was freaking out because since yesterday i was trying to figure out what im doing wrong. Thank you!! Quote Link to comment Share on other sites More sharing options...
City Posted September 30, 2021 Author Share Posted September 30, 2021 @Gunman Bro one last Question : if (getTrade().getTheirOffers().onlyContains("Coins")) { getKeyboard().typeString("You gave me "+getTrade().getTheirOffers().getItem(0).getAmount()); This doesnt work. I tried getItem(0) because its the first item and then i try to get the amount of it but my bot only types: You gave me 0. I know how to check the Item but how do i check the amount of it? Quote Link to comment Share on other sites More sharing options...
Gunman Posted September 30, 2021 Share Posted September 30, 2021 4 minutes ago, PotatoMan40 said: @Gunman Bro one last Question : if (getTrade().getTheirOffers().onlyContains("Coins")) { getKeyboard().typeString("You gave me "+getTrade().getTheirOffers().getItem(0).getAmount()); This doesnt work. I tried getItem(0) because its the first item and then i try to get the amount of it but my bot only types: You gave me 0. I know how to check the Item but how do i check the amount of it? You getting item with ID 0, not the first item in an array. Use getItems instead of getItem Quote Link to comment Share on other sites More sharing options...
City Posted September 30, 2021 Author Share Posted September 30, 2021 4 minutes ago, Gunman said: You getting item with ID 0, not the first item in an array. Use getItems instead of getItem Wtf i feel like an idiot because its exactly is what i did and first it didnt work. But now after you told me it does. Anyways Thank You, i guess. You helped me a lot Quote Link to comment Share on other sites More sharing options...