Jump to content

[Guide] How to Plan a Script


Colorless

Recommended Posts

DISCLAIMER: THIS DOESN'T INVOLVE CODE. THIS IS MERELY FOR BEGINNERS WHO HAVEN'T GRASPED THE REQUIRED CRITICAL THINKING SKILLS TO SCRIPT.

Hello All!
Recently decided that I'd attempt to use my Java knowledge for botting. I'm not super experienced but I'm organized when it comes to development and that's what I'm going to teach you today.

Being organized is one of the most crucial steps to understanding how to piece your script together. Apaec has an excellent guide that you should read if you haven't already. (It's pinned so I'm not going to bother linking it). In his guide he mentions State Machines. Which are a series of boolean statements, true or false, which decide what action the bot will perform.

It's great that he introduces the idea but I felt like he doesn't go into enough detail about how to plan a script. Because while you can jump right in and start coding, you want a foundation and goals in mind to improve efficiency and in turn will allow for you to build on top of what you've already created later on.

Currently I'm working on a 1-33 Progressive Magic Leveler. This is for TeleGrab, but there's a decent amount of thought process behind just getting to that goal level of 33.

These are some of the goals required to eventually get to level 33:

  • Where to get items
  • Equipment
  • Runes
  • What spells to use
  • When to swap spells
  • Where to splash

These are only a handful of the goals and if you're anything like me having the goals in mind is great, but not listing them step by step still makes it a confusing path to getting to your completed script.

How/Where to get Items:

So first step is to plan out how to get the required runes/equipment to get to level 33 efficiently. I'll be using a muling system for gathering materials so I don't have to worry about having the bot running everywhere which makes the script more complicated and also more prone to get stuck.

So we're not going to go into the muling process. We'll just simply state that we have a mule that has all the required materials for our magic adventure.

Needed Equipment:

So what materials are actually needed?
Well Splashing is by far the easiest way to do this, but I want to also get it within a decent amount of time. 

To splash you need a Magic Bonus of -65 to splash 100% of the time. So to reach that -65 Magic Bonus we'll use an Iron Full Helm, Platebody, Platelegs, and Kite Shield. This will get us to -65. We won't be using a staff as elemental staves provide a +5 Magic Bonus. We could use the "Cursed Goblin Staff" which provides no Magic Bonus, but since we'll only be using autocast spells until level 3, there's no need!

So the core equipment will be the iron set. 

Needed Runes/Spells to Use/When to Swap:

Well at level 1 Magic you will only have access to Wind Strike. At Level 3 you'll gain Confuse. At level 11 you gain Weaken and finally at level 19 we'll have Curse, which we'll use until 33.

Our Intended Spell Usage:

  • 1-3 Wind Strike | 1 Air 1 Mind per Cast
  • 3-11 Confuse | 1 Body 2 Earth 3 Water per Cast
  • 11-19 Weaken | 1 Body 2 Earth 3 Water per Cast
  • 19-33 Curse | 1 Body 2 Water 3 Earth per Cast

Now that we've planned our Spell Casting route, we need to calculate how many runes we'll need to get to our desired levels!

Searching up any old xp calculator for OSRS should do the trick.

iNh7mAp.png

So we'll need 32 Air and 32 Mind Runes to get to level 3

kB0z6YD.png

For 3-11 we'll need 92 Body, 184 Earth, and 276 Water Runes using confuse

QgykuXG.png

11-19: 125 Body, 250 Earth, and 375 Water Runes

k53xt8D.png

19-33: 493 Body, 986 Water, and 1479 Earth Runes

Total Runes for 1-33:

  • 32 Air Runes
  • 32 Mind Runes
  • 710 Body Runes
  • 1913 Earth Runes
  • 1637 Water Runes

Where to Splash:

Where we choose to splash will also decide where to keep our mule. I'll demonstrate how all of this planning ties together in a flowchart at the end. But where shall we splash?

Lumbridge is insanely crowded on F2P which are the type of accounts I'll be using to get level 33.

Draynor isn't too far but can result in some problems if the Dark Wizards wander too far.

Varrock is rather far but once past the Dark Wizards we have numerous NPCs to attack.

I like the idea of Varrock the best so we'll route ourselves there.

Flowchart:
This is where we combine all our goals and ideas to construct the script! The resulting flowchart I've created from this may differ from yours depending on what you find most important for the bot to do first!

wKvtv6h.png

Note: This isn't a final flowchart. It's laying the groundwork. 

Immediate Issues with this Flowchart:

  • What if the mule doesn't have materials?
  • What if the bot can't hold the items?
  • What qualifies as "materials?" Can air runes be depleted and the script continue?

This is just an example. It's not fully done but it gives you a better idea on how to plan your script. 

Always ask yourself about the "what ifs"

 

Thanks for reading, I hope you learned something and good luck in staying organized. The planning stage decides how well your final script will look. 

 

