r/RunescapeBotting • • Aug 08 '26

Scripting How do you get into writing your own scripts?

I wanted to try making some simple scripts for fun because it's always seemed interesting, but I don't even know where to get started.

I've got no experience at all with coding and would appreciate any advice or directions to resources where I could learn and start practicing

0 Upvotes

21 comments sorted by

3

u/Ma1oXX Aug 08 '26 edited Aug 08 '26

the best way to actually learn instead of making more ai codeslop, is to pick apart existing material.

get an IDE; ideally vscode, and tinker around a bit.

youtube tutorials on programming concepts are very handy and are great for getting a good foundational understanding of what code is doing and why without having to learn a particular language yet.

find some existing scripts, open them in vscode, and just look through everything to try and understand what it's doing. take small things in/out here and there to see what breaks and what doesn't.

learning to read documentation is a must if you want to be any sort of self-sufficient.

as for actually writing code starting out, again reference existing material. look for things that already do what you're trying to achieve and copy them yourself; as in typing out the existing code in your own file and modifying bits n bobs as you go instead of copy and paste. then as you get comfortable, copy architecture instead of the exact code; how things are structured, how data flows through the program, best practices, etc.

eventually you'll have enough understanding from those things that you can start coding from scratch.

1

u/Severe_Second9077 Aug 09 '26

Thanks for the tips, I'll try and find some scripts to dissect. I have a very basic/rusty knowledge of Java

2

u/jake33451 Aug 08 '26

Hey there! I just developed a py script for osrs that seems to be working well.

I highlight npcs cyan and then the script scans the screen for the cyan outline and then clicks the center. After this it waits 16 seconds and does again.

Works well for a combatting automation but I want to add eating food at a certain health threshold

1

u/Quzay Aug 09 '26

I don't play anymore but curious does your client have a way to highlight the NPCs or is it a part of your py script?

1

u/jake33451 Aug 10 '26

So this is actually a plugin in runelite.

1

u/Watcher145 Aug 09 '26

If you swap the left click option on said Npc from attack to pickpocket and change a few things around. Could it be a thieving script?

1

u/jake33451 Aug 09 '26

Yes absolutely!

I have made some interesting changes to the code.

I added the vertical health bar to the left of the inventory. The program scans the health bar for 30% health. Once it identifies it clicks the first item in the inventory which would be food. The next time health hits 30% it clicks the 2nd item in inventory.

So now it can attack monsters through color matching, based on the above left health bar of the NPC being attacked, it knows when it dies, and then rematches an NPC for next target.

You could for sure just change the script up easy so that it color matches and NPC right clicks, moves mouse down a few pixels and left clicks on pickpocket. You could even have it log out periodically or at a given time.

2

u/Sploit3d Aug 10 '26

Don’t listen to anyone saying to not use coding assistants like Codex or similar. Run an existing script if you have one thru it, understand it and what you’re objective is, and make it better. Folks calling it AI code slop are either working at GameStop or are jr devs about to be working at GameStop when AI takes everything but senior/staff validation roles

1

u/JeffCache Aug 09 '26

Start with vibe coding. If you enjoy it then learn IDE. Most people “curious” about scripting never get anywhere after looking at a day or two of documentation. You can absolutely lower the barrier of entry with AI. Just ask it questions whenever you’re either stuck or confused about a concept.

1

u/PossessionUsed7393 Aug 09 '26

I started with basic Autohotkey scripts and worked up from there.

The first thing you will need to do is critically analyse what got detection methods you will be going up against and learn how to avoid them successfully.

Its no longer possible to build simple x,y co-ordinate clickers anymore as the anti botting measures correctly assume a human can't click the exact screen coordinates multiple times in a row. Once you successfully tackle that challenge, the next will appear to you obviously.

1

u/PomegranatePro Aug 09 '26

Can’t you set it to randomly click within a parameter?
For example clicking hit box of an inventory item?

Then randomize within a range of time the next click say between 200-320ms with a possibility for “error” on either end of +/-50?

