Jump to content
AliveInMe

[Tutorial] TRiBot API For Beginners

Recommended Posts

Many beginners fail to understand how to navigate API's. Today I am going to show you how to navigate and understand TRiBots documentation.

I. Open TRiBots API by following this link: https://tribot.org/doc/

Your main screen should look like so:

vMMqp83.png

Don't be alarmed it's actually pretty easy to follow! I will begin by discussing the three main sections of our current screen.

II. 3 Section main API page

a) The API Packages: 

UNFNdYg.png

Here is where you can find select classes per package and then broaden your search for a specific class in that package.

*Helpful for import finding!*

For the next screenshot, I clicked on org.tribot.api .

YNzTNdT.png 

b ) Here is where we can search a specific class available from all of the combined packages the API documents has to offer.

bl0Htsy.png

Selecting a class will introduce the methods and descriptions associated with them.

c) Finally, Here is the overview panel where we can use the navigation bar to our liking and also see class documentation! 

CNI8j9U.png

You can search the Class Hierarchy, Deprecated Methods, Index, and Help section!

Importance of the Index section

The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields. Which is helpful for searching a specific method in the API documentation!

For this GIF example, I select the Index section and followed the alphabetical list to search for the getHealthPercent() method.

https://i.imgur.com/JxnRL5p.gif

III. Part A: Class Documentation

For the following information, I will select the class RSNPC   from the classes section shown in  II. b .

Your overview panel should now show the RSNPC class documentation as follows

EOmGwu9.png

 

This is the classes name and associated package.F8iSnR8.png

 

This is the classes implemented interfaces *If applicable*.7TX0uBK.png

Implementing the methods that allow us to get the RSNPC#RSTile, and RSNPC#Click methods.

 

This shows the classes that it extends 7BXLP8k.png

Allowing us to use the methods associated with RSCharacter  Some classes also show the description of the class as shown here .

 

II. Part B: Class documentation Method Summary

Scrolling down will show us the Method Summary .

KVNbspe.png

 

This section shows us the Method & Description and the return types each method returns.

1st column = data type of the method

2nd column = Method and Description of that method

 

Clicking on any of those methods it will bring you down to a more in-depth explanation of the method.

For this picture example I chose RSNPC#getDefinition()

hZvTlg2.png

Marked in RED is the Name

Marked in GREEN is the  DataType, Method Name, and Possible parameters a method could have

Marked in BLUE is the description of the method.

Marked in YELLOW is the return type of the method.

 

 

I hope my tutorial helped some of you. If a topic needs a better explanation, please feel free to address it to me in the comment section.

Thank you,

AliveInMe

