Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Nvox

Nvox's AIO Chopper | New scripter

10 posts in this topic

Hi my name is NvoX(Sam),
 
I am an Apprentice Programmer/Web developer in real life. The main languages i focus on is Php, HTML, AJAX , , etc..  but i have always botted runescape since RSBot came out and have always enjoyed someone doing it for me but i got bored of waiting for the scripts i want to come out so i have took it upon myself to start learning Java i intend to carry on with scripting and updating scripts i release and i want to better my skills i know the script i release will probably get criticised but i am looking for advice on what i can do to my scripts to make them better . I have not got lots and lots of coding experience as i have only been in my job for around 3-4 months now. i tried scripting for RuneScape before but as you can tell i didnt plan on doing it for that long because i was around the age of 14 but as i have grown older my interest for coding hasn't just become an interest i have now got a job doing it  
 
So here is my AIO chopper that you can use custom tiles for locations also banks in most location and chops anywhere i have made my own GUI and Paint which most Scripter's think "pfft that's a 5 minute job" but for someone new to this its a big thing.
 
I accept all constructive criticism but any abuse will be removed.
 
AIOChop.java
 
http://pastebin.com/0zkSAxMb
 
Transportation.java(Thanks to botsallday for his transportation class)
 
http://pastebin.com/mWdbNsyY
 
 
 
AntiBan.java
 
http://pastebin.com/zxcGb6r5
 
This is the paint i created : 
 
https://gyazo.com/62b383c61da7f4e12dd2e7e4d2131c7b
 
And this is the GUI i made :
 
https://gyazo.com/add68f8d871f3091bbe1567b62776872

Share this post


Link to post
Share on other sites
println("Going to bank nigga.");

Lmao xD

Edited by Kyle_1995
1 person likes this

Share this post


Link to post
Share on other sites

Best of luck with this bro! Would be awesome if you could add ABCL to it as well :D

Share this post


Link to post
Share on other sites

@Mark i really appreciate it thanks man :D:D and i have implemented a few things from the antiban class 

Share this post


Link to post
Share on other sites

@Nvox
You'll get an array out of bounds exception if the returned array from Objects.find() has a length of 0

RSObject[] trees = Objects.findNearest("Tree", 15);if (trees.length > 0) {     RSObject tree = trees[0]; //we can define tree with element 0 of trees because we've confirmed that the array trees has at least one element;    if (tree != null) { //you need to make sure the tree object isn't a null before using it's methods, this is because the elements of the array returned by Objects.find() may be null       if (tree.isOnScreen()) {           DynamicClicking.clickRSObject(tree, "Chop"); //we can now interact with the tree because we know it's not a null           //you're supposed to use a conditional sleep here, which would wait for x amount of time until a condition is met.            //In this case, the condition would be if you've started chopping       } else {           Camera.turnToTile(tree);       }    }}

Your script sucks, but mostly because of your limited knowledge of the tribot api. Check out the documentation here: www.tribot.org/doc

If you would like to drastically improve over the course of a few days, visit the teamspeak server: elitescripts.tk  During after-work hours for any tribot or java related programming help. I don't think we can accomplish much of anything by simply typing to one another. It's also worth noting that you'll inevitably pick up terrible habits trying to teach yourself how to use the api without looking at a properly written example. I'll be in the team speak if you're looking for any immediate assistance.

Edited by Flamo353
1 person likes this

Share this post


Link to post
Share on other sites

@Nvox

You'll get an array out of bounds exception if the returned array from Npcs.find has a length of 0. 

RSObject[] trees = Objects.findNearest("Tree", 15);if (trees.length > 0) {     RSObject tree = trees[0]; //we can define tree with element 0 of trees because we've confirmed that the array trees has at least one element;    if (tree != null) { //you need to make sure the tree object isn't a null before using it's methods, this is because the elements of the array returned by Npcs.find may be null       if (tree.isOnScreen()) {           DynamicClicking.clickRSObject(tree, "Chop"); //we can now interact with the tree because we know it's not a null           //you're supposed to use a conditional sleep here, which would wait for x amount of time until a condition is met.            //In this case, the condition would be if you've started chopping       } else {           Camera.turnToTile(tree);       }    }}

 

 

I think you mean Object, not NPCs?

 

@Nvox

 

I just got a chance to look through your code. Here are some things I notice.

 

  • GUI
    • This is just my opinion, your GUI would look a lot better if you don't use any colors and you let Tribot handle that, but that's your choice.
  • Walking
    • I wouldn't recommend  using his walking class personally cause it just uses the Tribot API and seems to be extremely personalized to him.
  • Sleeping
  • Returned booleans
    • Quite a bit of methods return a Boolean, you should really make use of that to tell if a condition actually happened instead of assuming it happened.
  • Inefficient code
    • On line 122 you're Webwalking to the bank, but what if you're already in the bank?
    • On line 125 you're opening the bank, but what if it is already open?
    • On line 125 you're opening the bank then depositing items, but what if the script miss clicks? It's going to try and deposit items when the bank isn't even open. You should check if the banking screen is open then deposit your items.
    • On line 147 you're adding 1 every time you click the tree, but you get multiple logs from one tree.
    • On line 147 you're adding 1 every time you click the tree, but what if you miss click the tree?
    • On line 145, what if there isn't a tree on the screen, you should check if it's on the screen and if it's not then walk to it. If there isn't any tree's on the screen the length can still return > 0.
  • Redundant Code
    • You re-write the same chopping method several times just for a different dropping method. You should write the chopping method once and then use that in all of your different chopping types.
Edited by Sphiinx
1 person likes this

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

  • Recently Browsing   0 members

    No registered users viewing this page.