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
  • Pandemic's Script Creator: Miner Tutorial, Part 1


    Pandemic

    Recommended Posts

    Hello everyone, this is the first of a short series of tutorials for Pandemic's Script Creator (PSC), a tool for making your own scripts without any programming. I plan on recreating my previous tutorials for DreamBot but using PSC instead of Java.

    Part 1 is extremely simple, we'll end up with a script that mines the nearest Copper Rocks and drops everything when the inventory is full. As you'll see with PSC, this tutorial will be much shorter than the Java version.

    Prerequisites

    You'll only need access to Pandemic's Script Creator, which you can get a free 8 hour trial from the SDN.

    The Script

    Let's start with what the script should be able to do by the end of Part 1:

    • Mine Copper rocks
    • If the inventory is full, drop all of the ore
    • Show a basic paint letting us know how much experience we've gained

    Getting Started

    To start on our first PSC script, just start Pandemic's Script Creator in DreamBot and press the "Create Script" button.

    You should now see the editor:

    pngout.png

    This might look intimidating at first, but as you'll soon see it's actually not too complicated. Before we actually start on our script, let's quickly see how PSC scripts work.

    How PSC Scripts Work

    PSC scripts are made up of Actions, which are just a single building block that does something, whether that is clicking on an NPC, checking if we're in an area, or just logging something to the DreamBot console.

    The script itself runs as a loop, constantly running all actions in the editor from top to bottom, and will enter or go into actions if they succeed (or are true), and continues doing that until there are no more actions where it'll start at the top again.

    Let's take a look at a simple example of what a single loop looks like step by step (green actions mean they were successful or true, orange or red means they failed or are false, and gray means they were skipped entirely):

    And these actions will repeat themselves until you stop the script.

    Mining

    Now that we have a basic understanding of how PSC scripts work, we can get started on our miner's first task: mining.

    Let's first check if our player isn't animating (swinging the pickaxe), and if we aren't then we can Mine a Copper rock:

    What's going on?

    If our player matches is a commonly used action that can be used to check a ton of different properties of our player, in this case we're only checking if we're not animating.

    Interact with a Game Object is the action we'll use to click on the rocks, which are a Game Object (as opposed to an NPC like a Man or Chicken, or a Ground Item like dropped Bones).

    Sleep while moving is a simple action that will wait to start moving then sleep until it's done moving. This is used to avoid spam clicking the rocks while we're walking towards it.

    As you can see after I started the script, it ends up clicking the rock and then stops because we start animating, which is exactly what we wanted.

    Dropping Ores

    If we kept our script running, it'd fill up the inventory and then just keep clicking on the rocks, which isn't ideal.

    So let's add the last part of our script to drop all of our ores once our inventory is full:

    What's going on?

    If inventory is full is a simple action that does exactly what it says, it will succeed if the inventory is full, running all actions inside of it.

    Drop all matching items will drop all items that match the filters inside, which in our case was to drop any item with "ore" anywhere in its name.

    Now we can safely run this script, it will fill up the inventory with ores, and then drop them all, repeating forever.

    Paint

    PSC has various Paint actions that can draw on the game screen, so let's show how much mining experience we've gained:

    What's going on?

    Draw text is a paint action that will draw the given text on the game screen, in our case we use a special field command called expGain that turns expGain(Skill) into the amount of experience gained in Skill since the script started.

    If you want to go a step further, there's another field command called hourly that can give the hourly rate of anything, so you could show experience per hour for example with hourly(expGain(Mining)). Try adding that as a separate Draw text action and try placing it below the first we added above (hint: you'll need to change the X and Y coordinates of the new Draw text action).

    We're Done!

    If you've made it this far, congratulations, you've made your first PSC script.

    You can find the full script file here:

    TutorialPart1.json

    While this was a simple tutorial showing a fairly simple script, PSC has much more to it, and it offers plenty of power to create much more complicated scripts.

    If you run into any issues, or want to check out the community, join our Discord: https://discord.com/invite/2KDD7d3Bex

    Thanks for reading!

    Read Part 2 Now

    Link to comment
    Share on other sites

    Nice work! This tool would have been a real asset when I was learning programming and playing around in Scratch MIT. It definitely could make the learning curve a lot more enjoyable.

    Edited by sloppybot
    Link to comment
    Share on other sites

    • 1 month later...

    I recorded the animation of walking from bank to the shop, and trading the shop assistant, right click to buy "item", world hop, right click trade shop assistant buy "item" world hop until full inventory then run back to bank and loop.

    All that worked from mouse recording is running to shop assistant opening the trade up, then it clicks X (no buy) world hops, open shop assistant trade, clicks x world hops few times then runs back to the bank and click x and repeats the loop.

    how exactly do I get it to purchase the item I want, hop world, trade shop again buy the item until full inventory then run to bank and loop?

    (I found  a very simple item in another location that I want to buy and bank for profit, but just tried making this one from a regular shop for the time being)

    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.