June 7, 20178 yr So I've decided to clean and restructure one of my scripts that I've stitched together by a miracle (started scripting roughly a month ago, so don't kill me straight away). This one has the trading function included in it, but I can't seem to make it complete the second trade window (it does 'accept' the first trade screen (if condition is met) , but closes second one). I've inserted snippets after the script has opened the trade window (no issues there). if (getTrade().isFirstInterfaceOpen() && getTrade().getTheirOffers().contains("")) { getTrade().acceptTrade(); Script.sleep(Script.random(1000, 1500)); } if (getTrade().isSecondInterfaceOpen()) { getTrade().acceptTrade(); Script.sleep(Script.random(1000, 1500)); } Previously I used something very redundant and fairly stupid, but it got the job done (no need to grill me on that one): if (getTrade().isFirstInterfaceOpen()) { Script.sleep(Script.random(2000, 3000)); if (getTrade().getTheirOffers().contains("")) { Script.sleep(Script.random(2000, 3000)); getTrade().acceptTrade(); Script.sleep(Script.random(2000, 3000)); getTrade().acceptTrade(); Script.sleep(Script.random(2000, 3000)); } Edited June 7, 20178 yr by Magerange
June 7, 20178 yr This works for me, ignore the "script." that precedes all of my crap, it's a long story. edit: looks like you just need yo use trade instead of getTrade if (script.trade.isFirstInterfaceOpen() == true){ script.log("First window open, waiting"); new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return script.trade.didOtherAcceptTrade() == true; } }.sleep(); script.trade.acceptTrade(); new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return script.trade.didOtherAcceptTrade() == true; } }.sleep(); script.log("Second window open, accepting"); Script.sleep(Script.random(2000, 3000)); script.trade.acceptTrade(); Edited June 7, 20178 yr by sudoinit6
June 7, 20178 yr 2 minutes ago, sudoinit6 said: This works for me, ignore the "script." that precedes all of my crap, it's a long story. edit: looks like you just need yo use trade instead of getTrade if (script.trade.isFirstInterfaceOpen() == true){ script.log("First window open, waiting"); new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return script.trade.didOtherAcceptTrade() == true; } }.sleep(); script.trade.acceptTrade(); new ConditionalSleep(30000) { @Override public boolean condition() throws InterruptedException { return script.trade.didOtherAcceptTrade() == true; } }.sleep(); script.log("Second window open, accepting"); Script.sleep(Script.random(2000, 3000)); script.trade.acceptTrade(); that code nasty if (trade.isCurrentlyTrading()) { if (trade.isFirstInterfaceOpen()) { trade.acceptTrade(); log("accept trade 1"); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return trade.isSecondInterfaceOpen() || !trade.isCurrentlyTrading(); } }.sleep(); } else if (trade.isSecondInterfaceOpen()) { log("accept trade 2"); trade.acceptTrade(); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return !trade.isCurrentlyTrading(); } }.sleep(); } }
June 7, 20178 yr 3 minutes ago, Lewis said: that code nasty Meh, I am a horrible coder, but it gets the job done. I was just trying to help out.
June 7, 20178 yr 30 minutes ago, sudoinit6 said: Meh, I am a horrible coder, but it gets the job done. I was just trying to help out. it gets the job done, but theres many flaws in it
June 7, 20178 yr 42 minutes ago, Lewis said: it gets the job done, but theres many flaws in it Like everything else I will fix them when it doesn't work, that's how one learns.
June 9, 20178 yr On 6/8/2017 at 0:03 AM, sudoinit6 said: looks like you just need yo use trade instead of getTrade Literally the same thing
Create an account or sign in to comment