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.

TRiLeZ

TRiLeZ's Scripting Tutorial

38 posts in this topic

Thanks for this great detailed tutorial, always wanted to create my own private script so I will definitely try this later but i gotta get familiar with the language first..

Share this post


Link to post
Share on other sites

Ty for putting effort into this to try and teach us!!

 

I have been reading up on scripting all day and been staring at this script for a long time now :P

And something is unclear to me and I hope that you or someone else can explain this to me, would really appreciate it.

 

In the example you gave us at the end, line 383-416 is this the place where the script starts?

 

First sleeps 50 miliseconds

then jumps to isAtTrees,

Returns to line 390

Jumps Inventory.isFull,

Etc

 

 

If this is true why is this at the bottom? :P 

I have 0 experience with java scripting so please explain it to me like i am a 8 year old.

 

 

@Override
public void run() {
while (true) {
sleep(50);
 
if (isAtTrees()) { // We are at the trees
// Time to check what to do. If the inventory is full, we should
// walk to the bank. Otherwise, we should cut the willows.
if (Inventory.isFull()) { // The inventory is full
walkToBank(); // Let's walk to the bank
} else
// The inventory is not full
cut(); // Let's cut the willows.
} else if (isInBank()) { // We are at the bank
// Time to check what to do. If the inventory is full, we should
// bank the items. Otherwise, we should walk back to the trees.
if (Inventory.isFull()) // The inventory is full
bank(); // Let's bank the items
else { // The inventory is not full
walkToTrees(); // Let's walk to the trees.
}
} else { // We are neither in the bank, nor at the willows
// Time to check what to do. If the inventory is full, we will
// walk to the bank. Otherwise, we will walk to the willows.
if (Inventory.isFull()) // Inventory is full
walkToBank(); // Walk to the bank
else
// Inventory is not full
walkToTrees(); // Walk to the trees.
}
}
}
 
}
 
 
 
 

 

 

Share this post


Link to post
Share on other sites

Can someone tell me how you use this script? Like I don't understand how you get it into Tribot so that you can run it

Share this post


Link to post
Share on other sites

Can anyone update this with properly formatted code? This is a bloody mess. Single line code with // comments is NOT a good idea.

Share this post


Link to post
Share on other sites
On 5/28/2016 at 4:57 PM, xmaxing said:

Can anyone update this with properly formatted code? This is a bloody mess. Single line code with // comments is NOT a good idea.

The single line is an issue from when the forums updated. Any pre-existing code was put onto a single line.

Share this post


Link to post
Share on other sites
On 5/29/2016 at 0:39 PM, WillB said:

The single line is an issue from when the forums updated. Any pre-existing code was put onto a single line.

I fixed it ! :D

1 person likes this

Share this post


Link to post
Share on other sites

So I'm a comp sci major and would love to try to start making scripts for osrs and the above tutorial makes perfect sense to me. I was wondering if anyone has advice as far as formatting scripts (whether to use a bunch of conditionals or if implementing a FSM would work better?) or if there are different types of scripts that are better for FSM such as a power mining script?

 

 

Share this post


Link to post
Share on other sites

@TRiLeZ Hi would like to lean how to script for Tribot but im a complete noob. I know the osrs game well and im an experienced botter but have no knowledge of Java. How long would it take me to get up to the level to write premium ABC2 scripts? And where should I start? 

Edited by idkfa
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.