GithubHelp home page GithubHelp logo

t3ap0t / osrs-gamepack-downloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from runetech/osrs-gamepack-downloader

0.0 1.0 0.0 93 KB

Simple tool for downloading the official OldSchool RuneScape gamepack

License: Do What The F*ck You Want To Public License

Kotlin 100.00%

osrs-gamepack-downloader's Introduction

OSRS Gamepack Downloader

Actions Status Codacy BadgeLicense: WTFPL

Simple OldSchool RuneScape gamepack downloader written in Kotlin. A collection of downloaded gamepacks can be found here.

What does this program do?

  • Downloads and parses the official OldSchool jav_config.ws to get the gamepack URL.
  • Downloads the gamepack from the parsed URL (codebase + initial_jar)
  • Analyzes the gamepack's bytecode to determine the actual revision.
  • Writes the gamepack to the provided (or current) directory.
  • Fixes the dates (created, modified, accessed) to reflect when the gamepack was built.

Prerequisites

  • Java SE 8 or higher, available here.

Building

Use the included gradlew (Linux/OSX) or gradlew.bat (Windows) files to let gradle build the file.

./gradlew build

The executable will be located at build/libs/osrs-gamepack-downloader.jar.

Library Usage

You can add a binary as a library for your project and use the methods to download/load/verify gamepacks.

Java

To download the latest gamepack and load it into a class map (HashMap<String, ClassNode>), modify it and then save it:

import dev.mahabal.runetech.Gamepack;
import dev.mahabal.runetech.JavConfig;
import dev.mahabal.runetech.RemoteGamepack;
import org.objectweb.asm.tree.ClassNode;

import java.nio.file.Paths;
import java.util.HashMap;

public class Application {

    public static void main(String[] args) {
        // download and load the latest gamepack
        final Gamepack gamepack = new RemoteGamepack(new JavConfig().getProperties());
        // print out the gamepack revision
        System.out.printf("Gamepack Revision: %,d%n", gamepack.getRevision());
        // convert gamepack to a class map
        final HashMap<String, ClassNode> classMap = gamepack.getClassMap();
        // iterate the class map
        classMap.forEach((name, node) -> {
            // do something to the gamepack
        });
        // write the gamepack (with changes) to the desired file.
        gamepack.dump(Paths.get("./"), "osrs-${revision}.jar");
    }

}

Standalone Usage

Double clicking the osrs-gamepack-downloader.jar file will download the latest gamepack to the same directory and name it accordingly.

CLI

java -jar osrs-gamepack-downloader.jar [OPTIONS]
[OPTIONS]

    -r. --revision
        prints out the current gamepack revision to the console

    -d, --directory
        the EXACT output directory to save the gamepack. [default = "./"]

    -f, --file-name
        the format for the gamepack's name. [default = "osrs-${revision}.jar"]

    -p, --properties
        prints the contents of the jav_config.ws file to stdout

    --dry-run
        skip writing the gamepack to the filesystem

Examples

To just print out the current gamepack revision:

java -jar osrs-gamepack-downloader -r --dry-run

Contact

Discord: Matthew#0001

osrs-gamepack-downloader's People

Contributors

mahabal avatar rsbmatt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.