Jump to content
odisey

Up To Date Scripting Resources For Beginners

Recommended Posts

Posted (edited)

Hi,
I recently got back to Runescape because I was playing with opencv. At first, I wanted to create my own bot (something simple :D ) 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?

Edited by odisey

Share this post


Link to post
Share on other sites
Posted (edited)

Welcome!

Here's a good one:

Checkout other threads in the scripting tutorial section:
https://tribot.org/forums/forum/43-scripting-tutorials/

Searching for open source scripts will also be helpful.

TRiBOt is reflection.
In theory private scripts have less users, so less data for Jagex to examine, so safer.
But IMO a well written script is a well written script, doesn't matter if it's private or not.

Edited by YoHoJo
  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, Naton said:

I would try to learn a bit of java before trying to apply it to scripting but not necessary I guess

I don't think that is necessary. There are differences but other than that when learning a new language and writing something simple - which scripting should be - it is just about the syntax and file structure. I know a bit of C++, php and javascript (nodejs) and I recently had to work on a project in javascript/ruby. I hope I am right :D otherwise no scripting for me.

Share this post


Link to post
Share on other sites
9 hours ago, YoHoJo said:

Welcome!

Here's a good one:

Checkout other threads in the scripting tutorial section:
https://tribot.org/forums/forum/43-scripting-tutorials/

Searching for open source scripts will also be helpful.

TRiBOt is reflection.
In theory private scripts have less users, so less data for Jagex to examine, so safer.
But IMO a well written script is a well written script, doesn't matter if it's private or not.

I love the Intelliji setup thanks. :)

Share this post


Link to post
Share on other sites

Im a firm believer that Looking Glass really helps in not being detected. others disagree, but ive botted for many years now.

 

