Jump to content
Sign in to follow this  
Boolean

Boolean's full eclipse set-up tutorial (mac OS)

Recommended Posts

boolean's ultimate eclipse set-up (mac OS)


 


Here's the way to set up your eclipse with the bot, both for mac as for windows.


 


Things you'll need in advance:


 


The eclipse IDE


 


http://www.eclipse.org/downloads/


 


The latest tribot jar file


 


https://tribot.org/download.php


 


The latest version of java JDK.


 


http://www.oracle.com/technetwork/java/javase/downloads/index.html


 


 


Mac OS:


 


Install eclipse. When you open it it asks you to give in where you want your workspace. Choose where-ever you want. (mine's in documents, it doesn't really matter).


 


Okay so now eclipse opens, and I believe there's some kind of tutorial, you want to skip that, and go straight to the workbench. It should look something like this:


epgc.png


 


of course you won't already have a tribot file. But we are going to add that now.


 


In the package section, right click with your mouse and select new -> java project


dmrb.png


 


Nam the project however you want, i'll name mine TribotScripting.


after that you want to uncheck 'use default location'. because if we would use the default location your scripts would be saved in your workspace, and not instantly in your bot folder, so if you'd do that you'd have to transfer your scripts from your workspace to the tribot file every time you compiled your script, which is a lot of unnecessary work. We want to set it to the location of the tribot folder. This folder gets constructed automatically when you launch the tribot.jar for the first time. 


But where can we find this folder? (You need to know where this folder is if you want to add scripts you haven't written yourself).


i45t.png


 


There are a few ways to get there on a mac computer.


By directories:


go to: User > library > application support > tribot.


Here's where we have the tribot file.


 


BE WARE:


Mac often sets the 'library' folder in your User folder to invisible. If you can't see your library folder, there are 2 things you can do.


 


method 1: Set the library folder to visible:


I'd suggest you go to this tutorial: 


http://www.wikihow.com/See-Hidden-Folders-on-Mac-OS-X-and-Other-Recent-Models


 


method 2: Open the folder trough terminal


This is fairly easy, just open your terminal and write down this:


k9xh.png


 


Your folder probably does not have the SRC file already, but we'll get to that later.


What you can do to make things easier is just make an alias of the tribot folder and store it on your desktop or something.


hwod.png


 


Okay So now that we know where our tribot folder is, we're going to use the directory of the folder to set the location of our java project. Which for me would thus be: 


 


'/Users/*USERNAME*/Library/Application Support/tribot'


jpqs.png


 


After that click next. You'll get a window that looks somewhat like this: (I can't show you exactly how you have it because my tribot is already set-up with eclipse)


70qo.png


 


alright so under the 'Source' section. You won't already see tribot/src like I have, but we're going to create it now. click on 'add folder'


A new window will ask you to select your source folder. If the 'src' folder is not there, just click create new folder and name it 'src'. Then select it en press finish or okay.


bscr.png


 


 


 


 


Now we go to the Order and Export tab, and we're going to check everything we have in there.


n5ay.png


 


Now you can click finish, and your project is created. :)


 


 


Now what we still need to do is this:


click on your project and select new > package. make sure it's under the src folder. (like on the image). Then name it 'scripts' And press okay.


6jpb.png


 


 


In this scripts package is where your future scripts will be! if you want to create a new script, just right click on the scripts package in your project and select new > class


a6rm.png


 


Now that you have a new class file, this is where your code would go. If you want to test if everything works now I suggest you copy this into your first little script, (it's the basic skeleton)



package scripts;
 
import org.tribot.script.Script;
import org.tribot.script.ScriptManifest;
 
@ScriptManifest(authors = { "Boolean" }, category = "Woodcutting", name = "woodcutter")
public class test extends Script{
 
 
 
@Override
public void run() {
 
println("hello world");
}
 
 
}

like this: 


spdf.png


 


Note that if you just copy my code, your class name should be the same name as your .java file.


More detailed: see how 'public class '''''test'''' extends script is the same name as the .java file '''''test'''''.java under the scripts package. This must be the same or the script won't compile. Save your script.


 


 


Go ahead and open your bot now, open your scripts folder in your bot. Do you see your script? probably not. because the script has not been compiled yet. in other words: there has not yet been made a class file of your .java files. This means that although you have given in the code, your computer has not done anything with it yet, and we'll need to fix that.


 


back in your eclipse, you want to go to eclipse > preferences


pzk7.png


 


then you want to go to the section 'workspace' and check build automatically. What this does it that your script will now automatically compile when you click save in eclipse.


jp7u.png


 


Open your scripts folder again, your test script should now be visible under the section woodcutting or whatever section you chose. Try running it and it will print 'hello world" in the console. After that the script stops.


 


The 'build automatically' allows us to go to eclipse whilst the bot is still open, and just change whatever you want in your script. Lets say we'll change "hello world" to "hello tribot". Just press save and rerun your script, the console will now print "hello tribot".


 


Because it's compiling so fast and easy, this is a really good way to fix little things in your scripts. Instead of opening and re-opening the bot we lose less time because we just have to press save to compile! Which spares us a lot of time.


 


 


That's about it, I hope you get your bot to work and that everything is clear to you now. Thanks for reading!


 


  • Like 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
Sign in to follow this  

  • Our picks

    • This update will:

      Fix GE inventory item positioning bug


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

      Fix some ClosedChannelException bug


      Fix bug in RSObject#getAllTiles


      Add game tab support for "Kourend Favour"
        • Like
      • 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.
        • Like
      • 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
        • Like
      • 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.
        • Thanks
        • Like
      • 12 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×