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.

Obfuscating your local scripts

Featured Replies

As some people do not know how to do this, and it is useful to prevent people stealing your code, here is how to obfuscate (https://en.wikipedia.org/wiki/Obfuscation) using ProGuard.

 

If you don't know what Obfuscation looks like, here is an example of one of my classes, post obfuscation:

 

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.osbot.rs07.api.Bank;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.utility.ConditionalSleep;

public final class a
extends g {
    private final List b;
    private final ConditionalSleep c;

    public a(Combiner combiner, List list) {
        super(combiner);
        this.c = new b(this, 5000);
        this.b = list;
    }

    @Override
    public final boolean a() {
        for (c c2 : this.b) {
            if (!c2.d()) continue;
            return false;
        }
        return true;
    }

    @Override
    public final void b() {
        if (this.a.getBank() != null) {
            if (!this.a.getBank().isOpen()) {
                a a2 = this;
                try {
                    a2.a.getBank().open();
                    a2.c.sleep();
                }
                catch (InterruptedException var4_3) {
                    a2.a.log((Object)var4_3);
                    return;
                }
            }
            Object object = this.b.iterator();
            while (object.hasNext()) {
                a a3;
                f[] arrf;
                f[] arrf2;
                boolean bl;
                block12 : {
                    boolean bl2;
                    block11 : {
                        arrf2 = arrf = (f[])object.next();
                        a3 = this;
                        for (f f2 : arrf2.c()) {
                            if (a3.a.getBank().contains(new String[]{f2.a})) continue;
                            bl2 = false;
                            break block11;
                        }
                        bl2 = true;
                    }
                    if (!bl2) continue;
                    arrf2 = arrf;
                    a3 = this;
                    arrf = arrf2;
                    object = a3;
                    arrf = a.a((c)arrf);
                    Filter[] arrfilter = new Filter[1];
                    arrfilter[0] = arg_0 -> a.b((List)arrf, arg_0);
                    if (object.a.getInventory().contains(arrfilter)) {
                        arrf = arrf2;
                        object = a3;
                        arrf = a.a((c)arrf);
                        Filter[] arrfilter2 = new Filter[1];
                        arrfilter2[0] = arg_0 -> a.a((List)arrf, arg_0);
                        object.a.getBank().depositAllExcept(arrfilter2);
                        return;
                    }
                    arrf = arrf2;
                    object = a3;
                    for (f f2 : arrf.c()) {
                        if (object.a.getInventory().getAmount(new String[]{f2.a}) <= (long)f2.b) continue;
                        bl = true;
                        break block12;
                    }
                    bl = false;
                }
                if (bl) {
                    arrf = arrf2;
                    object = a3;
                    for (f f2 : arrf.c()) {
                        if (object.a.getInventory().getAmount(new String[]{f2.a}) <= (long)f2.b) continue;
                        object.a.getBank().deposit(f2.a, (int)object.a.getInventory().getAmount(new String[]{f2.a}) - f2.b);
                    }
                    return;
                }
                for (f f2 : arrf2.c()) {
                    if (a3.a.getInventory().contains(new String[]{f2.a})) continue;
                    a3.a.getBank().withdraw(f2.a, f2.b);
                }
                return;
            }
            this.a.log("Ran out of ingredients, stopping script.");
            this.a.stop(true);
        }
    }

    private static List a(c c2) {
        return Arrays.stream(c2.c()).map(f2 -> f2.a).collect(Collectors.toList());
    }

    private static /* synthetic */ boolean a(List list, Item item) {
        return list.contains(item.getName());
    }

    private static /* synthetic */ boolean b(List list, Item item) {
        if (!list.contains(item.getName())) {
            return true;
        }
        return false;
    }
} 

 

1. Download and extract proguard http://sourceforge.net/projects/proguard/files/

 

2. Create a folder anywhere called "proguard_configs", this is where you will store your configuration files to be used with ProGuard.

 

3. In the proguard_configs folder, create a new empty proguard config file (.pro) in notepad.

 

4. Define your configuration, here is the configuration I use for my scripts:

-injars       C:\Users\Username\OSBot\Scripts\script.jar 
-outjars      C:\Users\Username\Obfuscated\script_obf.jar 
-libraryjars  C:\Users\USername\Downloads\OSBot 2.4.29.jar 
-libraryjars  C:\Program Files\Java\jre1.8.0_66\lib\rt.jar

-keepattributes *Annotation*

-keep public class package.Main
  • -injars is file path to the script .jar to be obfuscated

  • -outjars is the file path to the obfuscated script .jar

  • -libraryjars are the OSBot.jar and the Java runtime rt.jar

  • -keepattributes *Annotation* ensures that we keep the @ScriptManifest annotation

  • Finally we specifiy that we want to keep the main Script class, as we need this as the entry point to our script.

  • You should replace "package.Main" with the package that your script is in, and the name of your main script file

 

5. Finally run the following command in cmd / terminal, replacing path_to_proguard with the path to proguard.jar, which is found in the proguard\lib folder, and path_to_config with the path to the .pro file you previously made:

java -jar path_to_proguard.jar @path_to_config.pro

6. Note if you get warnings about missing classes, that are not classes you have defined, add to you config the line, replacing javafx with the package name:

-dontwarn javafx.**

Edited by Explv

  • Author

Just didnt feel this was a necessary guide lol

 

Maybe not for you, but some people asked me to make it, and some people don't know how to do it :doge:

Just didnt feel this was a necessary guide lol

 

hey man we arent all scripter III like you!!!!!!!!!!!!!!!!!!!

Nice tut,. I tried it and got the "Processing completed successfully" message but my script wont show up in the client..Any ideas?

 
  • Author

Nice tut,. I tried it and got the "Processing completed successfully" message but my script wont show up in the client..Any ideas?

 

Missed a line out:

 

-keepattributes *Annotation*

 

Which is essential, because you need to keep the @ScriptManifest annotation.

 

I have edited the config.

Missed a line out:

 

-keepattributes *Annotation*

 

Which is essential, because you need to keep the @ScriptManifest annotation.

 

I have edited the config.

 

Bingo! Thanks Explv

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.