Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold
XmQ

Picking up your own groundloot [SEMI-SNIPPET]

Recommended Posts

Today I saw a few videos from Sirpugger, a youtuber who is trying to break scripts / bots. I was kind of suprised there are still bots that break or start doing weird when people drop certain items that are on the pickup-list.

package scripts.priv.scripts.npclooter;

import org.tribot.api2007.types.RSCharacter;
import org.tribot.api2007.types.RSTile;
import org.tribot.script.ScriptManifest;
import org.tribot.script.interfaces.Painting;
import scripts.priv.psvxe.api.types.Npc;
import scripts.priv.psvxe.framework.listeners.npclistener.NpcEvent;
import scripts.priv.psvxe.framework.listeners.npclistener.NpcListener;
import scripts.priv.psvxe.framework.script.AbstractScript;

import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

@ScriptManifest(name = "Npc lootTester", category = "Testing", version = 0.0, description = "Test,", authors = "XmQ")
public class Manager extends AbstractScript implements Painting, NpcListener {

    Map<Integer, RSTile> npcList = new HashMap<>();
    ArrayList<RSTile> lootingTiles = new ArrayList<>();


    @Override
    public void onStart() {
        super.onStart();
    }

    @Override
    public int onLoop() {
       try {
            for (RSTile tile : lootingTiles) {
                if (tile != null) {
                    if (me().getPosition().equals(tile)) {
                        lootingTiles.remove(tile);
                    }
                }
            }
        } catch (Exception e){
           println("No tiles left!");
       }
        RSCharacter character = me().getInteractingCharacter();
        if(character != null) {
        if(character.isInteractingWithMe() && me().isInCombat()) {
            if (!npcList.containsKey(character.getIndex())) {
                npcList.put(character.getIndex(), character.getPosition());
            } else {
                if(npcList.containsKey(character.getIndex()) && character.getPosition() != npcList.get(character.getIndex()).getPosition()){
                    npcList.replace(character.getIndex(), character.getPosition());
                }
            }

        }
        }
        return 40;
    }

    @Override
    public void onPaint(Graphics g) {
        gfx.setGraphics(g);
        for(RSTile tile : lootingTiles) {
            if(tile != null){
                g.setColor(Color.green);
                gfx.drawTile(tile);
            }
        }
    }

    @Override
    public void onNpcEvent(NpcEvent event, Npc npc) {
        switch (event){
            case NPC_SPAWNED:

                break;

            case NPC_DESPAWNED:
                    if(npcList.containsKey(npc.getIndex())){
                        if(!lootingTiles.contains(npc.getPosition())){
                            lootingTiles.add(npc.getPosition());
                            npcList.remove(npc.getIndex());
                        }
                    }
                break;
        }

    }
}

 

I made a NPC listener, it tracks if a npc is despawned or has spawned. It wont be that hard to make something like that for yourself. If people really need it I could release that  as a seperate snippet.

 

This is how it works:

  1. If we are in combat and a npc is interacting with us we will add this npc to the npclist. (name and index of the npc) 
  2. If the position from the npc changes the script will be replace it with the current (and latest) position.
  3. If the npc dies it will add the despawned position to the lootingtiles List.
  4. The painting interface will add some jucy colors to the tiles where our loot is.
  5. If the players stand on a tile from the lootingtiles it will be removed from the lootingtiles
     

Use case could be that if there is a Grimy Ranarr on the ground, with a distance more than 2 tiles away from you, this Grimy Ranner will be ingored since it isn't on a tile where our loot could be.

The code could be a lot better and it doesn't track if the loot is dropped directly after the npc despawns but that could be done with a simple timer.

What I am trying to show here is that we can break the behaviour of picking up loot that isn't ours to make the bot more humanlike.

 

Thanks for reading, cheers!

Edited by XmQ

Share this post


Link to post
Share on other sites
3 hours ago, FieryWaterWS said:

But... wouldn't a human pick up that loot even if it wasn't theres also?

No, it won't. It will pickup items in their close proximity but anything outside a few tiles would be hard to see and won't be noticed, directly. 

Scripts are doing stupid shit with looting. This is a way to make it less stupid. 

Share this post


Link to post
Share on other sites
10 hours ago, XmQ said:

No, it won't. It will pickup items in their close proximity but anything outside a few tiles would be hard to see and won't be noticed, directly. 

Scripts are doing stupid shit with looting. This is a way to make it less stupid. 

Maybe just a delay would be better? What he said isn't necessarily true because most RS players use Runelite where the value shows up and would make the loot immediately noticeable.

Share this post


Link to post
Share on other sites
4 hours ago, FieryWaterWS said:

Maybe just a delay would be better? What he said isn't necessarily true because most RS players use Runelite where the value shows up and would make the loot immediately noticeable.

I don't think a delay would solve the issue. I am going to make a fully working loot snippet. Keeping track of lurers etc. Fun project I think!

Share this post


Link to post
Share on other sites

