If you FULLY understand Javascript, NPM packages, and VSCode, please hop back over to the Introduction page. You are in the wrong place. If not, keep reading! This guide will help you get situated as a new coder.
Welcome! To get started, I would like to (metaphorically) sit down and chat with you about being a coder. Coding is difficult at first, if you're not familiar. I was in your shoes once, and I know how intimidating it can be. But I promise you, if you stick with it, it gets easier and easier. You will eventually get to a point where coding is fun and exciting, and you will be able to create amazing things with lines on a screen.
Please understand that while yolkbot is designed to be as simple as possible, it is still a framework for coders. If you do not know how to code, you will not be able to use yolkbot. This page is designed to help you get started with coding so that you can eventually use yolkbot.
To absorb this entire page, you need to set aside a good chunk of time. I recommend at least 2 hours. This page will be difficult to get through, but if you stick around, you will learn a lot in a (relatively) short amount of time. A requirement I ask you to hold yourself to is that you read the entire page. Do not skip around or assume "I know enough". You do not. If I link to a video, it's because I believe the entire video is worth watching. If I link to a guide, it's because I believe the entire guide is worth reading. Putting a video on 2x speed, or skipping around the timestamps, or "grabbing water & leaving it running" will only hurt yourself.
I am not sitting next to you to hold you to these standards. You are. The reward is understanding of yolkbot. We are always happy to help you on our Discord server, but if you do not understand the concepts in this document, we will simply link this page and ignore you.
With that being said, let's get started! I'll try to use bullet points and fun formatting from this point on to make this more readable and fun for you. I guarantee you I'm not boring.
That's a good question! You will need to understand a few things about coding:
I recommend that you take 3 deep breaths before continuing.
Now that you've reset part of your nervous system, let's talk about how to get started. Let's install some software!
Part of coding is figuring things out. I won't hold your hand, but I will drop hints and give advice. Please install the following software:
To verify both of these are installed correctly, please open up your terminal (on Windows, you can use Command Prompt or PowerShell) and run the following commands:
bun --version
code --version
Both of these should output 1.X.X. If it doesn't, you messed up! Go back and try again. Falling on your face is normal.
Good job!
Syntax is how you write code. Just like English has grammar and spelling rules, programming languages have syntax rules. If you break the rules, your code won't work.
Let's get started by opening VSCode and making a Javascript file. Like .png is images, .js is Javascript files. Create a new file called code.js, and open it in VSCode. If you don't see the terminal at the bottom of your screen, open the VSCode palette (cmd/ctrl + shift + p) and find "toggle terminal". You should see your name, your computer's name, and the folder you're working in. If not, you're doing something wrong! It's probably time to talk about AI & asking for help.
AI is something that plagues our lives. I believe it is truly a plague. If you use AI to write code from the start, you will never truly learn anything. You will not learn how to think like a programmer, you will not learn how to debug, and you will not learn how to solve problems. If you want to learn how to code, you must do it yourself. AI can be used as a tool to help you with specific problems, but it should not be used as a crutch.
If you run into a PROBLEM, AI can help. A problem is an error in your code. A problem is not 'i dont know how to do this so lemme just paste it into chatgpt and itll tell me and ill paste it in and my code will work wowzers'; that is not a problem, that is laziness. If you run into a problem, you can ask AI for help.
If you get confused in this guide, unless I specifically say you can, I don't want you to open ChatGPT, or Gemini, or Claude. These are only truly helpful to your journey if you understand what it puts out. If you don't understand what it puts out, you are not learning anything. You are simply copying and pasting code that you don't understand, and that is not learning.
Anyway, if you get confused with VSCode setup, feel free to ask GPT.
You SHOULD hopefully have a blank .js file and a terminal you can run things in. The first thing you need to do is know how to run your file.
To run your file, type the following command in your terminal:
bun code.js
This runs your code. Now, although this may shock you, you have no code in your file. So nothing will happen. This is normal. Do not panick.
Anyqay, to start ADDING code to your file, there are multiple types of data:
All of these can be logged! The first thing you will do is learn to log something to a terminal and understand what logging is. You will then log millions of things to the terminal in your coding career. Do not be scared to log something!
To log something, we first need to know how to store information. To grasp that, please read: Variables
From this point on, do NOT use AI to generate or fix your code. Close ChatGPT and all other AI tools. You NEED to learn this on your own.
You should now understand how to create a variable. Create a variable in your file named greeting and set it equal to "Hello, world!". I won't tell you what this is supposed to look like, because I want you to figure it out. If you get stuck, read the link until you understand it.
For now, leave that guy alone. Read this guide to learn how to use console.log to log something to the terminal. Log hello, world and run your program with bun code.js. You should see hello, world in your terminal. If you don't, you messed up! Go back and try again. From this point on, I won't remind you how to log things, how to run your program, or how to declare variables. You should try to remember this!
Now, let's combine the two things we've learned and log a variable. Since we know we can log a string like "Hello, world", and we can make a variable that has "Hello, world", take a hot guess at how you might log a variable...
You should have gotten something like:
let greeting = "Hello, world!";
console.log(greeting);
If you did, great job! If not, figure out what you did wrong and make a mental note not to do it again in the future. At this point, if you're confused, go back and look over the wrong linked guides, and maybe some of this guide as well. This is relatively simple combining knowledge that you MUST understand for the future.
We now need to know about defining and calling functions. Please read ALL OF this guide to understand functions. Functions are how you make things happen in code. You will use functions a LOT, and call them even more.
Let's try combining EVERYTHING you know so far. Keep your current code in the file. Then:
changeGreetinggreeting to "Hello, yolkbot!"greeting againYou should see:
Hello, yolkbot!
If you got that, great job! If not, figure out what you did wrong and make a mental note not to do it again in the future. At this point, if you're confused, go back and look over the wrong linked guides, and maybe some of this guide as well. This is relatively simple combining knowledge that you MUST understand for the future.
Below this is example code for how this would work. Do NOT copy and paste it. You must figure it out on your own. If you copy and paste it, you are not learning anything.
let greeting = "Hello, world!";
console.log(greeting);
// New code!
function changeGreeting() {
greeting = "Hello, yolkbot!";
}
changeGreeting();
console.log(greeting);
Now, something used in that example we haven't covered yet is code comments. Code comments are a way to temporarily remove code that isn't useful, or add notes to code. Read everything UNTIL "multi-line comments" in this guide to understand code comments. Try adding a few single-line comments to your code. They can go at the end of lines, or on blank lines themselves.
We are nearly to the point where we can start talking about yolkbot. We need to grasp a few more things first, and the next one is objects.
Objects are a way to "nest" data. Imagine like a tree, with branches, and then more branches on those, and then more. Hopefully you have a tree outside the nearest window if you're unfamiliar with them. Variables can be objects. Please read this guide on objects. Some of the things here (like new Object) are not important, but please read the entire thing.
Let's do some work with objects. First, make an object named myInfo. Put your credit card number, the 4 numbers on the front, the 3 on the back...I'm kidding. Make an object that has anything you want. Try logging it! Try putting a function in an object and calling it! You now know about variables, logging, functions, comments, AND objects! Stop here and play around a bit. There's a LOT you can write with this. Try creating a few things!
Then, write a comment saying "I'm amazing!". I'm proud of you for getting here. We're ready to start using packages.
We're going to leave this file behind for now. Rename it to "ilearnedtocodehere.js" and come back to it when you're old and laugh at how silly you were back then. In VSCode, import a folder you create JUST for your first yolkbot. We need to get started with some deep and cool concepts.
Let's start by creating a file named package.json. A JSON is like an object in a file that isn't assigned to anything. In this file, just put {}. It'll be automatically added to later!
Now, create a file named bot.js. Leave it alone for now! We're going to head down to the terminal you hopefully still have open, and run:
bun install yolkbot
You've installed yolkbot! Bun should've made a folder named node_modules, a file named bun.lock, and edited package.json to add yolkbot. Please never edit node_modules or bun.lock, it'll cause issues later.
Now, let's edit bot.js to start making a yolkbot! There's one more concept we need to learn, and that's importing things. You can import a yolkbot Bot with:
import Bot from 'yolkbot/bot';
Similarly, for a Dispatch (something we use in yolkbot to command a bot to do something):
import SpawnDispatch from 'yolkbot/dispatches/SpawnDispatch';
Importing something basically makes a variable with our code. When you import Bot, you (basically) import a variable named Bot that I wrote once upon a time that you can use immediately.
In this documentation, we'll tell you what the import statement you need. You don't need to worry about trying to find it.
Now, let's make a simple bot:
import Bot from 'yolkbot/bot'; // creates the "Bot" variable. it's capitalized, which means it's just something that exists
let bot = new Bot(); // this makes a new Bot, and names the new Bot "bot"
You didn't learn about new, but it's not really important right now - just know we use it sometimes to make a new version of something. let bot should look familar - you made a variable named "bot" that is your bot!
Another thing you should note is that some function calls when using yolkbot require await. This just waits for certain things (like querying Shell Shockers' servers) to finish before moving on.
bot is prefilled with a TON of functions that you can learn about in this documentation. For example, you can use what you know about functions to log in anonymously and log the account information:
let account = await bot.loginAnonymously();
console.log(account); // account is an object
And yeah...that's the basics of code! Go back to the Introduction page to start making a yolkbot! If you have any questions, come to our Discord server and ask. We're always happy to help you out!
If you FULLY understand Javascript, NPM packages, and VSCode, please hop back over to the Introduction page. You are in the wrong place. If not, keep reading! This guide will help you get situated as a new coder.
Welcome! To get started, I would like to (metaphorically) sit down and chat with you about being a coder. Coding is difficult at first, if you're not familiar. I was in your shoes once, and I know how intimidating it can be. But I promise you, if you stick with it, it gets easier and easier. You will eventually get to a point where coding is fun and exciting, and you will be able to create amazing things with lines on a screen.
Please understand that while yolkbot is designed to be as simple as possible, it is still a framework for coders. If you do not know how to code, you will not be able to use yolkbot. This page is designed to help you get started with coding so that you can eventually use yolkbot.
To absorb this entire page, you need to set aside a good chunk of time. I recommend at least 2 hours. This page will be difficult to get through, but if you stick around, you will learn a lot in a (relatively) short amount of time. A requirement I ask you to hold yourself to is that you read the entire page. Do not skip around or assume "I know enough". You do not. If I link to a video, it's because I believe the entire video is worth watching. If I link to a guide, it's because I believe the entire guide is worth reading. Putting a video on 2x speed, or skipping around the timestamps, or "grabbing water & leaving it running" will only hurt yourself.
I am not sitting next to you to hold you to these standards. You are. The reward is understanding of yolkbot. We are always happy to help you on our Discord server, but if you do not understand the concepts in this document, we will simply link this page and ignore you.
With that being said, let's get started! I'll try to use bullet points and fun formatting from this point on to make this more readable and fun for you. I guarantee you I'm not boring.
That's a good question! You will need to understand a few things about coding:
I recommend that you take 3 deep breaths before continuing.
Now that you've reset part of your nervous system, let's talk about how to get started. Let's install some software!
Part of coding is figuring things out. I won't hold your hand, but I will drop hints and give advice. Please install the following software:
To verify both of these are installed correctly, please open up your terminal (on Windows, you can use Command Prompt or PowerShell) and run the following commands:
bun --version
code --version
Both of these should output 1.X.X. If it doesn't, you messed up! Go back and try again. Falling on your face is normal.
Good job!
Syntax is how you write code. Just like English has grammar and spelling rules, programming languages have syntax rules. If you break the rules, your code won't work.
Let's get started by opening VSCode and making a Javascript file. Like .png is images, .js is Javascript files. Create a new file called code.js, and open it in VSCode. If you don't see the terminal at the bottom of your screen, open the VSCode palette (cmd/ctrl + shift + p) and find "toggle terminal". You should see your name, your computer's name, and the folder you're working in. If not, you're doing something wrong! It's probably time to talk about AI & asking for help.
AI is something that plagues our lives. I believe it is truly a plague. If you use AI to write code from the start, you will never truly learn anything. You will not learn how to think like a programmer, you will not learn how to debug, and you will not learn how to solve problems. If you want to learn how to code, you must do it yourself. AI can be used as a tool to help you with specific problems, but it should not be used as a crutch.
If you run into a PROBLEM, AI can help. A problem is an error in your code. A problem is not 'i dont know how to do this so lemme just paste it into chatgpt and itll tell me and ill paste it in and my code will work wowzers'; that is not a problem, that is laziness. If you run into a problem, you can ask AI for help.
If you get confused in this guide, unless I specifically say you can, I don't want you to open ChatGPT, or Gemini, or Claude. These are only truly helpful to your journey if you understand what it puts out. If you don't understand what it puts out, you are not learning anything. You are simply copying and pasting code that you don't understand, and that is not learning.
Anyway, if you get confused with VSCode setup, feel free to ask GPT.
You SHOULD hopefully have a blank .js file and a terminal you can run things in. The first thing you need to do is know how to run your file.
To run your file, type the following command in your terminal:
bun code.js
This runs your code. Now, although this may shock you, you have no code in your file. So nothing will happen. This is normal. Do not panick.
Anyqay, to start ADDING code to your file, there are multiple types of data:
All of these can be logged! The first thing you will do is learn to log something to a terminal and understand what logging is. You will then log millions of things to the terminal in your coding career. Do not be scared to log something!
To log something, we first need to know how to store information. To grasp that, please read: Variables
From this point on, do NOT use AI to generate or fix your code. Close ChatGPT and all other AI tools. You NEED to learn this on your own.
You should now understand how to create a variable. Create a variable in your file named greeting and set it equal to "Hello, world!". I won't tell you what this is supposed to look like, because I want you to figure it out. If you get stuck, read the link until you understand it.
For now, leave that guy alone. Read this guide to learn how to use console.log to log something to the terminal. Log hello, world and run your program with bun code.js. You should see hello, world in your terminal. If you don't, you messed up! Go back and try again. From this point on, I won't remind you how to log things, how to run your program, or how to declare variables. You should try to remember this!
Now, let's combine the two things we've learned and log a variable. Since we know we can log a string like "Hello, world", and we can make a variable that has "Hello, world", take a hot guess at how you might log a variable...
You should have gotten something like:
let greeting = "Hello, world!";
console.log(greeting);
If you did, great job! If not, figure out what you did wrong and make a mental note not to do it again in the future. At this point, if you're confused, go back and look over the wrong linked guides, and maybe some of this guide as well. This is relatively simple combining knowledge that you MUST understand for the future.
We now need to know about defining and calling functions. Please read ALL OF this guide to understand functions. Functions are how you make things happen in code. You will use functions a LOT, and call them even more.
Let's try combining EVERYTHING you know so far. Keep your current code in the file. Then:
changeGreetinggreeting to "Hello, yolkbot!"greeting againYou should see:
Hello, yolkbot!
If you got that, great job! If not, figure out what you did wrong and make a mental note not to do it again in the future. At this point, if you're confused, go back and look over the wrong linked guides, and maybe some of this guide as well. This is relatively simple combining knowledge that you MUST understand for the future.
Below this is example code for how this would work. Do NOT copy and paste it. You must figure it out on your own. If you copy and paste it, you are not learning anything.
let greeting = "Hello, world!";
console.log(greeting);
// New code!
function changeGreeting() {
greeting = "Hello, yolkbot!";
}
changeGreeting();
console.log(greeting);
Now, something used in that example we haven't covered yet is code comments. Code comments are a way to temporarily remove code that isn't useful, or add notes to code. Read everything UNTIL "multi-line comments" in this guide to understand code comments. Try adding a few single-line comments to your code. They can go at the end of lines, or on blank lines themselves.
We are nearly to the point where we can start talking about yolkbot. We need to grasp a few more things first, and the next one is objects.
Objects are a way to "nest" data. Imagine like a tree, with branches, and then more branches on those, and then more. Hopefully you have a tree outside the nearest window if you're unfamiliar with them. Variables can be objects. Please read this guide on objects. Some of the things here (like new Object) are not important, but please read the entire thing.
Let's do some work with objects. First, make an object named myInfo. Put your credit card number, the 4 numbers on the front, the 3 on the back...I'm kidding. Make an object that has anything you want. Try logging it! Try putting a function in an object and calling it! You now know about variables, logging, functions, comments, AND objects! Stop here and play around a bit. There's a LOT you can write with this. Try creating a few things!
Then, write a comment saying "I'm amazing!". I'm proud of you for getting here. We're ready to start using packages.
We're going to leave this file behind for now. Rename it to "ilearnedtocodehere.js" and come back to it when you're old and laugh at how silly you were back then. In VSCode, import a folder you create JUST for your first yolkbot. We need to get started with some deep and cool concepts.
Let's start by creating a file named package.json. A JSON is like an object in a file that isn't assigned to anything. In this file, just put {}. It'll be automatically added to later!
Now, create a file named bot.js. Leave it alone for now! We're going to head down to the terminal you hopefully still have open, and run:
bun install yolkbot
You've installed yolkbot! Bun should've made a folder named node_modules, a file named bun.lock, and edited package.json to add yolkbot. Please never edit node_modules or bun.lock, it'll cause issues later.
Now, let's edit bot.js to start making a yolkbot! There's one more concept we need to learn, and that's importing things. You can import a yolkbot Bot with:
import Bot from 'yolkbot/bot';
Similarly, for a Dispatch (something we use in yolkbot to command a bot to do something):
import SpawnDispatch from 'yolkbot/dispatches/SpawnDispatch';
Importing something basically makes a variable with our code. When you import Bot, you (basically) import a variable named Bot that I wrote once upon a time that you can use immediately.
In this documentation, we'll tell you what the import statement you need. You don't need to worry about trying to find it.
Now, let's make a simple bot:
import Bot from 'yolkbot/bot'; // creates the "Bot" variable. it's capitalized, which means it's just something that exists
let bot = new Bot(); // this makes a new Bot, and names the new Bot "bot"
You didn't learn about new, but it's not really important right now - just know we use it sometimes to make a new version of something. let bot should look familar - you made a variable named "bot" that is your bot!
Another thing you should note is that some function calls when using yolkbot require await. This just waits for certain things (like querying Shell Shockers' servers) to finish before moving on.
bot is prefilled with a TON of functions that you can learn about in this documentation. For example, you can use what you know about functions to log in anonymously and log the account information:
let account = await bot.loginAnonymously();
console.log(account); // account is an object
And yeah...that's the basics of code! Go back to the Introduction page to start making a yolkbot! If you have any questions, come to our Discord server and ask. We're always happy to help you out!