Edited by AliveInMe
  • Like 3

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

  • Similar Content

    • By odisey
      Hi,
      I recently got back to Runescape because I was playing with opencv. At first, I wanted to create my own bot (something simple ) but I was amazed by the amount of work that went into Tribot antiban so I decided that I would write some scripts here.

      I used to bot on the powerbot website before 2013 and got really close to max cape back then. I had like 5 skills left.

      It could be fun to give something back to the community that created my main account that is not banned until this day.

      I have some questions if there is anyone who would make time for me.

      1) Could you please share links with some up to date comprehensive tutorial how to write a bot? I don't really code in java but the syntax is quite similar to other languages. However, it would be cool to read some tutorial for an advanced script (something more complicated than clicking tree and dropping logs) so that I could get a better feeling of a file structure, GUI, antiban and decision tree.

      2) Is Tribot color bot? How detectable is the client? I saw that you have something like looking glass? That looks really cool but on the other hand, I saw some scripts working with item ids. Do you detect items on screen or do you read environment information from computer memory?

      3) Are private scripts less detectable than public scripts?
    • By Endvr
      Hi,
      Does anyone have an API for the Grand Exchange they don't mind sharing with me, or giving me a few pointers on creating one myself, as the current TRiBot API seems to be having some issues with Interface IDs
    • By JoeDezzy1
      In the past, I've experienced consistency issues with certain methods in the API that return false/inconsistent information on certain occasions, especially upon logins.
      Here is something I've created a while ago that became very useful to combat that issue.
       
      import org.tribot.api.General; import org.tribot.api2007.Game; import org.tribot.api2007.Login; /** * @author JDezzy1 */ public class LoginAccess extends Login implements Access { /** * The amount of settings in the gamesettings array to confirm consistency * in ingame data */ public static final transient int settingsArrayLength = 70; /** * The ban message upon logging in */ public static final transient String BAN_HOOK = "Your account has been disabled. Please check your message-centre for details."; /* * (non-Javadoc) * * @see scripts.dezapi.wrappers.accessor.Access#access() */ @Override public Class<Login> access() { return Login.class; } /** * @return true if in game */ public static boolean inGame() { final STATE ST8 = getLoginState(); return ST8 != null && ST8.equals(STATE.INGAME); } /** * @return true if at the login screen */ public static boolean inLoginScreen() { final STATE ST8 = getLoginState(); return ST8 != null && ST8.equals(STATE.LOGINSCREEN); } /** * @return true if at the welcome screen */ public static boolean inWelcomeScreen() { final STATE ST8 = getLoginState(); return ST8 != null && ST8.equals(STATE.WELCOMESCREEN); } /** * @return true if there is a ban message */ public static boolean banMessage() { final String response = Login.getLoginResponse(); return response != null && response.equals(BAN_HOOK); } /** * Does what it says * * @return Game setting.length > ~70 plus all other hooks */ public static boolean isEverythingFuckingLoadedAndReadyToBeRead() { return !inWelcomeScreen() && inGame() && Game.getGameState() == 30 && Game.getSettingsArray().length >= settingsArrayLength; } /** * @return true if the login was successful */ public static boolean waitLogin() { return Waiting07.waitCondition(() -> { return isEverythingFuckingLoadedAndReadyToBeRead(); }, System.currentTimeMillis() + General.randomSD(35000, 45000, 4250)); } /** * @return true if the logout was successful */ public static boolean waitLogout() { return Waiting07.waitCondition(() -> { return inLoginScreen(); }, System.currentTimeMillis() + General.randomSD(35000, 45000, 4250)); } /** * * @param user * @param pass * @return */ public static boolean handleLogin(final String user, final String pass) { General.println("Login => attempting login => " + user); if (login(user, pass)) { General.println("Login => waiting for login..."); if (waitLogin()) { General.println("Login => logging in => successful login"); return true; } } return false; } }  
    • By CyberSecurity
      I want to start a gold farm from scratch. I have no experience whatsoever. I want to learn how to use different proxies for each account and how to manage them all.
    • By namzug
      Hi guys. This is my first time posting here since I just made an account today. I am a VIP user and am trying to get local scripts to work. I'm having trouble working with the API.
      I folllowed the instructions but the tribot jar file I downloaded does not seem to have the same classes available. For example,
      I tried copying this script into Intellij. I added the jar file as a dependency but there is no "org.tribot.api" import in that jar file. Am I using the the wrong version or something? I attached some pictures of what I'm getting in Intellij. Any help for a newbie would be appreciated.
      Thank you guys!



    • By Marinodude
      Looking to start writing scripts for Tribot. I have decent experience with Java in the past and I am looking for the resources that a beginner like myself can learn how to write decent scripts! I am interested in mainly writing public scripts for now if I get any good at it, then I may have interest in writing private ones. I thought it would be something neat I could do in my free time.
      Thanks for your time guys.
    • By VapeGod
      Hello! I really want to get into making scripts for personal use as well as for tribot! I'm usually pretty good at picking up new things and have always found it really interesting to watch bots work! The downside to me starting this and the only thing that has stopped me is I don't have half a clue where to start. At all. The only coding related thing I've ever done was I played a minecraft mod that had a pc in it where you could write some kind of code to do various things like opening a door attached to it when you type certain things, ect. Which yes, I know that is absolutely nothing like real coding, so that's why I'm here. Where should I start? Where do I even write said code? What should I watch or listen to learn how to code? I highly dislike reading books as they can't keep my attention so that is really not a viable option for me. Normally I wouldn't go for help I would just try to learn on my own, but this time I want scripters from tribots help! Any and all help is appreciated!
    • By Fluffee
      Fluffee's Ultimate Guide to Botting: Part Three - All About Servers
      Welcome once again to Fluffee's Ultimate Guide to botting series. If you haven't already read part one or part two, please do so here (https://tribot.org/forums/topic/62462-tutorial-fluffees-ultimate-guide-to-botting-part-one-account-creation-and-management/) or here (https://tribot.org/forums/topic/62766-tutorial-fluffees-ultimate-guide-to-botting-part-two-all-about-proxies/)
      --What are servers?--
      In a general sense, a server is much like your own home computer, except they are setup for doing different things. In some cases, servers are used to run web sites, office/school networks or running an email service. And as a result of this, companies have began to rent servers out to people, allowing those people to use the companies servers to run websites, maintain an email service, etc. without actually owning a server themselves. Years ago, RuneScape botters realized that these very same servers would allow them to run their bots around the clock without leaving their home PC on all the time. As a result, you now see many people buying Dedicated Severs and/or Virtual Private Servers to run their RuneScape bots.
      --What are Virtual Private Servers?--
      A Virtual Private Server, or VPS as they are commonly referred to, are virtual servers which you pay a monthly fee to have access to. These Virtual Servers allow you to run your bots 24/7 without leaving your computer on, as the bots will run in the Virtual Server and not your home computer. The reason Virtual Private Servers are so common in the botting community is that they allow users to run their bots while their computer is turned off, and they're relatively inexpensive (around $10 per month, depending on the plan). One of the major drawbacks to a VPS, is that the server you're paying for access to is not a real server, but rather a virtual one created on a real server. The issue with that comes from companies overselling their Virtual Private Servers, essentially they sell more Virtual Private Servers on a real server then what the real server can actually handle, which results in poor performance for running bots. There is no real way to avoid this when purchasing a Virtual Private Server except by purchasing a server from a trusted provider hoping that they won't oversell.
      --What are Dedicated Servers?--
      Dedicated Servers are very similar to Virtual Private Servers, they come with similar operating systems, you access them the same way, and they allow you to do the same things. However, a Dedicated Server outclasses a Virtual Private Server in one key aspect. A dedicated server is a server, which again you pay a fee to access, but this time you're paying for access to a physical, real server that the company owns and maintains. As a result of this Dedicated Servers are much more expensive, but you pay for the reassurance that you get access to what you advertised, with no overselling what so ever. If you're a serious goldfarmer a Dedicated Server may be for you, and some people swear by them, but if you're new and just looking to get your feet wet a VPS is more then enough for what you'll be doing!
      --Why should you use a server of some kind?--
      As I've stated above, the most common reason for anyone to use a server over just running bots on your home PC is the ability to go to bed, turn off your computer and have your bots still running in the background. Another great thing, which I personally love about using a Server is the ability to easily measure the costs of your gold farm versus the profits. Using your home PC to run bots is not free as you do have to pay for power consumption, and I hate not being able to accurately measure that cost. Although that's just me, I'm sure someone will probably feel the same!
      --How do I setup my server for use with TRiBot?--
      I could post an entire guide on how to do this, and actually I have For anyone who's new to servers, and wants a quick and easy way to set them up, check out my guide below, which was updated March 6th, 2016; so yes it's extremely up to date!
       

      --How do I effectively manage multiple servers?--
      There's two methods I will propose, and it's up to you how you would like to use them! The first method, as many can expect is a spreadsheet (I love spreadsheets). This spreadsheet, like my others is self explanatory, and has fields for the Server IP, VNC and SSH ports, root password, vnc password and user account password and a description of what runs on the server. However, the one downfall to this is that you can't click on an IP and connect to your server, but that's where RealVNC comes in. To download RealVNC head over to this link https://www.realvnc.com/download/vnc/ and download the full VNC package. During the Install you can uncheck the box for the VNC Server, as you won't need any of that.
      Once RealVNC is installed, head to the RealVNC install folder, and open up the VNC Address Book. From there open up the New Entry Dialogue

      Enter in your server IP and Port into the VNC Server field, uncheck the box for Username, and check the box for Password, then enter in your VNC password. Then press OK. You should then see this dialogue box, where you are prompted to enter a Master Password to protect your address book, so go ahead and do that as well!

      Once that's done, you'll see something like this. From there, right click on your newly added VNC Server and you can rename it to make it more recognizable if you'd like

      And you're done! You now have your first Server added to the Address Book, which makes life incredibly easy as you can just double click to connect! Congrats
      --How to manage files on your VPS?--
      Note: This section of the guide assumes you are not using SSH keys to connect to your server.
      There's a couple of ugly, quick and dirty methods to transfer files, such as uploading to Dropbox, or some equivalent and transferring files that way. However, there's a much better method that'll I'll be showcasing today. To begin with download WinSCP from here: https://winscp.net/eng/download.php
      Once WinSCP is installed, or downloaded, go ahead and run it. You should be brought to a screen similar to this

      To setup WinSCP to connect to your server, go to the right hand side and change the protocol to SCP (this is a protocol built off of SSH, which means you won't need to install anything extra on your server. After that, type in your server IP address into the field labelled "Host name", and then enter the Port you use to connect via SSH into the "Port number" field. Finally, enter in your SSH username and password; then hit Login or Save (If you wish to).
      Assuming you entered everything correctly, you should connect to your server and be able to Upload and Download files through the WinSCP interface.

      --How to Sync your .tribot Folder across multiple locations?--
      Due to the length of this particular part of the tutorial, I've decided to move it to it's own topic which you can find here
      Shoutout to user @HackRain for inspiring me to figure this out.
      And that about brings this segment of the guide to the end, to overview, we've covered what a server is, the different types of servers you can use, should you use a server, and then how to effectively use and manage those servers. I hope you've enjoyed, and learned something from this lengthy guide, be sure to keep on the lookout for Part 4
       
  • Our picks

    • This update will:

      Fix GE inventory item positioning bug


      Fix broken object hooks
      • 21 replies
    • This release will:

      Fix some ClosedChannelException bug


      Fix bug in RSObject#getAllTiles


      Add game tab support for "Kourend Favour"
      • 15 replies
    • This release will:

      Fix Settings UI placement bug


      Fix game object location bug


      Fix small layout bug making the client shift up and down


      Fix client crashing bug where loading the client with a small display area will cause the client to crash


      Fix annoying Linux bug relating to painting events and peers


      Fix settings saving bug where settings are saved to disk more often than they should


      Fix RSInterface#isBeingDrawn bug affecting a limited amount of people


      Drop Java 1.7 bytecode version for 1.8


      Important: Since the downloadable RS client uses Java 7, it will no longer be compatible with Looking Glass. To make up for this, we will add support for using other clients such as RuneLite (at a later date).


      This change was necessary to allow us to use Java 8 syntax. It also paves the way for Java 9/10/11 support.
      • 40 replies
    • This update will:

      Fix the RSMenuNode bug which also fixes the bug with bank opening


      Fix the incorrect object positions bug


      Fix and re-enable the LG Objects API Accelerator


      Fix the RSObject#getAllTiles bug
      • 22 replies
    • Try our development release by checking "Development Release" on the TRiBot Loader. Note that these new features are currently in beta.

      This release features:

      Re-sizable mode support for both LG and the regular client


      Slightly improved login bot


      Removed final access modifiers from API classes


      Added RSServer hook wrapper to get the client's cached list of server/world info


      [NEW] Bug fix for intelligent banking


      [NEW] Improvement to the stability of LG over time


      [NEW] Vastly improved the reliability and speed of Screen#getColorAt on both LG and the regular client


      [NEW] Fix LG login problems


      [NEW] Fixed re-sizable mode container bug


      [NEW] Fixed re-sizable mode mouse bug


      [NEW] Use of public constants in the Banking API


      [NEW] Use of other various constants such as Projection#NULL_PT and Screen#EMPTY_COLOR



      More features to come very soon!

      Please test it and let us know here if there are any new bugs introduced in this release.
      • 12 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×