The inherent complexity of adding all of these extreme edge cases this youtuber comes up with isn't worth it typically.

This snippet being a great example, as from the looks of it, in itself has the potential to throw a ConcurrentModificationException.

I just viewed one of his videos for the first time yesterday in which he camped outside of a house portal for hours to get bots in a PVP world.

So that particular bot may be on alert for the next month, as the next Joe Smoe attempts to make a follow up youtube video where they

camp outside the same portal for an exorbitant amount of time, in which they end up reaping a few bot kills for the equivalent of $10 USD.

All while the botters have 3x + that in the time frame.

 

While I watched the video, he did bring up one scenario that was interesting.

The fact that when walking to a location, a bot typically is sleeping or deferring execution to the client. 

I've rarely see code to change logic mid walking for such an event, based solely off of what I said earlier.

Most bots have issues running even a happy path scenario now a days, especially post release many degenerating to an

unusable state increasingly fast (most not even working properly on initial release). Especially free or low budget code.

Warfront1

 

Share this post


Link to post
Share on other sites
13 hours ago, warfront1 said:

The inherent complexity of adding all of these extreme edge cases this youtuber comes up with isn't worth it typically.

This snippet being a great example, as from the looks of it, in itself has the potential to throw a ConcurrentModificationException.

I just viewed one of his videos for the first time yesterday in which he camped outside of a house portal for hours to get bots in a PVP world.

So that particular bot may be on alert for the next month, as the next Joe Smoe attempts to make a follow up youtube video where they

camp outside the same portal for an exorbitant amount of time, in which they end up reaping a few bot kills for the equivalent of $10 USD.

All while the botters have 3x + that in the time frame.

 

While I watched the video, he did bring up one scenario that was interesting.

The fact that when walking to a location, a bot typically is sleeping or deferring execution to the client. 

I've rarely see code to change logic mid walking for such an event, based solely off of what I said earlier.

Most bots have issues running even a happy path scenario now a days, especially post release many degenerating to an

unusable state increasingly fast (most not even working properly on initial release). Especially free or low budget code.

Warfront1

 

Mostly I agree with you. I am not quite sure though if you saw the wilderness emblem farmer script. 

It seems to me a lot of scripts could be programmed way more logical. 

It really isn't that hard to break conditions mid walking if done properly. You could write a listener to listen for players, if players are found and it's in a certain condition then break walking and do something different. (as example) 

Of course it's a edge case and most simple scripts don't need it, however, I may expect scripts that are used by big farms have something to win by this. It's one thing they lose items but it's another if the account gets banned of stupid shit like in the videos

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Our picks

    • Over the past few months, I’ve been working diligently on a new project - TRiBot X. Everything has been written from the ground up, with all of the best practices of software engineering. Every aspect of TRiBot has been re-imagined to support three main goals: flexibility, useability, and reliability.
        • Like
      • 31 replies
    • Come give us feedback on the next version of TRiBot!
        • Thanks
        • Like
      • 74 replies
    • TRiBot is looking to improve a lot of its customer relationship management, customer on boarding process, customer experience, design elements, community engagement and pretty much everything else you can imagine when it comes to marketing.

      Our goal: To ensure that the marketing done TRULY reflects the experience and does not shine an inaccurate light on what TRiBot is lacking in.

      So I ask, what do you love about TRiBot and what do you hate about TRiBot? What does O S Bot, Rune M8, PowR Bot and Dre amBot do better? (yes I purposely didn't spell it right 😂).

      Love, 

      RileyZ
        • Like
      • 23 replies
    • Over the last three weeks, I've been working on upgrading our server infrastructure. It's finally ready and is now live!

      Why?

      Increased reliability - less server errors


      Increased availability - less downtime


      Increased security - keeping us and you secure


      Increased capacity - ability to serve you better


      Increased speed - less waiting for things to load


      Faster development - server and service updates will come faster


      What are the changes?

      Move from a single AWS EC2 instance to AWS ECS (Elastic Container Service)


      Distributed computing


      Load balancing


      Git management of server files and filesystem


      Redis caching


      How?

      AWS ECS (with 10 EC2 instances)


      AWS ElastiCache (Redis)


      AWS Load Balancing


      AWS EFS (Elastic file system)


      Please bare with us as I continue to tune the server for maximum performance. Slow loading speeds may occur temporarily. I thank everyone for their patience.

      Please post on this thread if you experience any issues other than slow loading times.
        • Like
      • 51 replies
    • This release will:

      Fix prayers and world hopper API (Thanks @JoeDezzy1 and @erickho123)


      Improve banking API (Thanks @Encoded)


      Adds methods for returning and using Java Lists, rather than arrays


      Slightly randomizes some hardcoded behaviour


      Removes sleeps from waitConditions; the efficiency saving potential is negligible in these use-cases, therefore cleaner code is preferable


      Other back-end improvements





      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Sad
        • Haha
        • Thanks
        • Like
      • 90 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...