Jump to content

sobot

Members
  • Posts

    7
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

sobot's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. It seems that the issue with was with the initialisation of the patches in some way, still not sure how, but I simply made it so the patch gets initialised every iteration of the interaction loop and you can see it get stuck after picking the patch, but then its initialised again and it works. Since its not a heavy function I guess I'm fine with that. Thanks for the help
  2. After further testing it still doesn't seem to work so I'll just have to create my own interaction event like Khaleesi suggested
  3. It seems just using the default interaction worked, I've only tested it once at the moment though. Thanks for your help guys! Really appreciate it! I didn't realise there was a default action, that's what I get for not reading the docs fully
  4. There isn't really much going on here, but here are the relevant bits. This bit is for getting the patches state. public State getState() { if (patch == null) { state = State.NOT_INITIALISED; } else if (patch.hasAction("Harvest") || patch.hasAction("Pick")) { state = State.READY_TO_HARVEST; isFertilised = false; } else if (patch.hasAction("Clear")) { state = State.DEAD; } else if (patch.hasAction("Rake")) { state = State.OVERGROWN; } else if (Arrays.stream(patchNames).anyMatch(p -> p.equals(patch.getName()))) { state = State.EMPTY; } else { state = State.GROWING; } return state; } This bit is responsible for planting the seed, I realise that I could store the state in a variable and not call the function unnecessarily, which I did before and then changed it to this while trying to find this issue, thought maybe that would help. if (getState() == State.EMPTY) { inventory.interact("Use", seed); Sleep.until(() -> inventory.isItemSelected() && inventory.getSelectedItemName().equals(seed), 3000); patch.interact("Use"); // <----- hos flower patch issue is somewhere here Sleep.until(() -> getState() == State.GROWING, 10000); } Function that initialises the patches from an area. public void initPatch() { if (getState() == State.NOT_INITIALISED) { Filter<RS2Object> filter = new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return location.contains(obj) && Arrays.stream(patchIDs).anyMatch(id -> id == obj.getId()); } }; patch = api.getObjects().closest(filter); } } I am pretty certain that it is not an issue with the initialisation of the patches or getting the wrong state. I logged the patch data in the seed function and its definitely there, not to mention that the bot clears, rakes and picks the limpwurts too, just doesn't plant or use compost. Any insight would be appreciated!
  5. Hi, I'm trying to make a farming script and it works pretty well so far aside from the fact that sometimes the bot just doesn't interact with the flower patch in Hosidius. When the bot gets there it initialises the patches and gives them a state, it clears it, selects the seed and then just doesn't interact with the patch, it just gets stuck standing there with the seed selected and adjusting the camera angle every so often. It doesn't seem to be any issue with the state or the initialisation of the object and other patches seem to work fine, even the patch I mentioned seems to work 50% of the time, so it's very strange and I cannot seem to debug this issue. I was wondering if anyone has had any similar experiences or might know why this happens? Thanks
×
×
  • Create New...