Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Q-Learning bot Example (very simple)

    Deep Slayer

    Recommended Posts

    Q-Learning OSRS Bot: Kills Cows & is punished for looting


    This Old School RuneScape (OSRS) bot leverages Q-learning, a type of reinforcement learning, to fight cows. The bot focuses on optimizing two primary actions: attacking cows and avoiding the collection of cowhides. It learns and adapts over time to maximize rewards for attacking cows and minimizes penalties for picking up cowhides. 


    • Q-Learning Algorithm: Utilizes Q-learning to dynamically adapt to the game environment.
    • State Management: Recognizes two primary states - Fighting and Looting.
    • Reward System: Rewards attacking cows and penalizes picking up cowhides.
    • Epsilon Decay: Ensures the bot transitions from exploring different actions to exploiting the most rewarding actions over time.
    • Logging and Monitoring: Detailed logging to track actions, rewards, Q-value updates, and epsilon decay.

    Technical Details

    • Q-Table Storage: Saves and loads Q-values to persist learning across sessions.
    • Adaptive Behavior: The bot learns from interactions, adjusting its behavior to optimize for long-term rewards.

    How It Works

    1. Initialization: The bot loads or initializes a Q-table to store Q-values representing the expected rewards of actions in various states.
    2. State Recognition: Determines the current state (Fighting or Looting) based on the player’s status.
    3. Action Selection: Chooses actions based on the current state, either attacking cows or looting cowhides, with a preference for actions with higher Q-values.
    4. Reward System: Receives rewards for attacking cows and penalties for looting cowhides, adjusting Q-values accordingly.
    5. Epsilon Decay: Gradually reduces exploration over time, focusing on the most rewarding actions.

    How To Use

    1. Start the bot near Cows


    State.java LearningBot.java LearningAgent.java Action.java

    Edited by Deep Slayer
    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.