Jump to content

Canidae

Members
  • Posts

    38
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Canidae

  1. You forgot to check if the interaction actually was succesful, this way you can trigger the sleep without actually having opened the pack.
  2. This might mess up when trying to pause the script. I would also write it like this: for (Item item : getInventory().getItems()) { if (item != null && item.getName().equals("Feather pack") && item.interact("Open")) { //sleep } }
  3. I would say it depends on the situation. In case of feather packs, I can imagine you don't want to wait a tick everytime you open one since opening them as quick as possible is what you essentially want. You would probably need different code to prevent trying to interact with a non-existent item.
  4. Outside of your question, this is not how you should go on and write this code. What you are trying is to do one method call which results in buying items, without any kind of looping. That's not going to work properly and even if it will, it's unreliable. You can do multiple things. Create an Event class and execute it as an event, let your script loop through it (by using a task system for example) or write a recursive method (not sure if that's a good idea though). This is an example with an event. When you want to buy items, you will create a new event, pass through the list of items and execute the buying. If you are done buying, you set the event to finished and the script will start looping again. (Not sure if this code works and if it's 100% correct, long time ago for me). public class Main extends Script { @Override public int onLoop() throws InterruptedException { if (shouldbuyItems()) { BuyItemsEvent event = new BuyItemsEvent(buyItemList); event.exchangeContext(getBot()); execute(event); } return 300; } } public class BuyItemsEvent extends Event { private List<BuyItem> items; public BuyItemsEvent(List<BuyItem> items) { this.items = items; } @Override public int execute() throws InterruptedException { if (!getGrandExchange().isOpen()) { openGE(); } else if (boughtItems()) { setFinished(); } else { buyItems(); } return 300; } public void openGE() { RS2Object geBooth = getObjects().closest("Grand Exchange booth"); NPC exchangeWorker = getNpcs().closest("Grand Exchange Clerk"); int random = new Random().nextInt(2); if (geBooth != null && random == 0) { if (geBooth.interact("Exchange")) { new ConditionalSleep(2500, 3000) { @Override public boolean condition() { return getGrandExchange().isOpen(); } }.sleep(); } } else if (exchangeWorker != null) { if (exchangeWorker.interact("Exchange")) { new ConditionalSleep(2500, 3000) { @Override public boolean condition() { return getGrandExchange().isOpen(); } }.sleep(); } } } } I also recommend using this class for conditional sleeps:
  5. That's not a repeater, it's a powerline adapter. It will send the connection through the power lines in your house. Your ping won't be affected that much.
  6. This is exactly like dad's advice, which is useless obviously.
  7. If you looking for an alternative, take a look at Vultr. It basically offers the same service as DigitalOcean, but cheaper.
  8. So to make things clear, you fucked up. Shit happens and you probably forgot about it, or even worse did it intentional. Don't try to make things worse by trying to prevent them from finding you. Contact them through e-mail or give them a call and explain what happened. Don't try to run from it, they will eventually find you anyways and you don't want to battle things like this out in court. (Or however that goes in US). Just at least make sure you don't fuck up like this again and learn from it. A company like that is probably to not going to condone $500 just because you are whatever years old. If you need any help, send me a PM. I have (accidentally) fucked up some stuff in the past as well when I was young.
  9. An integer can never be null. The best way is to just do getInventory().getAmount().
  10. Since widget IDs tend to change, you should use something different instead. For example text color, position or something else.
  11. I can make you one for $150 using 2Captcha, source included of course.
  12. Exactly. You are first using methods on an object and are then nullchecking it for example.
  13. What do you mean with global variables then? They don't exist in Java and you also said your meaning of global variables aren't (public) static variables. What is it then? The only thing you can do in Java is having public classes with a public static variable in it to make it look like it's some sort of global variable.
  14. Java doesn't really have global variables. So as soon as someone refers to a "global variable" in Java, people will interpret it as a static variable because they share some of their properties.
  15. I recommend you not using this. If the script list is not refreshed, the static fields will keep their values. So as soon as someone stops the script and starts it again without refreshing the list, it will start instantly and probably crash.
  16. If you use the Widget debugger, you will find out there are multiple ways on how to detect a widget. You can also use position for example.
  17. Looking at your code, I recommend you not playing with trades since you will need some additional checks to make sure you trade the right player etc. etc. Start with something more easy, like a cow killer or a woodcutter.
  18. Contact the scripter who made your script. Best way to do so is by finding his thread about the script and fill in the bug report form.
  19. Try to appeal using this link: https://support.runescape.com/hc/en-gb/articles/115002238729-Account-Bans Your account could be compromised by someone if you weren't using 2nd-factor authentication. Some people clear the bank and bot on the account because they can't change the password.
  20. You can add all error message checks yourself, there's a list which contains all of them with the according number. It's probably the easiest way to do so.
  21. You can use a custom login handler. I think @Explv has one in the snippet section. You could also override the break handler, making it break at the time it should be logged out iirc.
  22. Please copy the NPE you got and note which line it came from.
×
×
  • Create New...