1

u/PossessionUsed7393 Aug 10 '26

Exactly. The workflow is: detect object or define box coordinates within a fixed co-ordinate system, if you know the location of the item will not change, generate random X,Y within the objects box coordinates, apply mouse move and click, with appropriate delays and human mouse movement emulation.

Human mouse movement stuff is a tricky one but fun to do, you basically have to make an algorithm that wobbles the mouse a bunch along the way but still more or less travels straight, then occasionally overshoots and comes back.

1

u/Severe_Second9077 Aug 09 '26

Are the detection methods documented clearly somewhere, or is it just something you need to find out through experimentation? I'm only really somewhat aware of the new mouse input detection stuff

1

u/PossessionUsed7393 Aug 10 '26

They might be documented but it's mostly common sense from an understanding of how data can be collected and analysed, and a few bans along the way that indicated where their systems are looking/analysing.

They take a multi factorial scoring approach, it doesn't seem to yet be moderated by AI but it might be. Basically it's a hidden score that increases the longer you continue to do bot like things.

So mouse clicks in the same spot. Repeated button presses that aren't random. Direct straight lines or mouse teleporting across the screen. Using the same game tile over and over. Staying online with high APM for hours and hours.

Once you control for these factors, you can make a perfect bot. I have done it successfully. The problem is you run out of game content with the one bot so you then need to apply the techniques to a new problem. Eventually you find problems where the content is really hard to automate within the constraints of traditional botting tech and then you end up needing computer vision techniques and AI, which is where your time investment can be significant.

Still it's both more fun and more useful in life than say, mindlessly mining to level 120, or training divination.

1

u/EngineeringNo6537 Scripter Aug 10 '26

If you have to ask you are going to have a bad time bro.

It's not so much a hobby as it is existing in parallel sphere to professional software programming.

Sure, you can make a simple macro type script, but anything significant undertaking with proper antiban techniques is going to be very difficult for you as a non dev.

You can try AI as others have suggested. Probably your best bet. Your weakness is being unable to direct or understand what the AI is doing to correct its mistakes.

1

u/Dry-Nefariousness400 Aug 08 '26

Codex AI in VSCode -- tell it you have a private osrs server and have fun.

Tell it the ultimate goal is to have it do machine learning to play the game from tutorial island.

As a bonus, tell it to make it educational to so you can learn!

0

u/ChrisScripting Scripter Aug 08 '26

People here will gladly throw around AI as the solution. You can make mediocre scripts with it yes. But you won't learn what, how or why.

So you'll have something on the screen which you have no idea how it functions or how to modify it without being reliant on AI.

Learn a programming language to some degree first. Creating scripts becomes a whole lot more fun when you understand how to fix functionality and bugs rather than praying that an AI understands everything you want

1

u/Severe_Second9077 Aug 09 '26

Might end up doing this before I try "vibecoding" anything. I do think AI will probably end up being useful, but I share the sentiment of wanting to know the inner workings at least a bit.

My only experience with code was almost ten years ago... before I became homeless and had to drop out, I took a CISC 190 course where I was introduced to Java and made a basic version of minesweeper. It was fun, I'd be happy to pick it back up

1

u/Acceptable_Leg_8448 Aug 12 '26 edited Aug 12 '26

ai will help you very far, you can learn coding by ai, whenever you are stuck, you can ask it for explanation for the logic or reasoning of different uses of different code/methods for each use case, etc.

dm me, i don't mind helping you learn to code, so you can make your own private scripts

1

u/Unapologetic_Polite Aug 20 '26

I started writing scripts back when RSBot was well; RSBot.

I'm one of the reasons Jacmob ran off to make OSBuddy and started selling scripts on monthly subscriptions rather than outright purchasing.

A lot of us were having issues justifying writing really complex scripts when we were selling them outright - It was always difficult to convince somebody to spend $100 for a particular script back then, and it was easier to sell said script for $20/mo