Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Lambda

GraphScript Framework

Recommended Posts

Looking at the tutorials I didn't notice anyone using a graph-based framework, so I thought that either people hadn't thought of it or at least the newer or less experience programmers weren't aware of using this, so I thought I'd share it. GraphScript is a graph based framework, using a cyclical graph to model the functionality (where each vertex would be the same as a Node or Task from other frameworks) the advantage of this, is that when doing stuff that is rotational such as a skill or simple minigame (I use Wintertodt as an example, something like Hunter would be a fantastic example as well) then it makes sense to use something that more correctly models a human's behavior.

What do I mean by cyclical? Take a look at this flow chart I made for Wintertodt

 

td80EXy.png

 

To breakdown what is happening in the framework, the bottom section is the overlying framework. It decides whether to bank, or go play the minigame. This area also will potentially go into the wait functionality, if the game hasn't started yet but it doesn't need to bank.

 

The top section is a little more interesting, essentially the arrows are ways to traverse between eachother. So for example burn will never traverse back to fletch, fletch will never traverse back to chop. The advantage of this is that everything is self contained, you don't have to write code worrying about messing up the burn in the fletching class, since that'll be in its own section. For these simple cyclical things it makes everything much more self contained and easy to work with.

 

The downside is that you have to be more careful in your coding, if it gets stuck in the chopping class for example, while it's below the door outside of the minigame, the entire script is stuck. Typically it's pretty easy to avoid this happening, it just requires a little extra thought.

 

Here's the source code: https://github.com/Mkerian10/GraphScript

I re-wrote this on my pc so and I haven't ran through it so if anyone sees any issues lmk. Of course you don't (and probably shouldn't) directly copy this framework, but rather use the ideas to implement your own.

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.

Sign in to follow this  

  • Similar Content

    • By Worthy
      Node Framework Tutorial
      by Worthy
       
      What is Node Framework?
      A node based framework breaks actions into different classes.
      Each class extends a Node and has a validate and execute function.
       
      In this tutorial
      I will be writing a basic powerminer to demonstrate the effectiveness of using Nodes.
       
      ________
      Node class:

       
      Validate: if true, will run the execute method.
      Execute: where the action happens
       
      ________
      Second, we will plan and break down the actions we'll be creating.
      In a powerminer, there are really only a couple classes necessary:
      A GUI class (optional) A MineOre class A DropOre class Since this is a basic tutorial, I'm going to skip the GUI class
      And for simplicity's sake, I won't be externalizing any variables (I usually have separate classes for Constants and Variables).
       
      The MineOre class:

       
      ____
      The DropOre class:

       
      ____
      Lastly, the main class, PowerMiner:

       
       
      Tying everything together:
      When the script is initiated we add all the nodes we want into the ArrayList of nodes.
      The script then loops indefinitely, looping through each node in the ArrayList, validating it, and then executing.
       
      The min and max parameters I have set in the loop method, ensure the bot waits at least 20 to 40 milliseconds in between nodes.
       
      _________
      As you can see you can do much much more with a node-based framework, but this tutorial shows the barebone basics.
      For example: if you have an AIO script, you can have the GUI determine which nodes to add to the ArrayList. You can delete nodes to run if an action is completed, etc.
       
      Full script on GitHub: https://github.com/WorthyTRiBot/PowerMiner
       
       
       
      Regards,
      Worthy
    • By fio1313
      hi!!!

      I'm an experienced javascript developer and have recently been working on Angular.  I ran into some trouble creating custom pipes from scratch and from there on the issues became much more complex.

      I found some rich sources that helped me understand the core concepts of Angular 2.

      For example, if you are dealing with pipes or having issues, you may be interested in looking into:
       
      Part 1 https://auth0.com/blog/angular2-series-working-with-pipes
      Part 2 https://auth0.com/blog/angular-2-series-part-2-domain-models-and-dependency-injection
      Part 3 https://auth0.com/blog/angular-2-series-part-3-using-http
       
      In Angular 1.x we can transform requests globally in the application's config.
       
      .config(function($httpProvider) {
       $httpProvider.defaults.transformRequest = function(data) {
         return JSON.stringify({name: "Ryan"});
       }
      });
       
      Whereas in Angular 2, we would extend the base request optiond
      class MyOptions extends BaseRequestOptions {
       body: string = JSON.stringify({name: "Ryan"});
      }
      bootstrap(App, [HTTP_PROVIDERS, provide(RequestOptions, {useClass:MyOptions})]);
       
      I hope this was of some help. All comments and suggestions are welcome!!!
  • Our picks

    • This update features:

      Fixed broken hooks from today's update


      Fix wilderness level with RuneLite (Thanks @Todd)


      Add support for Kotlin .class files in scripts (Thanks @wastedbro)


      Overhaul Inventory API (Thanks @wastedbro)


      Add List support for common methods


      Change method grouping to make more sense (by functionality)


      Refactor methods to utilize Java 8 streams instead of cumbersome loops




      Recognize chatbox minimization (Thanks @JoeDezzy1)


      Fix Screen#isInViewport when NPC chat is open (Thanks @JoeDezzy1)


      Fix login bot bugs (Thanks @erickho123)


      Fix hint arrow return values (Thanks @Encoded)


      Fix depositAllExcept functionality (Thanks @wastedbro)


      Change containing box interface bound and adjust for Y values (Thanks @erickho123)
        • Like
      • 151 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
    • This release will:

      Add new internal framework for capturing exceptions


      Fix issue with not selecting the last column in world hopper (Thanks @Todd)


      Add a message about pin usage in Banking#openBank (Thanks @Todd)


      Disable the firewall by default (Thanks @Todd)


      Fix handling of the welcome screen after login (Thanks @Encoded)


      Fix wrong amount bank withdrawal (Thanks @Encoded)


      Fix Screen#isInViewport


      Fix Game#isInViewport (Thanks @Encoded)


      Call onBreakEnd for ListenerManager Breaking Listeners (Thanks @Encoded)


      Fix Prayer#getPrayerPoints NumberFormatException (Thanks @JoeDezzy1)



      Note: If you are using LG, please restart both the RS client and TRiBot.
        • Thanks
        • Like
      • 28 replies
    • This release will:

      Fix LG for both OSBuddy and RuneLite


      Fix issue where the resizable client isn't able to be made smaller (Thanks @JoeDezzy1)


      Fix detection of the logout game tab when resizable mode and side panels are enabled (Thanks @JoeDezzy1)


      Add initial support for Sentry to allow us to identify and easily debug exceptions happening with all TRiBot users


      Add methods to determine if the bank is actually loaded, and not just the overarching interface (Thanks @wastedbro)



      Upcoming updates:

      Improved CLI support


      Full Sentry support


      Much more
        • Like
      • 64 replies
    • This release will:

      Fix NPE in Camera API (Thanks @wastedbro)


      Update deposit box interface ids (Thanks @Encoded)


      Add various bank methods (Thanks @wastedbro)


      Banking#getWithdrawXQuantity


      Banking#getDefaultWithdrawQuantity


      Banking#arePlaceholdersOn




      Fix resizeable minimap bug (Thanks @wastedbro)


      Remove Java 8 requirement


      Please note: TRiBot is not yet fully compatible with Java 10+




      Fix the break handler issues by ensuring the break handler thread never gets paused


      Fix broken settings hooks



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 68 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...