Playback starts YouTube’s embedded player (privacy-enhanced mode).
How To Code a RuneScape Bot with RobotJS - Learn JavaScript by playing RuneScape 1/4
ChannelLearn Code By GamingDescription from the creator
This tutorial will teach you how to code a RuneScape bot using JavaScript. No prior programming experience required! This guide is for beginners. We'll use Node.js and the RobotJS library and use a technique called GUI automation.
* This tutorial is for educational purposes only *
Full tutorial playlist: youtube.com/playlist?list=PL1m2M8LQlzfJjTJrovnq…
View the Source Code
GitHub repo: github.com/learncodebygaming/woodcutter
Download Links
Node.js: nodejs.org/
RobotJS: robotjs.io/
Visual Studio Code: code.visualstudio.com/download
Recommended JavaScript Resources
Eloquent JavaScript: amzn.to/3deUEfb or online edition at eloquentjavascript.net/
W3Schools: w3schools.com/js/default.asp
0:35 Disclaimer: Don't Cheat!
1:31 Using the browser console to run JavaScript
3:18 How to install Node.js
5:22 Using Notepad and PowerShell to write code
8:24 Using VSCode to write code
9:48 How to install RobotJS
A note on the "automatically install necessary tools" step of the Node.js installation:
If you already have Node installed, you can find the Additional Tools install link in the Start menu under "Node". Alternatively, you can install windows-build-tools from an elevated PowerShell or CMD.exe like this: npm install --global --production windows-build-tools
More details here: npmjs.com/package/robotjs#building
In this tutorial series, I'm going to teach you how to program a simple Runescape bot in JavaScript. More specifically, we're going to be using Node.js and the RobotJS library to do GUI automation, and with those tools we're going to make a basic woodcutting bot. You don't need to have any prior programming experience to follow along. This tutorial is aimed at absolute beginners, so I'll be going slowly, showing you how to get everything set up, and explaining fundamental programming concepts as we go. So if you've ever been interested in programming or in JavaScript, this project should be a great place to get started.
JavaScript has always been a popular language with new programmers because it's very easy to get started with. All you need is a web browser. Every modern browser can run JavaScript.
So let's write your first line of code. If you're in Chrome, right-click anywhere on a web page and click Inspect. Then in the window that pops up, click on Console. You can do almost the exact same thing in Firefox or even the Edge browser.
This is the JavaScript console. You can write and execute JavaScript code from right here. If we type 3 + 4 and hit enter, you can see we get the expected result. You can also call a function like alert(‘Hello'); and when you hit enter, you can see a popup appear.
JavaScript is the language of frontend web development, so any programmer who wants to work on the web needs to be able to write JavaScript at some point. That's another reason why JavaScript is a good place to start learning, because most programmers will need to know it eventually anyway.
Now, for the woodcutting bot we're going to write, I'm going to teach you a technique called GUI automation. This is a technique where you write code to automate mouse movement and keyboard inputs, while using information from the screen to make decisions about what your code should do next. If you've seen my tutorial series on PyAutoGUI, we're using the same concepts here, except we'll be doing things in JavaScript instead of Python.
In order to use GUI automation, we won't be able to run our JavaScript code inside the browser. That's because browsers come with protections that prevent code from controlling a user's mouse and keyboard. This is a very good thing, because could you imagine if the websites you visited could control your mouse and keyboard... that would be terrible. So we need some way to run our code as a desktop application that has permission to control our mouse and keyboard.
To do that, we'll be using Node.js, a very popular JavaScript runtime that's used by professional developers all the time.
Download and install Node.js from their website, nodejs.org. The home page should give you a link to the recommended download for your platform. In my case that was the LTS 64-bit Windows Installer. When installing, you should click the checkbox to "Automatically install the necessary tools". If you don't, you'll get errors when we try to install the RobotJS library.
So that probably took a little while, but when it's finished, let's confirm it was installed correctly by using the terminal. On Windows, I prefer to use Git Bash, but you can also use PowerShell. Enter the command node --version and it'll output the installed version of node if it's installed correctly.
Continue with the written tutorial here: learncodebygaming.com/blog/how-to-code-a-runesc…
Join me on Discord: discord.gg/3fmKUAxNDv
* This tutorial is for educational purposes only *
Full tutorial playlist: youtube.com/playlist?list=PL1m2M8LQlzfJjTJrovnq…
View the Source Code
GitHub repo: github.com/learncodebygaming/woodcutter
Download Links
Node.js: nodejs.org/
RobotJS: robotjs.io/
Visual Studio Code: code.visualstudio.com/download
Recommended JavaScript Resources
Eloquent JavaScript: amzn.to/3deUEfb or online edition at eloquentjavascript.net/
W3Schools: w3schools.com/js/default.asp
0:35 Disclaimer: Don't Cheat!
1:31 Using the browser console to run JavaScript
3:18 How to install Node.js
5:22 Using Notepad and PowerShell to write code
8:24 Using VSCode to write code
9:48 How to install RobotJS
A note on the "automatically install necessary tools" step of the Node.js installation:
If you already have Node installed, you can find the Additional Tools install link in the Start menu under "Node". Alternatively, you can install windows-build-tools from an elevated PowerShell or CMD.exe like this: npm install --global --production windows-build-tools
More details here: npmjs.com/package/robotjs#building
In this tutorial series, I'm going to teach you how to program a simple Runescape bot in JavaScript. More specifically, we're going to be using Node.js and the RobotJS library to do GUI automation, and with those tools we're going to make a basic woodcutting bot. You don't need to have any prior programming experience to follow along. This tutorial is aimed at absolute beginners, so I'll be going slowly, showing you how to get everything set up, and explaining fundamental programming concepts as we go. So if you've ever been interested in programming or in JavaScript, this project should be a great place to get started.
JavaScript has always been a popular language with new programmers because it's very easy to get started with. All you need is a web browser. Every modern browser can run JavaScript.
So let's write your first line of code. If you're in Chrome, right-click anywhere on a web page and click Inspect. Then in the window that pops up, click on Console. You can do almost the exact same thing in Firefox or even the Edge browser.
This is the JavaScript console. You can write and execute JavaScript code from right here. If we type 3 + 4 and hit enter, you can see we get the expected result. You can also call a function like alert(‘Hello'); and when you hit enter, you can see a popup appear.
JavaScript is the language of frontend web development, so any programmer who wants to work on the web needs to be able to write JavaScript at some point. That's another reason why JavaScript is a good place to start learning, because most programmers will need to know it eventually anyway.
Now, for the woodcutting bot we're going to write, I'm going to teach you a technique called GUI automation. This is a technique where you write code to automate mouse movement and keyboard inputs, while using information from the screen to make decisions about what your code should do next. If you've seen my tutorial series on PyAutoGUI, we're using the same concepts here, except we'll be doing things in JavaScript instead of Python.
In order to use GUI automation, we won't be able to run our JavaScript code inside the browser. That's because browsers come with protections that prevent code from controlling a user's mouse and keyboard. This is a very good thing, because could you imagine if the websites you visited could control your mouse and keyboard... that would be terrible. So we need some way to run our code as a desktop application that has permission to control our mouse and keyboard.
To do that, we'll be using Node.js, a very popular JavaScript runtime that's used by professional developers all the time.
Download and install Node.js from their website, nodejs.org. The home page should give you a link to the recommended download for your platform. In my case that was the LTS 64-bit Windows Installer. When installing, you should click the checkbox to "Automatically install the necessary tools". If you don't, you'll get errors when we try to install the RobotJS library.
So that probably took a little while, but when it's finished, let's confirm it was installed correctly by using the terminal. On Windows, I prefer to use Git Bash, but you can also use PowerShell. Enter the command node --version and it'll output the installed version of node if it's installed correctly.
Continue with the written tutorial here: learncodebygaming.com/blog/how-to-code-a-runesc…
Join me on Discord: discord.gg/3fmKUAxNDv
About this tutorial
Learn Code By Gaming published this 14:07 video tutorial on April 4, 2020. It has been watched 125,020 times on YouTube.
- Channel
- Learn Code By Gaming
- Category
- Education
- Duration
- 14:07
- Published
- April 4, 2020
- Views
- 125,020
- Likes
- 2,750
Share
This tutorial in other languages
- FRComment un code Bot RuneScape avec RobotJS - Apprendre JavaScript en jouant RuneScape 1/4
- ESCómo código a un RuneScape Bot con RobotJS - Aprender JavaScript al jugar RuneScape 1/4
- PTComo código a um RuneScape Bot com RobotJS - Aprenda JavaScript jogando RuneScape 1/4
- ITCome per codificare un RuneScape Bot con RobotJS - Imparare giocando JavaScript RuneScape 1/4
- DEHow To-Code ein RuneScape Bot mit RobotJS - Lernen Sie JavaScript durch das Spiel RuneScape 1/4
- NLHow To Code een RuneScape Bot met RobotJS - Leer JavaScript door het spelen van RuneScape 1/4
- RUКак закодировать RuneScape Bot с RobotJS - Learn JavaScript, играя RuneScape 1/4
- PLJak kod do RuneScape Bot z RobotJS - Dowiedz JavaScript grając RuneScape 1/4
- JARuneScapeの1/4遊んでJavaScriptを学ぶ - どのようにするためのコードRuneScapeのボットRobotJSと
- ARكيف التعليمات البرمجية إلى سكيب بوت مع RobotJS - تعلم جافا سكريبت عن طريق اللعب سكيب 1/4
- HIकैसे करने के लिए कोड RobotJS के साथ एक RuneScape बॉट - RuneScape 1/4 खेल कर जावास्क्रिप्ट जानें
- IDCara Code Runescape Bot dengan RobotJS - Pelajari JavaScript dengan bermain Runescape 1/4