Jump to content
TacoManStan

[Tutorial] Learning Java with TRiBot #1 - The Very Beginning

Recommended Posts

Leaning Java with TRiBot - The Very Beginning
Click Here for a List of All Tutorials

eQ4FCso.png

If anyone would like to provide any advice or feedback on the tutorial, please message me on DiscordI want to keep the comments to questions as much as I possibly can, so people can learn not only by reading the tutorial, but also reading the rest of the thread. Thank you!

eQ4FCso.png

Introduction

Hello everyone! If you are reading this, you want to script for TRiBot, but you don't have any experience with the Java programming language. To that I say... welcome! You are not alone.

Let's first start off by saying that yes, in order to script for TRiBot, you must know Java. If you're here, I'm sure someone has probably already told you that, or you figured it out for yourself. That being said, there is nothing to fear! While it was highly discouraged until now, with this tutorial guide you can now learn Java through scripting for TRiBot!

Before we jump right into things, let's make something clear; this isn't an instant journey. You need to learn Java, not just copy some code. This is going to take some time. Luckily, I've been told that I'm pretty good at explaining things, because I remember how it felt to be new to Java. Every tutorial you look at seems to assume that you have at least some coding experience.

your-face-when-programming.jpg

That's not the case with this tutorial/guide. That being said, that means that it is important that you read the entire tutorial. Everything I type here is here for a reason. Don't skip things, you'll just wind up getting confused, and you'll regret it later on.

With that in mind, I have decided that I'm going to start at the beginning. The very beginning. Now let's get started!

Introduction 1.5

I lied. We're not getting started just yet. One more quick thing first.

There might be words that you don't know the meaning of in this tutorial. You might not be from the US (lingo is a bit different), or you might just not know the meaning. Every word that I think anyone reading this might not understand, I will turn into a link to either the dictionary.com or wikipedia.org definition of the word. That being said, I'll do my best to keep the language simple. Tutorials are easier to read that way anyways, even if you do understand the language.

Alright, now let's get started!

The Very Beginning

At this point, most other programming books dive right into the nature of a computer. They'll talk about RAM, CPUs, and other acronyms that you may or may not understand. That doesn't matter. At all.

Instead, I'm going to start by explaining what Java is. Chances are you already know what programming is. If you don't here's a quick definition: "You write words that make the computer do things that you want it to." That's all you need to know about programming right now.

What is Java?

Java, as you have probably guessed, is a programming language. More specifically, Java is an object oriented programming language. I intentionally left no link there, because Wikipedia over-complicates things, and therefore I'm going to define it myself.

What is Object Oriented Programming (OOP)?

When you think of object oriented programming, the easiest thing you can do is think of a car. What just popped into your head? A Mustang? An Avalon? A Focus? A Prius? A Camry? Chances are, pretty much everyone thought of a different car. That right there is object oriented programming.

You're probably thinking "wut...?" That's the beauty of it; it's really that simple. Of course, I need to elaborate a bit on that bit. (Note: Let's get something clear. I used this as an example, an I don't really know anything about cars. Okay, moving on.)

OOP (remember that stands for object oriented programming) is all about taking the most basic form of something, and then getting more specific as needed. So in that example, we started with a car. You can get more specific than a car though. You can have a Mustang, Avalon, etc. That's getting more and more specific.

434506ffe6.png

In fact, if we wanted to break it up even further, we could add different types of cars in the middle, such as "coupe", "sedan", etc.

94511c1521.png

You can also go in the other direction as well. What's more simple than a car? How about an automobile? Now all of a sudden you have trucks, cars, motorcycles, etc.

e81d5f24e7.png


How Far Up Can You Go?

When you program in Java, you create things called objects. In the previous example, the "car" was an object. The "automobile" was an object. The "Prius" was an object.

Remember when I said that the goal in Java is to get as specific as you can? Well, what's the starting point? If you were to take "car", "automobile", "goat", or anything else you can think of, and you were to keep going up and up and up, getting less and less specific, where would you end up?

The answer to that question is: Object. You would end up with an Object.

f0e5d758d8.png

This is the case for everything you do in Java. The entire concept of programming revolves around creating objects. In RuneScape terms, you might want to get access to a tree, or an NPC, or your own player. As you probably guessed, each of those things, and anything else you can think of, is an object.

Conclusion

This is the end of the first installment of my Learning Java with TRiBot tutorial series. This first section was obviously just the very beginning, and there wasn't even any code! That's okay; you'll be seeing plenty of code soon enough, and you'll be scripting for TRiBot (and writing other Java programs as well, if you want) in no time!

Note that if people seem interested in this concept, I'll probably make videos to go along with my written tutorials as well!

eQ4FCso.png

If there is anything you don't understand, please let me know! If you didn't understand it, chances are someone else didn't either.

Click Here for Tutorial #2!

Edited by TacoManStan
  • Like 16
  • Thanks 1

Share this post


Link to post
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

  • Our picks

    • This release includes:

      Fix shift clicking option selecting


      Fix high paint delay settings saving


      Update prayer IDs for the quick select menu


      Remove RS3 support


      Fix hooks



      RS3 Support Removed

      The RS3 client hasn't been updated since our Old-School version of TRiBot was released, as many of you may have noticed. Keeping all of the RS3 code in the client made the client as a whole harder to maintain, larger, slower, and messier. As hardly anyone still uses the RS3 client, and since the RS3 API was hardly functioning, we made the decision to completely remove it from TRiBot.

      For the average user, this means that the client will be smaller, cleaner, and faster. Future updates will also take less work meaning there will be more frequent updates.

      If you were one of the few users still using the RS3 client, we apologize for the inconvenience. No future support for RS3 is planned. There are many other botting clients which has support for RS3, so we recommend finding an alternative if you wish to continue botting on RS3.
        • Thanks
        • Like
      • 22 replies
    • Please welcome our new developers, @JoeDezzy1, @erickho123, @Encoded, and @wastedbro.

      These members will be responsible for working on, maintaining, and improving TRiBot.

      This means that bug fixes and improvements will now come at a much faster pace! We're committed to providing users with the best botting experience possible!
        • Thanks
        • Like
      • 30 replies
    • This release includes:

      More 3rd party libraries for script writers to use


      Apache Commons Codec


      Apache Commons Collections


      Apache Commons Configuration


      Apache Commons IO


      Apache Commons Lang


      Apache Commons Math


      GSON


      Guava


      JFoenix




      Hint arrow API


      Game#getHintArrowX


      Game#getHintArrowY




      Fix player hooks including Player#getSkullIcon and Prayer#getPrayerIcon
        • Thanks
        • Like
      • 49 replies
    • This update includes:

      Fix broken hooks


      Fix login bot for the message "No reply from login server. Please wait 1 minute and try again."


      Fix bug relating to which bot tab is sent human input


      General#randomLong bug fix involving negative numbers


      Fix GE API



      Please note: There are still some issues with the login bot due to a change in the game mechanisms handling the login screen. We're working on a fix and will upload it when ready.
        • Thanks
        • Like
      • 37 replies
    • This release will:

      Fix key event handling issue


      Fix other event handling issue


      Fix RSServer hook


      Update world hopper to have it use OCR, thanks to Todd


      Use proper disposal of old Graphics objects


      Reformat code


      Rearrange code


      Organize code imports


      Apply around 8000 automated code refactorings


      Make preparations for Java 9


      Fix 11 various bugs


      Add more reliable debugging support


      Fix mouseEntered/Exited event dispatching bug


      Fix minimap walking bug where it opens the map


      Fix broken hooks for today's game update
        • Thanks
        • Like
      • 100 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×