Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Memory leak

Featured Replies

There's a memory leak in this script, but can't find it. 

    boolean isSplashing;
    long magicxp;

    private Predicate<NPC> suitableNPC = n ->
            getMap().canReach(n) &&
                    n.getHealthPercent() > 0 &&
                    n.hasAction("Attack") &&
                    !n.isUnderAttack() &&
                    getMap().realDistance(n) < 15;

    

public int onLoop() throws InterruptedException {
        isSplashing = true;
        magicxp = getSkills().getExperience(Skill.MAGIC);
        sleep(random(3600,4800));
        if (magicxp == getSkills().getExperience(Skill.MAGIC)) {
            isSplashing = false;
        }
        if (!myPlayer().isUnderAttack() || !isSplashing) {
            if (getInventory().contains("Air rune") && getInventory().contains("Mind rune") && getInventory().contains("Fire rune")) {
                java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList());
                if (!npcs.isEmpty()) {
                    npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b)));
                    if (npcs.get(0).interact("Attack")) {
                        sleep(random(3000));
                    }
                }
                sleep(random(3000,4000));
            } else {
                stop();
            }
        }
        return random(300,400);
    }

Threw some stuff around to see if something changed. In like 4-5 hours the memory usage went from 600MB to 1.2GB.

why do you have complex checks for splashing if all you really need is

  • check closest npc
  • check if not interacting
  • autocast splash spell
  • type in clan chat 3-5 mins

might be the checks idk for sure

Im having the same issue using a script @Shudsy made for me. I thought it was the script aswell but it could be a client issue if more than a few people are having this problem

39 minutes ago, toogsi said:

Im having the same issue using a script @Shudsy made for me. I thought it was the script aswell but it could be a client issue if more than a few people are having this problem

Your script had a massive CPU usage because you got a NPE. 

  • Author
1 hour ago, raijin said:

why do you have complex checks for splashing if all you really need is

  • check closest npc
  • check if not interacting
  • autocast splash spell
  • type in clan chat 3-5 mins

might be the checks idk for sure

What is complex in your eyes?

1 minute ago, The Undefeated said:

What is complex in your eyes?

nothing really just dont think you need a list for 1 target

 private Predicate<NPC> suitableNPC = n ->
            getMap().canReach(n) &&
                    n.getHealthPercent() > 0 &&
                    n.hasAction("Attack") &&
                    !n.isUnderAttack() &&
                    getMap().realDistance(n) < 15;
 java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList());
                if (!npcs.isEmpty()) {
                    npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b)));

 

  • Author
4 minutes ago, raijin said:

nothing really just dont think you need a list for 1 target


 private Predicate<NPC> suitableNPC = n ->
            getMap().canReach(n) &&
                    n.getHealthPercent() > 0 &&
                    n.hasAction("Attack") &&
                    !n.isUnderAttack() &&
                    getMap().realDistance(n) < 15;

 java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList());
                if (!npcs.isEmpty()) {
                    npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b)));

 

Oh yeah, copied it from Macro killer, just because I was that lazy. But still doesn't fix the memory leak..

 

Edited by The Undefeated

6 hours ago, The Undefeated said:

Thanks to @Bamboozled for solving my problem. I had no sound drivers installed on my server, turned off the sound and it was fixed.

wtf LOL. 

Was it really fucking sound drivers LOL.

 

 

Just now, Phaibooty said:

wtf LOL. 

Was it really fucking sound drivers LOL.

 

 

I mean i can just see tens of thousands of error logs piling up in memory from rs constantly sending sounds

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.