Coder Social home page Coder Social logo

tribot-web-engine-v2's Introduction

OSRS Web Walker

Summary

This client is written for Tribot and used to navigate throughout OSRS. This is V2 of Tribot's webwalker engine. This is currently in BETA. All paths are generated remotely on a server. This repository contains the client side logic for consuming the paths returned by the server. There should (rarely) be missing mapped areas. Please submit a ticket and this will be mapped whenever possible.

For users coming from V1, this version has improved obstacle and pathing detection locally. The limitation is that this version does not have all the custom handlers of V1, which has been polished and patched over 5 years. I encourage users to feel free and submit code to support any custom area handlers if they happen to implement them. Please check out Adding Area and Custom Handlers

Important for BETA testers

The current state of the repo is very primitive. All generic conditions should mostly be supported, but there are very only a few amount of teleports + custom handlers currently added. If you're planning on adding this to a script that will be using a lot of teleports or custom paths, it is likely you will hit an unsupported path, or that the walker engine will not recognize your teleport.

Features

  • Speed: Extremely fast computation with a worst case of 200ms (not including latency to backends)
  • Server Sided: CPU + memory heavy computations are all done remotely.
  • Short-cuts: Uses shortcuts/obstacles whenever possible while accounting for skill/quest/item requirements
  • Danger Path Weighting: Avoids dangerous areas when low combat level (i.e: dark wizard circle south of Varrock)
  • Teleports: Uses teleports available for your character

Visit Explv to try out Dax Path generation and see if it supports the area you need.

Usage

package scripts;

import org.tribot.api2007.types.RSTile;
import org.tribot.script.Script;
import org.tribot.script.ScriptManifest;
import org.tribot.script.interfaces.Painting;
import scripts.dax.walker.DaxWalker;
import scripts.dax.walker.WebWalker;
import scripts.dax.walker.data.RSBank;
import scripts.dax.walker.engine.Navigator;
import scripts.dax.walker.server.DaxWalkerServerClient;

import java.awt.*;

@ScriptManifest(name = "Walker Test", authors = {"dax"}, category = "Tools")
public class WalkerTest extends Script implements Painting {

    // The reason why we're holding this in an instance variable is so we can enable debug paint
    private DaxWalker walker;

    @Override
    public void run() {
        // Instantiate a server client with your API keys
        DaxWalkerServerClient daxWalkerServerClient = new DaxWalkerServerClient("PUBLIC-KEY", "SECRET-KEY");

        // Create instance of DaxWalker
        walker = new DaxWalker(daxWalkerServerClient, new Navigator());

        // IMPORTANT: In order to use the convenience class 'WebWalker', you MUST initialize the singleton
        WebWalker.setDaxWalker(walker);

        // Walk to a location
        WebWalker.walkTo(new RSTile(1, 2, 3));

        // Walk to a location while actively checking for conditions
        WebWalker.walkTo(new RSTile(1, 2, 3), () -> {
            if (isHpLow()) {
                eatFood();
            }
            if (shouldEnableRunEnergy()) {
                enableRunEnergy();
            }
            if (pkerNearby()) {
                return true; // EXITS the walker and the walkTo() will return false!
            }
            return false;
        });
      
        // Walks to closest bank
        WebWalker.walkToBank();
        
        // Walks to Varrock east bank
        WebWalker.walkToBank(RSBank.VARROCK_EAST);
    }

    @Override
    public void onPaint(Graphics graphics) {
        // Allows for DEBUG paint. This is highly optimized, but will still consume a bit of CPU.
        if (walker != null) walker.onPaint(graphics);
    }
}

API Keys

Please visit https://admin.dax.cloud/ for more information. To use your Api Keys, please configure your Dax API Key provider.

Api Keys

Adding Areas and Custom Handlers

Please refer to Contributor's Guide

tribot-web-engine-v2's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  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.