Resources:

draw.io

zybez osrs magic calculator

Edited by Colorless
  • Like 9
Link to comment
Share on other sites

Thanks at least someone understands that scripting is not merely writing getMagicToLevel33, the end. 
"Oh but this script is basic, i am only paying 5m for it!" The most annoying comments I get when people want private scripts. Just because it's simple to do as a human does not mean it is simple to code. 

Anyways, on topic, good flow chart. Hope to see the release of your script soon. Good organization. 

  • Like 3
Link to comment
Share on other sites

Nice, a tutorial with no code! A great read. I saw you mentioned my scripting guide - it sure is in need of some love. I wrote it a couple of years back now - since lots of things have changed, it's coming time for me to re-write it. When I do, I will definitely include some of the important concepts behind writing a script, such as the planning of structure, correctly utilising the continuous looping nature of the onLoop, and other 'scripting related stuff with no code'. Also, a flow chart is a great idea!

Thanks for sharing these tips

Apa

 

Link to comment
Share on other sites

10 minutes ago, Juggles said:

Thanks at least someone understands that scripting is not merely writing getMagicToLevel33, the end. 
"Oh but this script is basic, i am only paying 5m for it!" The most annoying comments I get when people want private scripts. Just because it's simple to do as a human does not mean it is simple to code. 

Anyways, on topic, good flow chart. Hope to see the release of your script soon. Good organization. 

Thank you! I'm still new to coding bots but the same thought process applies across different projects. I learned a lot from reading your tutorials so I'm glad I made something that you deem well made :)

 

5 minutes ago, Apaec said:

Nice, a tutorial with no code! A great read. I saw you mentioned my scripting guide - it sure is in need of some love. I wrote it a couple of years back now - since lots of things have changed, it's coming time for me to re-write it. When I do, I will definitely include some of the important concepts behind writing a script, such as the planning of structure, correctly utilising the continuous looping nature of the onLoop, and other 'scripting related stuff with no code'. Also, a flow chart is a great idea!

Thanks for sharing these tips

Apa

 

No problem, I'm really trying to focus on fundamentals when it comes to starting to script. I've found it great to know how to navigate the API, understand what you're writing, but with no goal or plan you're not going to get far without running into more issues. I look forward to your revised guide as the current one you have pinned got me interested in even attempting to try scripting. I hope to learn something new from you when the time comes for that guide. Best of luck!

  • Like 1
Link to comment
Share on other sites

I like that you have shared the idea of structuring the script in a flowchart or written down, instead of writing the script without any information and going back every few lines to amend changes.

Structuring your project in a flowchart or written down in pseudo code is essential if the project is long :) And should be/is taught before entering the programming world.

As Apaec also said, tutorials with no code is also sweet, no copypasta.

Edited by Viston
Link to comment
Share on other sites

37 minutes ago, Viston said:

I like that you have shared the idea of structuring the script in a flowchart or written down, instead of writing the script without any information and going back every few lines to amend changes.

Structuring your project in a flowchart or written down in pseudo code is essential if the project is long :) And should be/is taught before entering the programming world.

As Apaec also said, tutorials with no code is also sweet, no copypasta.

I was originally scripting with just my end goal in mind. I didn't account for all other specifics that are required to get to that goal.
I think a big part of anything in life is breaking things down to manageable chunks. I was having issues getting to level 3 much less 33 that I had to take a step back and rethink all of the minor steps that lead to xp gain.

Surprisingly I didn't see mention of planning is this type of way so I decided to try and write it out. There's a lot of critical thinking involved with this kind of stuff. Just because you don't understand it doesn't mean it's impossible to learn.

I didn't realize that a tutorial with no code would be so well received. I thought it was actually a nuisance but this is the type of stuff I wish I had when I was starting out.

Thank you for the kind words! I might make another tutorial on other organization techniques I find useful, none come to mind at the moment but there are some really simple stuff that some people never think to do.

  • Like 1
Link to comment
Share on other sites

8 hours ago, Juggles said:

Thanks at least someone understands that scripting is not merely writing getMagicToLevel33, the end. 
"Oh but this script is basic, i am only paying 5m for it!" The most annoying comments I get when people want private scripts. Just because it's simple to do as a human does not mean it is simple to code. 

Anyways, on topic, good flow chart. Hope to see the release of your script soon. Good organization. 

^ this basically.

Good job

Link to comment
Share on other sites

8 hours ago, Juggles said:

Thanks at least someone understands that scripting is not merely writing getMagicToLevel33, the end. 
"Oh but this script is basic, i am only paying 5m for it!" The most annoying comments I get when people want private scripts. Just because it's simple to do as a human does not mean it is simple to code. 

Anyways, on topic, good flow chart. Hope to see the release of your script soon. Good organization. 

shut up and make my wyvern killer for 5m noob!

Link to comment
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...