Jump to content

Scripting Knowledge Requirements


Recommended Posts

To ensure a high quality of scripts, we are requiring a demonstration of specific knowledge about scripting when applying for the scripter rank. Aspiring scripters must submit source code to a fully working script along with their application. If the submitted script doesn't demonstrate adequate knowledge in the below areas, the application will be instantly denied.

 

Null Checking

Scripts must properly check for null variables. Keep in mind that the returned value of one object is not always the same as the returned value of the same object (when the method is called twice).

RSObject tree = Objects.findNearest(40, "Tree");
if (tree.getDefinition() != null && tree.getDefinition().getName() != null) {
 final String name = tree.getDefinition().getName();
}

The above code is wrong and needs to be avoided. Three different instances of RSObjectDefinition are created. Any of those instances could be null, or none of them could be null. What you need to do is store the returned value in a variable, then null check that variable. If the variable is not null, then perform actions upon that variable.

 

Check section 6 of my tutorial for more info: https://tribot.org/forums/topic/30185-trilezs-scripting-tutorial/

 

Array Index Bounds Checking

Scripts must check that the index they are trying to pull from an array is not out of bounds. It's out of bounds if: index < 0 or index >= array.length.

Scripts should also only do array index bounds checking on variables, and not returned values from methods (unless no elements are being pulled from the array). The reason for this is the same as the reason listed above.

 

Check section 6 of my tutorial for more info: https://tribot.org/forums/topic/30185-trilezs-scripting-tutorial/

 

These are not the only coding knowledge requirements, but they are the most common problems created by scripters. Make sure to have adequate scripting knowledge before applying.

 

I'd also recommend reading sections 5, 6, and 7 of my scripting tutorial before applying: Check section 6 of my tutorial for more info: https://tribot.org/forums/topic/30185-trilezs-scripting-tutorial/

 

If a staff member closes your application and links to this thread without saying anything else, they are stating that you need to fix your scripts because they contain the above coding errors.

Edited by erickho123
Forum Software update made all lines one lined. Attempted to fix it.
  • Like 2
Link to post
Share on other sites
Guest
This topic is now closed to further replies.
  • Our picks

    • What to expect from TRiBot moving forward.
        • Thanks
        • Like
      • 10 replies
    • TRiBot 12 Release Candidate

      The TRiBot team has been hard at work creating the last major version of TRiBot before the TRiBot X release. We've noticed many problems with TRiBot 11 with a lot of users preferring TRiBot 10 over 11. We've heard you, so we took TRiBot 10, added the new features introduced with 11, introduced some other new things, and created TRiBot 12. So without further adieu, here's TRiBot 12.
        • Sad
        • Like
      • 39 replies
    • Gradle is a build tool used to accelerate developer productivity.

      We recently setup a Maven repository (TRiBot Central) to make it easier for scripters to create scripts. Check it out here: https://gitlab.com/trilez-software/tribot/tribot-central/-/packages

      Furthermore, we've released a simple Gradle project to make it easy to run TRiBot and develop scripts for it. Check it out here: https://gitlab.com/trilez-software/tribot/tribot-gradle-launcher

      The goals of TRiBot Central are to:

      Deliver updates to TRiBot faster


      Better organize TRiBot's dependencies (AKA dependancies)


      Make it easier to develop scripts for TRiBot


      Make it easier to use and run TRiBot


      Note: TRiBot won't be able to run scripts from within this project until TRiBot's next release.
        • Like
      • 13 replies
    • Hi everyone,

      I'd like to thank everyone for their patience in this transition period. Since last week, we've worked out the remaining bugs with this integration.

      Some users have still been having issues with connecting their forums account to their Auth0 account. To resolve this, we've imported all forums accounts into Auth0.

      Unfortunately, the accounts which were imported today were using an unsupported password hashing algorithm. Hence, random passwords were set during the import.

      What does this mean for me?

      If you've previously linked your forums account to your Auth0 account, you don't have to do anything. Nothing changes for you.


      If you haven't logged in via our new login yet,

      Try logging in with your forums email address and the last password you used


      If you are unable to login, please use the "Forgot password" tool on the login page:
      Follow the instructions to reset your password
       
        • thonking
        • Like
      • 17 replies
    • Hello everyone,

      Last week we tried to roll out Auth0 Login, but we lost that battle. Now it's time to win the war!

      Important changes

      When logging into the client, you'll now have to enter your Auth0 account credentials instead of your forums credentials

      Note: 2FA is still handled through your forums account (for the time being)



      Changes for existing users

      You'll have to link your Auth0 account to your forums account here: https://tribot.org/forums/settings/login/?service=11


      Auth0 accounts have been created for most existing users. Please use your forums email address and password to login.



      Important notes

      Make sure to verify your email address upon creating a new Auth0 account


      When we mention your Auth0 account, we mean your account used for auth.tribot.org as displayed below
      • 81 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...