TheJacob Posted January 27, 2023 Share Posted January 27, 2023 (edited) Hey folks, I'm working on an AI framework for writing Scripts on OSBot. After having recently played around with a decision tree framework and reflection (see this thread), I wanted to try a different approach to scripting and I definitely think this is a winner. My intent is to provide two things: flexibility and simplicity (in regards to maintainability). I will be using a behavior tree model w/ a utility function to write a F2P pking script, so let me know where you think we can improve this framework! Source Download (0.0.31): Git Repo (temporarily down) Changes 0.0.31 - new repository, structural changes, and maven integration (streamlines collaboration). 0.0.21 - merged new framework, implemented a utility function, and removed json integration & chicken killer test script. 0.0.12 - loading decision tree from JSON file. 0.0.1 - initial release Setup Updating setup in accordance with 0.0.31 (TODO). Remarks Updating remarks in accordance with 0.0.31 (TODO). Snippets (v0.0.31) MyScript.java Spoiler // MyScript.java package org.johndoe.myscript; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.script.Script; import org.thejacob.sandbox; @ScriptManifest(name="MyScript",author="John Doe",version=1.0,info="",logo="") public class MyScript extends SandboxScript { @Override public void onStart() { BehaviorTreeFactory factory = getFactory(); factory.inject("hello-world"); BehaviorTree decisions = factory.getInstance("hello-world"); setDecisions(decisions); } @Override public int onLoop() { getActionHandler().process(); return 200; // < 1 game tick (in ms) } @Override public void onGameTick() { getDecisions().tick(); } } Edited February 5, 2023 by TheJacob New upcoming 0.0.31 release. 1 1 Quote Link to comment Share on other sites More sharing options...
TheJacob Posted January 28, 2023 Author Share Posted January 28, 2023 (edited) Follow-up: So, I definitely think this approach (a behavior tree) will be sufficient to create a F2P ranged/2h pking script. That said, release 1.2 will separate actions from decisions before diving into the meat and potatoes of pking. Namely, the behavior tree will be parsed to update the blackboard with a set of game states (read as goals) that the game logic will accomplish -- decisions executed in onLoop and decisions processed in onGameTick. Also, I will provide more flexibility with regards to conditional aborts and parsing a "RUNNING" tree. In release 1.3+, grouping and prioritizing actions for pking (as subtrees) will be the toughest part. It's my intent to have a working pk-ready release within the next 10 days. If anyone has any thoughts on what a model might look like for pking, definitely reach out and give me a shout. As well, it's my first time writing a project in Java, so if there's any bad practices you folks see in the project, let me know. Edited January 28, 2023 by TheJacob Quote Link to comment Share on other sites More sharing options...
TheJacob Posted January 31, 2023 Author Share Posted January 31, 2023 (edited) Follow-up: New release (v1.2) with updated framework. This should be the last time I majorly re-work the framework, much more flexible now. Can @Mio or @Gunman move this thread to Soft Dev/Projects. Thank you! Edited January 31, 2023 by TheJacob Quote Link to comment Share on other sites More sharing options...
TheJacob Posted January 31, 2023 Author Share Posted January 31, 2023 (edited) Follow-up: Utility functions implemented. Next updates will expand on buckets, useful utility decorators, and streamlining the script to a (sense -> decide -> act) model. I expect these to be the last additions to the framework before major work will be put in to writing conditions/actions for f2p hybrid pking. Edited January 31, 2023 by TheJacob Quote Link to comment Share on other sites More sharing options...
TheJacob Posted February 1, 2023 Author Share Posted February 1, 2023 (edited) 20 hours ago, TheJacob said: Follow-up: Utility functions implemented. Next updates will expand on buckets, useful utility decorators, and streamlining the script to a (sense -> decide -> act) model. I expect these to be the last additions to the framework before major work will be put in to writing conditions/actions for f2p hybrid pking. Follow-up: Prior to the aforementioned upcoming tasks, I'm going to provide Javadocs for everything under the framework package. In doing this, I'll likely clean up a bunch of the code as well (or at least streamline it). The "decision" model is essentially complete, maybe adding one or two more decorators or composites here and there. The focus will shift to the "action" model once I've finished documenting everything (the "sense" model is provided by the OSBot API hehe, ty.) Initial Javadocs pushed to Git for Tree, TreeFactory, and Behavior. The remainder will follow. Edited February 1, 2023 by TheJacob 1 Quote Link to comment Share on other sites More sharing options...
TheJacob Posted February 2, 2023 Author Share Posted February 2, 2023 Follow-up: Finished providing Javadocs for everything under the framework package and discovered & fixed a bug with Active Selector's implementation (see issue#2). Started working on action model of the framework. Quote Link to comment Share on other sites More sharing options...
TheJacob Posted February 5, 2023 Author Share Posted February 5, 2023 (edited) Follow-up: Repository will be down over the next day or two. I'm changing the project name and integrating Maven in the development process. Moreover, I'm working with some collaborators that are focused on pushing a proof of concept script with the first stable release of the framework. The repository layout will be changing as well to reflect this. This project will be open source (no change). Edited February 5, 2023 by TheJacob Quote Link to comment Share on other sites More sharing options...