Johnxtrem
-
Joined
-
Last visited
Posts posted by Johnxtrem
-
-
-
Edited by Johnxtrem
Solved it like this:
private void FinishDialogue() throws InterruptedException { while (IsPendingContinue()) { ClickContinue(); sleep(650, 1050); } } private boolean ClickContinue() { if (!IsPendingContinue()) return false; keyboard.pressKey(32); return true; } private boolean IsPendingContinue() { List<RS2Widget> widgetsList = widgets.getAll().stream().filter (w -> w.getMessage().equals("Click here to continue")).collect(Collectors.toList()); return widgetsList.size() > 0; }
-
-
2 minutes ago, k9thebeast said:
Not 100% sure, havent really editted my tut script in a while. Try sending a space. getKeyboard().typeString(" ");
I just checked and isPendingContinuation and inDialogue always returns true, so its kinda "annoying" to detect every part when exactly it is done. I've already tried the keyboard method, works but, yeah...

-
-
Edited by Johnxtrem
Hey, I'm having issue with dialogs. dialogues.clickContinue(); sometimes just doesn't want to continue the conversation. Its like it doesn't find the widget or something.
Here's my code to finish a dialogue.
private void FinishDialogue() throws InterruptedException { while (true) { boolean isPending = new ConditionalSleep(6*1000) { @Override public boolean condition() throws InterruptedException { return dialogues.isPendingContinuation(); } }.sleep(); if (isPending) { dialogues.clickContinue(); sleep(650, 1050); continue; } break; } }
Any directions to help solve this would be appreciated, thanks!
-
-
-
-
4 minutes ago, whipz said:
private void acceptTrades() { if (trade.isFirstInterfaceOpen() && trade.didOtherAcceptTrade()) { log("Accepting first trade"); gpmade = gpmade + Math.toIntExact(trade.getTheirOffers().getAmount("Coins")); trade.acceptTrade(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return trade.isSecondInterfaceOpen(); } }.sleep(); } else if (trade.isSecondInterfaceOpen()) { log("Accepting second trade"); trade.acceptTrade(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return !trade.isCurrentlyTrading(); } }.sleep(); } }Thats mine, works everytime i dont run 35+ clients but i have tested it on 10 running for a few days and not one problem
Hey, I had something similar prior running so many clients and worked just perfectly, the issue occured only when running as much... I made it with conditional sleeps and loops now and seems to be working so far
-
Most likely yeah, doesn't happen always but just sometimes. I'm running about 35+ clients.
Hmm, I'm using conditional loop, but since it returns true even if it doesn't behave correctly its kinda useless

new ConditionalLoop(getBot(), 3) { @Override public boolean condition() { return !trade.acceptTrade(); } }.start();
-
Hey guys
I've noticed this can happen sometimes, usually after account is running for a longer time when calling:
trade.acceptTrade();
Instead of accepting the trade, it clicks on decline button instead, not even clicking but just hover it and returns true despite.
Any ideas what could be the cause of this?
Thanks!
-
Edited by Johnxtrem
Hey, I made a post about this before, but here's another question. When I run 4-8 clients on one pc, scripts (generally) behave correctly.
I tested then 35 clients on a pc and scripts start being stuck, etc.
To see what's up, I did a little test and noticed that the usual response time of methods is greatly increased, example:
1. Trade player
2. sleep 200ms.
2. loop -> log trade.isCurrentlyTrading(); => FALSE
3. After 1.8 secs => TRUE.
This applies to almost all methods.
So my question again is, how do you handle such inconsistency except by adding longer sleeps?
P.S. I use conditional sleeps, but that can't be applied everywhere.
Thanks!
-
10 minutes ago, Explv said:
You're thinking about it completely wrong. It doesn't make sense for getLastRequestingPlayer to be null unless no one has traded you.
What you should do is have a global boolean variable, let's call it shouldTrade.
You initialise shouldTrade to false.
Then you add a message listener using getBot().addMessageListener(MessageListener listener) or override the onMessage(Message message) method in your script class.
Inside the onMessage method you then check if the message is of type RECEIVED_TRADE. If it is of that type set shouldTrade to true.
In onLoop you check if shouldTrade is true, if it is then you can begin trading.
Once the trade is complete, set shouldTrade to false.
There are other ways to do it, but that's probably the simplest
Thanks, making more sense now.

-
-
-
Edited by Johnxtrem
Hey, I've noticed that when running 5+ accounts, certain things don't work as intended. Methods that usually return the correct value, in that case don't.
For example, when trading:
trade.getOurOffers()contains() => Returns false, despite it's true.
trade.isFirstInterfaceOpen(); => Returns false, despite true.
trade.isSecondInterfaceOpen(); => Returns false, despite true.
trade.acceptTrade(); => Returns false, despite true.
What could be causing this?
I use conditional sleeps, but in some situations, my script realies on these to return the correct value causing unexpected behavior.Could it be lag, heavy on resources?
Thanks!

-
-
-
-
-
-
-
Price check on Barrows Pure?
in Price Check
Hey guys, need a price check on my account:
Thanks!