Obviously private scripts will have less ban rate as they will do things that are different than the scripts that are open to public. to take it a step further to use a private script in an area that is not botted or has minimal bots will decrease ban rates much more. 

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 NeuroGenix
      Post rewritten after rewritting and updating the code multiple times.
      So I decided to give writing my own GE API a go and this is what I've come up with so far, using Exchange#offer(name, price, quantity, buy) will do the following:
      If the GE is closed, it will open it and continue making the offer. If the price is set to -1 then it will use the buttons to increase or decrease the price, depending on whether it is a buy or sell offer, until it is at a price that will buy/sell instantly. Otherwise it will use the custom input button to set the price. It will set the quantity using the 1/10/100/1000 buttons. I plan on updating this to randomise between using them and the custom input method shortly. Edit* I hadn't even remembered implementing this until I saw it do it whilst testing the method, and it was beautiful, but if it goes over the buy quantity accidently, in the example I saw it was clicking +100 and clicked it again too fast so instead of stopping before its target of 875 it got to 900, it will then use the custom amount interface to input 875, beautiful. It will prioritise buy offers over sell offers so that if there isn't an empty slot available, or any items to collect, then it will cancel a sell offer, collect it and continue now it has a free slot. If there isn't a free slot available and we are trying to sell something it will return true, this is so that in my scripts it will remove the item from a toSell HashMap and put it back into the bank to sell later because it has bought the items it needs to continue botting. If it is instead trying to buy something and there are no empty slots or sell offers to cancel then it will wait for something to buy and continue once it can collect something and therefore has an empty slot. Update* It will now search for the item 1-3 words at a time checking the first 9 results each time and will choose the item as soon as it is visible as a human would. I might update this so that it randomises more, sometimes entering the whole first word of an items name straight away, because I sometimes do that, most of the time though I enter as few characters as I need to, I think, thoughts? Let me know what you think, the code is probably disgusting to look at for some of you but for others just starting out like me it could be a valuable learning tool, for how not to code All feedback and constructive criticism appreciated.
      Exchange Class
      GEInterfaces Class
      GEConditions Class
      InfoHelper Class
      Thank you to everyone that has read this far, it is appreciated
      Rewritten, if you have read again, even more appreciation!
    • By zoxind
      I've written my first, I would say for now basic script for combat training. 
      One of the main reasons why I chose to use Tribot is because of abc2. But while reading the post on the tutorial on how to implement it in your own code (
      ) I didn't really understand the method(the way) on how to implement it in code. 
      Could anyone please send me a personal message with an explanation on how to implement it correctly, or write a reply here.
      It would be very nice, if you would include an actual code example of it, that would help me to understand it better.
      Thank you in advance.
    • By JordiLaFjord
      Hey.
      Just trying to right click make all on the gold bracelet interface. Most recent thing i've trid is getting the RSInterfaceChild braceInterface = Interfaces.get(446,47); then calling it as braceInterface.click("Make-All");
      I've tried a few other things from the forum that I can't thing of atm, so any help would be appreciated.
    • By AliveInMe
      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:

      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: 

      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 .
       
      b ) Here is where we can search a specific class available from all of the combined packages the API documents has to offer.

      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! 

      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

       
      This is the classes name and associated package.
       
      This is the classes implemented interfaces *If applicable*.
      Implementing the methods that allow us to get the RSNPC#RSTile, and RSNPC#Click methods.
       
      This shows the classes that it extends 
      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 .

       
      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()

      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
    • By we trippy mane
      Looking glass really helps prevent bans. They updated it though so it took me 3 hours to set it up this time while way back it took 10 min max. The issue was 32 vs 64 bit version's of everything. my guide if you want to start looking glass. Link looking glass with osbuddy. Get's complicated. did you download the 32 bit version of osbuddy? Also the 32 bit 102 jdk? and Are you opening tribot with jdk? also make sure you have 32bit version of java. Took few hours for me to figure this out. I had to delete literally everything and redownload everything the right way to make it work. Also fluffee's advice helped me. His thread is
      So here's 
    • By Fluffee
      Fluffee's TRiBot Account Adder v1.00 (Coded in AutoHotKey)
      I was getting sick of adding accounts manually, so I coded this in AutoHotKey. It reads account usernames, passwords, bank pins and rewards from a text file. As well as reading the world you want the account to use from a separate file (so you can loop the f2p worlds).
      To run the program, create a text file for your account formatted as follows:
      AccountUsername:Password:BankPin:Reward
      (e.g. Zezima:hacked:0000:Agility)
      You can leave out the Bank Pin and reward by just not including them, however rewards will not work without a bank pin.
      To format the worlds list, make a list as follows:
      383
      393
      394
      etc.
      I'm aware this will probably be buggy as I coded it in like 20 minutes at 1AM, but hopefully it works for some!

      To start the bot:
      Load up Fluffee's TRiBot Account Adder.exe, or .ahk whichever, insert the full path to your files (i.e. C:\Users\John\Desktop\Accounts.txt)
      Hit Start to save the paths
      Then Open TRiBot, go to the Account Manager, hit Add then hit F1 on your keyboard (F1 is the hotkey)
      Message me with any problems you have, it does work! Well it should anyways!
      NOTE: If you do not have AutoHotKey installed, download the .exe
      Hope it helps
      Virus Scan of both files:
      .exe https://www.virustotal.com/en/file/2267c37e5e2c19ab08f4bc545e3d6b8eed663d0894f2f9ecf61562f325695c54/analysis/1433995283/
      .ahk https://www.virustotal.com/en/file/6fccaa5fe5f1a7eb70396c4b65e7de1e20fd144af90fccf686fe2587be550476/analysis/1433995293/
      AHK - https://drive.google.com/open?id=0B8etMDADCUvKdFBnQnFjaXFnc1E
      EXE - https://drive.google.com/open?id=0B8etMDADCUvKdVozUE9JVjFCbzg
      Code - http://pastebin.com/H2U4cRC5
       
    • By Forsteen
      Hey,
       
      I'm making my own script and I want to check if there are any players within a certain range of me. I'm hoping this can be done using the Players part of api2007, using something like getAll() with a filter. The problem is, I don't know anything about filters, and I can't find any documentation of it except a post here on tribot explaining the concept, not how to actually use them. Could anyone either explain how to use filters or link me something which I can learn from? That would truly be great.
      EDIT - I just found the page specific to Filters.Players. This seems good enough for me to figure out.
      Thanks!
    • By Guki
      One of the most advantageous things you can do in programming is D.R.Y. (Don't Repeat Yourself!) 
      In our scripts, we can practice this by centralizing certain data constants within Enums, and adding in helper methods that will shorten our functioning code and create a level of abstraction that will make script maintenance a breeze.
      For this tutorial, I will just be showing a simple Item enum:
       
      public enum Items { LEATHER(1741), HARD_LEATHER(1743), GREEN_LEATHER(1745), BLUE_LEATHER(2505), RED_LEATHER(2507), BLACK_LEATHER(2509), COINS(995); private final int ID; private Items(int id) { this.ID = id; } public int getID() { return ID; } public int getNotedID() { return RSItemDefinition.get(ID).getNotedItemID(); } public RSItemDefinition getDefinition(){ return RSItemDefinition.get(ID); } }  
      This is for a Tanning script. As you can see, we name each constant by its full name to avoid naming collisions/confusion. 
      In an Item enum, the only required data is a Unique ID for each item. With this, we can create several helper functions that might be specific to the script., but the above is a good base for about any script.
       
      "Why not just use item id's and the standard API's methods you idiot? This is a waste of time..."
       
      As I said before, the above is a very introductory example, but here is a more complex application of the above idea using Interfaces.
      public enum Interfaces implements Clickable { TANNING_SOFT_LEATHER(324, 124), TANNING_BLACK_LEATHER(324, 131); private final int PARENT; private final int CHILD; private final int COMPONENT; private Interfaces(int parent, int child, int component) { this.PARENT = parent; this.CHILD = child; this.COMPONENT = component; } private Interfaces(int parent, int child) { this.PARENT = parent; this.CHILD = child; this.COMPONENT = -1; } private Interfaces(int parent) { this.PARENT = parent; this.CHILD = -1; this.COMPONENT = -1; } public int getParent() { return this.PARENT; } public int getChild() { return this.CHILD; } public int getComponent() { return this.COMPONENT; } /** * Check whether or not the interface is not null, and not hidden * * @return true if interface is open and visible, false if null, false * if hidden */ public boolean isOpen() { /* Null check Interface tree in descending order*/ if (org.tribot.api2007.Interfaces.get(PARENT) == null) { return false; } if (CHILD != -1 && org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD) == null) { return false; } if (COMPONENT != -1 && org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).getChild(COMPONENT) == null) { return false; } /* Component.isHidden() check on Interface tree in ascending order*/ if (COMPONENT != -1) { return !org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).getChild(COMPONENT).isHidden(); } if (CHILD != -1) { return !org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).isHidden(); } return !org.tribot.api2007.Interfaces.get(PARENT).isHidden(); } /** * Attempts to click the interface component using the given option * * @param option the option to click on the component * @return true if we clicked the component, false otherwise */ @Override public boolean click(String[] option, Point randomness, Point offset) { if (isOpen()) { if (COMPONENT != -1) return org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).getChild(COMPONENT).click(option, randomness, offset); if (CHILD != -1) return org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).click(option, randomness, offset); return org.tribot.api2007.Interfaces.get(PARENT).click(option, randomness, offset); } return false; } @Override public boolean click(String... option) { return click(option, null, null); } @Override public boolean click(String option, Point randomness, Point offset) { return click(option, randomness, offset); } @Override public boolean hover() { return hover(null, null); } @Override public boolean hover(Point randomness, Point offset) { if (isOpen()) { /* Component.isHidden() check on Interface tree in ascending order*/ if (COMPONENT != -1) return !org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).getChild(COMPONENT) .hover(randomness, offset); if (CHILD != -1) return !org.tribot.api2007.Interfaces.get(PARENT).getChild(CHILD).hover(randomness, offset); return !org.tribot.api2007.Interfaces.get(PARENT).hover(randomness, offset); } return false; } } Now as you can see this is far more useful in code.
      We can overload the constructor method of the enum to accept all types of interface components from Parent to Children, to Components. This allows us to directly path to the component we want, similar to org.tribot.api2007.Interfaces.get(int parent, int child). Also, we can implement the Clickable interface to get access to all mouse functionality commonly used within scripts, meaning we can now SAFELY click interfaces within our scripts like so:
      Constants.Interfaces.CONSTANT.click() There are other things this can be applied to such as NPCs and Objects, but I will let you code your on versions of those

      An easy way to manage all of your scripts constants (assuming it is a reasonable amount of code, under 500 lines) is to put all of your enums inside of a Constants class. This will allow you to easily manage imports and give access to all your constants with one import. 
       
      Thank you for taking the time to read this and if you have any questions, comments, concerns, flame, trihards, or otherwise feel free to reply or send me a PM and I will get back to you ASAP.
       
      -Guki
  • Our picks

    • This release will:

      Add support for using custom F key bindings to switch between game tabs (Thanks @erickho123)


      Fix tab opening for "Skills" and "Kourend Tasks" (Thanks @erickho123)



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 30 replies
    • This release will:

      Fix an issue where breaks would stop firing


      Fix Combat#getWildernessLevel, use dynamic search for text and cache ID for later calls


      Fix an NPE in the Combat API


      Fix Mouse#leaveGame bug where the mouse wouldn't actually leave the game screen
        • Like
      • 21 replies
    • This release will:

      Add LG support for Runelite


      Fix NPCChat issues


      Fix a bug where the camera angle setter would just hold down a key for 5 seconds (the timeout)


      Slightly adjust the rotation via keys to be more accurate


      Add the ability for asynchronous camera movement via keys


      Make Camera rotation via mouse more fluid, with more antiban, and work much better in resizable mode


      Add a "Camera#setCamera" method, allowing the rotation and angle to be set in parallel


      Increase the likelihood of using the mouse for camera movements


      Add support for adjusting the camera to positionable entities (Positionable#adjustCameraTo)



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Thanks
        • Like
      • 59 replies
    • This update will:

      Allow for clicking through the chat box when possible (Thanks @Todd)


      Fix Combat#selectIndex (Thanks @Encoded)


      Ensure worlds stay sorted and added a check to avoid misclicks in the in-game world hopper (Thanks @erickho123)


      Fix out-dated Options API interface indices (Thanks @Todd)



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 12 replies
    • This release will:

      Fix login bot after today's game update (Thanks @JoeDezzy1)


      Fix latest in-game world hopping issues (Thanks @erickho123)


      Compact Settings UI and set location relative to TRiBot (Thanks @JoeDezzy1)


      Fix an older implementation of GrandExchange#getWindowState (Thanks @JoeDezzy1)


      Improve the preformance of NPCChat by only searching in certain interface parents (Thanks @JoeDezzy1)



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      LG support for RuneLite


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Thanks
        • Like
      • 16 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×