When designing the XAPI framework, I wanted to solve several problems I kept seeing in bot development:
-
Scripts Were Hard to Maintain
- Everyone had their own way of structuring code
- Taking over someone else's script was a nightmare
- Debugging was more guesswork than science
-
Development Was Inefficient
- Lots of copy-pasted code between scripts
- Common patterns were reimplemented differently
- No standard way to handle common bot scenarios
-
Quality Was Inconsistent
- Some scripts were rock solid, others fragile
- Error handling was often an afterthought
- Testing was difficult and often skipped
I built PermissiveScript as a tree-based system because it maps perfectly to how bots actually work - they're just decision trees. Every tick, we're asking:
- Should I bank?
- Should I eat?
- Can I mine this rock?
- Is my inventory full?
The tree structure handles this naturally:
Root
├── Should Bank?
│ ├── Yes → Run Banking Logic
│ └── No → Continue
├── Should Eat?
│ ├── Yes → Eat Food
│ └── No → Continue
└── Main Activity
-
TreeNode System
- Base class that handles all the traversal logic
- Clean separation between decision-making and actions
- Built-in tracking of what decisions were made
-
Branch & Leaf Pattern
- Branches handle the decision-making
- Leaves do the actual work
- Super clear what each piece of code does
-
Permissive & Interlock
- Groups conditions together logically
- Makes complex decision-making readable
- Easy to debug when things go wrong
Right now debugging is better than it was, but I want it to be incredible:
- Visual representation of the decision tree in real-time
- 3D overlays showing exactly what the bot is targeting
- Ability to replay a bug report exactly as it happened
I want to enable scripts to work together seamlessly:
- Scripts report what items they can produce
- Scheduler can chain scripts together automatically
- Example: User wants 1000 magic longbows
- WoodcuttingScript gets the logs
- FletchingScript makes the bows
- All coordinated automatically
We're sitting on a goldmine of data that could make our scripts smarter:
- Hoover integration for GE prices and trades
- Track all drops and XP gains
- Build heatmaps of player activity
- Know which drops belong to which player (huge for ironmen)
I want our UIs to look as good as modern web apps:
- Consistent, beautiful design across all scripts
- Smooth animations and transitions
- Professional feel that matches our technical quality
- (Thinking of having Akisame lead this)
Make it easier for community devs to build great scripts:
- Automated testing of community scripts
- Security scanning to protect users
- Better compilation error feedback
- Automated updates from GitHub to SDN
Give users better insight into their bots:
- Discord integration for status updates
- Real-time performance metrics
- Multi-account overview
- Alerts for important events
-
For Users
- More reliable scripts
- Better looking UIs
- Smarter automation
- More transparency into what's happening
-
For Developers
- Easier to build complex scripts
- Better tools for debugging
- Clear standards to follow
- More automated testing
-
For Us
- Easier to maintain scripts
- Better user satisfaction
- More professional product
- Stronger community involvement
-
Team Support
- UI/UX specialist (thinking Akisame)
- Current dev team time allocation
- Community manager involvement
-
Infrastructure
- Some additional CI/CD setup
- Testing environments
- Monitoring systems
- Lock down PermissiveScript as our standard
- Start basic UI improvements
- Begin work on debugging tools
- Hoover integration
- Initial script orchestration
- Community CI/CD pipeline
- Full visual debugging
- Complete AIO system
- Advanced analytics
-
Technical
- Some features need game client changes
- Performance impact needs careful monitoring
- Security is critical with community scripts
-
Community
- Need to convince devs to adopt standards
- Training and documentation needed
- Migration of existing scripts
Let me know what parts you want me to prioritize or if you see any major issues I've missed.
The XAPI framework represents our next-generation bot development platform, designed to standardize and streamline our script development process. This document outlines our current architecture, planned improvements, and strategic initiatives to enhance our competitive advantage in the market.
Our flagship architecture, PermissiveScript, provides a robust foundation for script development with several key business advantages:
-
Reduced Development Time
- Standardized components reduce boilerplate code
- Reusable modules across different scripts
- Clear patterns for rapid development
-
Enhanced Maintainability
- Tree-based structure for predictable behavior
- Clear separation of concerns
- Standardized error handling
-
Quality Assurance
- Built-in validation tracking
- Comprehensive debugging capabilities
- Structured testing approach
-
Team Scalability
- Reduced onboarding time for new developers
- Consistent development patterns
- Shared best practices
- Business Value: Enhanced market analysis and trading capabilities
- Features:
- Real-time GE transaction tracking
- Comprehensive drop monitoring
- Player trade analysis
- Activity heatmaps for optimization
- Impact: Better informed pricing strategies and market predictions
- Business Value: Enable true AIO (All-In-One) capabilities
- Features:
- Automated resource chain management
- Cross-script coordination
- Production capability reporting
- Impact: Higher value proposition for customers through integrated solutions
- Business Value: Reduced support costs and improved customer satisfaction
- Features:
- Visual debugging system
- 3D space visualization
- Real-time performance monitoring
- Impact: Faster issue resolution and improved script reliability
- Business Value: Improved bug tracking and script maintenance
- Features:
- Node tree serialization
- Bug replay capabilities
- State reconstruction
- Impact: Reduced maintenance costs and improved customer support
- Business Value: Enhanced product perception and user satisfaction
- Features:
- Web-quality UI standards
- Consistent design language
- Professional look and feel
- Impact: Increased user retention and market competitiveness
- Business Value: Improved community engagement and script quality
- Features:
- Automated CI/CD pipeline
- Security scanning
- Quality assurance automation
- Impact: Reduced maintenance overhead and improved community trust
- Business Value: Enhanced user engagement and support
- Features:
- Real-time activity monitoring
- Performance analytics
- Multi-account oversight
- Impact: Improved user satisfaction and reduced support overhead
- PermissiveScript standardization
- Basic UI/UX improvements
- Initial debugging tools
- Grand Exchange integration
- Script orchestration foundation
- Community CI/CD pipeline
- Advanced visualization tools
- Complete AIO capabilities
- Comprehensive analytics system
- Lead Architect (Existing)
- UI/UX Specialist (Potential new hire - Akisame?)
- Backend Developers (Existing team)
- Community Manager (Existing)
- Existing development environment
- Additional CI/CD infrastructure
- Testing environments
- Integration complexity with existing systems
- Performance impact of new features
- Security considerations for community scripts
- Phased implementation approach
- Comprehensive testing protocol
- Security-first development practices
- Script development time reduction
- Bug report resolution time
- System performance metrics
- User satisfaction ratings
- Script adoption rates
- Support ticket volume
- Community engagement levels
-
Immediate Actions
- Formalize PermissiveScript as standard
- Begin UI/UX improvement planning
- Initiate debugging tools development
-
Required Decisions
- Resource allocation approval
- Priority confirmation
- Timeline validation
-
Key Stakeholder Input Needed
- UI/UX direction
- Community incentive structure
- Feature prioritization
The XAPI package is a comprehensive framework for developing RuneScape scripts and bots, with a focus on maintainability, structure, and developer experience. At its core is the PermissiveScript architecture, which provides a powerful and flexible way to organize bot logic through a tree-based task management system.
The PermissiveScript system is the recommended architecture for BotWithUs script development. It uses a tree-based structure to manage bot behavior and state.
- Base class for all nodes in the behavior tree
- Provides core traversal and execution logic
- Supports descriptive naming and validation tracking
- Methods:
execute()
: Performs the node's actionvalidate()
: Determines execution pathsuccessNode()
: Next node on successfailureNode()
: Next node on failuretraverse()
: Handles tree navigation
- Non-leaf decision nodes
- Uses Interlocks for conditional logic
- Supports both static and dynamic node resolution
- Flexible constructor options for various use cases
- Terminal nodes that perform actions
- Supports both Callable and Runnable implementations
- Includes validation tracking
- Can contain game interaction logic
- Specialized LeafNode for game interactions
- Supports target selection
- Handles option-based interactions
- Includes success callbacks
- Basic conditional unit
- Contains:
- Name: Identifier
- Predicate: Boolean supplier
- Result tracking
- Groups multiple Permissive conditions
- Requires all conditions to be true
- Tracks first failing condition
- Used in Branch nodes for decision making
- Base class extending PermissiveScript
- Provides:
- State management
- Graphics context
- Statistics tracking
- Timing utilities
-
State Organization
- Separate states for different activities
- Clear naming conventions
- Focused state responsibilities
-
Node Structure
- Use Branches for decision points
- LeafNodes for atomic actions
- InteractiveLeaf for game interactions
-
Condition Management
- Group related conditions in Interlocks
- Keep conditions atomic and focused
- Meaningful naming
-
Error Handling
- Implement proper error handling
- Use appropriate failure paths
- Track and log condition results
- Direct integration with Hoover for:
- GE transactions
- Mob and boss drops
- Skilling XP tracking
- Item conversions
- Player trades
- Player coordinate tracking for heatmaps
- Serialization of node trees
- Support for bug report replay
- Integration with OpenGL backbuffer screenshots
- State reconstruction capabilities
- Script production reporting system
- Define item production capabilities
- Integration with site Scheduler
- Support for AIO operations
- Example: Gold bar production chain
- MineWithUs for ore
- SmithWithUs for smelting
- GroundItem ownership detection
- Packet-based implementation
- Ironman mode support
- Drop tracking improvements
- PermissiveScript as official architecture
- Optional but recommended
- Potential incentive system
- Improved script maintenance
- Better community support
- ImGui Official Script Standards
- Web-dev quality UI
- Consistent design language
- Enhanced user experience
- Dedicated front-end development
- CI/CD Pipeline for Community Scripts
- Automated repository management
- Security vulnerability scanning
- Compilation verification
- Automated SDN updates
- User notification system
- Visual Debugging System
- 3D space object highlighting
- Tile overlays
- Minimap integration
- Development debugging tools
- Discord Integration
- 5-minute activity summaries
- Per-account statistics
- XP/hr tracking
- Kill/hr monitoring
- Multi-account overview
- Clear separation of concerns
- Predictable behavior flow
- Easy to maintain and modify
- Reduced cognitive load
- Support for complex decision trees
- Easy state management
- Conditional branching
- Dynamic node resolution
- Clear execution paths
- Built-in validation tracking
- Easy to trace issues
- Support for logging and monitoring
- Standardized approach
- Easier script handover
- Shared best practices
- Reduced learning curve
- Extensible architecture
- Support for new features
- Easy integration points
- Scalable design
@Info(name = "Example Script", description = "Example Script", author = "Author", version = "1.0")
public class ExampleScript extends BwuScript {
public ExampleScript() {
super(
new StateOne("State One", this),
new StateTwo("State Two", this)
);
}
@Override
public Branch getRootNode() {
return currentState.getRootNode();
}
}
public class ExampleState extends State {
private final Branch rootNode;
public ExampleState(String name, Script script) {
super(name, script);
// Create leaf nodes
LeafNode actionNode = new LeafNode(script, "Action", () -> {
// Action logic
return true;
});
// Create conditions
Permissive condition = new Permissive("Condition", () -> {
// Condition logic
return true;
});
// Create branch
rootNode = new Branch(script, "Root",
actionNode,
idleNode,
new Interlock("MainInterlock", condition)
);
}
@Override
public Branch getRootNode() {
return rootNode;
}
}
We welcome contributions to improve and extend the XAPI framework. Please follow these guidelines:
- Follow the established coding standards
- Include appropriate documentation
- Add unit tests for new features
- Submit detailed pull requests
- Engage with the community for feedback
For support and questions:
- Check the official documentation
- Join our Discord community
- Submit issues through the appropriate channels
- Engage with other developers