Jump to content

NoxMerc

Members
  • Posts

    74
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NoxMerc's Achievements

Iron Poster

Iron Poster (3/10)

18

Reputation

  1. I cleaned up your code a little bit. You have some really glaring problems, the first of which is the fact that all of your if(){} statements are empty. Frankly speaking this is unacceptable. I've incorporated a pared-down version of @Explv's Sleep utility which makes your code much more readable. I think if you use this version you'll have an easier time figuring out your bugs. One other thing I did fix was the fact that you're reusing Entities. Changing the state of an entity in-game will require you to reacquire that entity again to retrieve its updated properties. In other words, if you get an Object, and then destroy that object in-game (by removing a larder), that first object's properties won't be updated. You have to reacquire it. import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.Condition; import org.osbot.rs07.utility.ConditionalSleep; import java.util.function.BooleanSupplier; @ScriptManifest(name = "LardersV2", logo = "", version = 1, author = "Imthabawse", info = "Builds Oak Larders") public class Oaklarders extends Script { private final int ID_OAK_PLANK = 8778; private final int WIDGET_LARDER_ROOT = 458; private final int WIDGET_LARDER_CHILD = 5; private final int WIDGET_LARDER_SUBCHILD = 4; private final int MIN_OAK_PLANKS = 8; @Override public int onLoop() { if (getInventory().getAmount(ID_OAK_PLANK) <= MIN_OAK_PLANKS) { // If inventory contains 8 or equal to 8 oak planks Entity larderspace = getObjects().closest("Larder space"); // Get closest Larder space if (larderspace != null && larderspace.interact("Build")) { // If Larder space exists then Build Sleep.until(() -> !getObjects().closest(f -> f.getPosition().equals(larderspace.getPosition())).exists(), 400, 500); } RS2Widget buildlarder = getWidgets().get(WIDGET_LARDER_ROOT, WIDGET_LARDER_CHILD, WIDGET_LARDER_SUBCHILD); // Oak larder widget if (buildlarder != null && buildlarder.interact("Build")) { // If exists then build larder Sleep.until(() -> myPlayer().isAnimating(), 4000, 500); } Entity larder = getObjects().closest("Larder"); // Get closest larder if (larder != null && larder.interact("Remove")) { // If exists remove it Sleep.until(() -> !getObjects().closest(f -> f.getPosition().equals(larder.getPosition())).exists(), 400, 500); } RS2Widget remove = getWidgets().getWidgetContainingText("Yes"); if (remove != null && remove.interact()) { Sleep.until(() -> myPlayer().isAnimating(), 4000, 500); } } return 1000; } protected static class Sleep extends ConditionalSleep { private final BooleanSupplier condition; public Sleep(BooleanSupplier condition, int timeout, int interval) { super(timeout, interval); this.condition = condition; } @Override public boolean condition() { return condition.getAsBoolean(); } public static boolean until(final BooleanSupplier condition, int timeout, int interval) { return new Sleep(condition, timeout, interval).sleep(); } } }
  2. RS only loads an area around you of a radius about 50 tiles or so. You can't just load all of the NPCs across the entire game and hope it finds the closest fishing spot to you.
  3. Still deleting messages. I managed to get myself banned again because I was trying to link Explv's open-source Tutorial Island script, trying to help someone. You know. The thing we want to ban people for. https://i.imgur.com/HrRsEyR.png
  4. You're setting yourself up for failure here. You have all of your code in one class, and you're trying to execute your entire script in one loop. Realistically, each 'loop' of the script should be responsible for executing one portion of the script. In your case, you have it potentially executing your entire script. Since your script is relatively simple, you should look at the State-based framework. It's a simple framework that allows you to determine the state the script is in (fish, cook, bank, etc), and execute. The bigger reason why I'm mentioning this and not addressing your direct problem is that you're going to have this problem time and time again until you address your poor architecture. If you don't mind, try implementing something along the lines here Once you've done so, you will probably be able to locate these issues yourself! It's not about avoiding helping you, it's about making you self-sufficient to be a better developer in the future.
  5. AiO main maker. Start the script from tutorial island, let it run for a week straight, come back to 1m in the bank with all 50's and 30QP.
  6. I personally hate video tutorials and actively avoid watching them. Scrolling through an organized wall of text lets me find what I need when I need it, rather than skipping through a video. Do you have transcripts or something you can attach to them, when you get around to it? Good effort though, be glad to at least skip over the finished product.
  7. Unfortunately, you're in the same boat I am. The 4670k/4770k-era CPUs are fucking amazing, to the point where the current gen 9700k isn't all that much worth it. That's your call, but me personally, I'm not upgrading off of my 4670k for awhile. Maybe Zen2 will change that for me. https://cpu.userbenchmark.com/Compare/Intel-Core-i7-4770K-vs-Intel-Core-i7-9700K/1537vs4030 You have to look at your use-case from your computer. If you want to do heavy gaming, here's what I'd do if I were you * Ensure your CPU is OC'd as high as you can get it * Switch off of the 780 SLI into a single 1080 TI or Vega 56 (budget depending) * Get a higher-capacity SSD (think 850 Evo 1TB) (this is optional, but I currently have 3x 128Gb SSDs (thanks, dad) and I'd much rather have a single one) You kind of don't want to touch your ram, because there's no point in buying high-quality RAM for your current mobo (assuming the next mobo you buy won't support ram you upgrade) that will only last a short time until your next processor upgrade. Unfortunately, I can't tell you when is the right time to upgrade your processor.
  8. I was receiving the error earlier as well on my own private script, except it was NPCS.filter, not GroundItems. It seems to have been fixed with a fresh client download? I'm also receiving frequent WebWalking errors on this build, stating "Cycle Threshold reached!" on various locations (mostly common banks).
  9. Do you create new Threads inside of onLoop? If so you'll need probably want to interrupt them by overring the script's onStop method. Alternatively, what you can do is use the script's async event system. I haven't used it personally, but if it's handholdy enough it'll track your Thread references for you and terminate them when the script ends.
  10. Once I actually have something worth showing, I will. I'm a few months away from anything too juicy, but my end-game is to have a twitch channel where people can issue commands for the bot to follow, e.g. !woodcut willow, !combat "Al-kharid warrior", etc, as well as letting it do its own things autonomously. @Explv have you ever worked with GSON on the SDN at all? Or are we pretty much stuck with json-simple?
  11. What type of accounts, what scripts?
×
×
  • Create New...