Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold
testing1

GeniuSFarming

Recommended Posts

Posted (edited)

This Script has 5 phases 

1-First phase  progressive 1-30 planting  bagged plant 1 in POH 

2- Second phase will add tree runs support 

3-Third phase will add fruit runs support 

4-fourth phase will add Herb runs Money Making 

5-Fifth  phase will add ABC 

This is an open source script Waiting for feedback from Scripters on how to improve my codes 

Source Code

PS : i could make the banking node more simple but i think i am too lazy so will do it in phase two if there is a comment about it 

1-Must have in bank for 1-30 Phase 1 

To run this script u need to write in argument box >> PROG cause there wont be an GUI for this script 

- 432 Bagged Plant 1

- 60 Watering Can(8)

- 25 House Teleport Tabs

- 5 Ring Of Deling(8)

-And Of A House xD

-Must  Start At CW

 

2-Phase 2 TREE runs  

- Lumb Teleport tablet

- VarrockTeleport tablet

- FaladorTeleport tablet

-Passage Necklace

- Rake

-Spade

- Coins

-UltraCompost / or any kind of compost just make sure it is in bank 

-Sapling depends on your level /  Willow , Maple ,Yew , magic

The Script will run for 5 patches only Lumb, Varrock, Falador, Taverley, Gnome Stronghold

The script will make sure there is plant in each patch then logout and wait for the plants to grow with a randomization in time so for each account time of wait is different. 

PS: I only tested WIllow cause the level of the account i have but i am leveling it up to test all of trees please report any bug and i will fix asap

This support Compost and Payment too 

ARG supports :   for compost  use TREE:COMP

for Payment use TREE:PAY

will be adding more argument for each tree cause if ppl wan do single tree 

also going add arg for single run 

if u wan me add any thing Please LMK 

This Script is still in BETA so if u found any bug report it and i will fix asap

Get Script From Here

 

Update 1- **Fixed some bugs 
**Adjusted my banknode

**Can start at any where with or without ring of D equipped  

 

Edited by testing1
  • Thanks 1
  • thonking 1

Share this post


Link to post
Share on other sites
37 minutes ago, contemporary said:

Interesting idea, with consistent work it might turn into a valuable tribot addition. If I may add a suggestion, perhaps post some working CLI examples in the main post to get script running easier for new people.

thanks for feedback but dont get what u meant about CLI 

Share this post


Link to post
Share on other sites
6 hours ago, troopafox22 said:

Feedback here: working really well for Phase 1, has problems shifting back into the building more though... heres a GIF link that shows what I mean:

Once you hit the building icon, it auto switches to building mode, but cant seem to get there.

https://i.gyazo.com/2f305adcf859d7426ec23ab01248bceb.mp4

 

Oh yesterday update of rs broke somethings i will be fixing this asap thanks for reporting the bug 

Share this post


Link to post
Share on other sites

I'm going to start by looking over the  BankingItems class without looking at anything else, I will try to take a look at other stuff in the future (but my free time isn't always plentiful)..

Let's look at your first declaration.

public static final int duling[] = {2552,2554,2556,2558,2560,2562,2564,2566};

A common thing we look for is proper naming conventions.  I'm not sure of the best resource to review at this time, but this link has the right stuff. https://google.github.io/styleguide/javaguide.html#s5-naming

Constants should be in all caps, and ideally free of spelling errors. The proper naming convention would be:

public static final int[] DUELING = {2552,2554,2556,2558,2560,2562,2564,2566};

 

The next declaration can be considered a constant, and again is misspelled.  I would apply the same naming conventions to it.

RSArea castelWar

 

The validate method has several "magic numbers" in it.  I have no idea what the items with IDs 8431, 8013, 5331 are by looking at this method.  I can probably assume one of them is a seed dibber and one of them is a rake or spade, but again there is no indication.  A "magic number" is just a random number in code without any variable assigned or explanation as to what it means.  You should ideally declare those integers as constants, such as RAKE_ID, and assign the value to that variable (and refer to the variable RAKE_ID rather than the id).  You can also create a method such as "hasRake()" which returns Inventory.getCount(RAKE_ID) > 0, since that is quicker to type/understand and also will probably be used in other places in your code.

@Override
public boolean validate() {
	return Inventory.getCount(8431) == 0 || Inventory.getCount(8013) == 0 || Inventory.getCount(5331)==3
		&& !Banking.isBankScreenOpen();
}

I'm not really sure where to start with your execute method.  I would condense many of those if statements into separate methods which handle the desired tasks. I will give a brief idea of what I mean below.

@Override
public void execute() {
	if(!isWearingDueling()){
		getDuelingRing();
	}
	...
}

public void getDuelingRing(){
	if(hasInventoryDueling()){
		if(isBankOpen()){
			closeBank();
		} else {
			equipDueling();
		}
	} else if(!isInBank()){
		walkToBank();
	} else if(!isBankOpen()){
		openBank();
	} else {
		withdrawDueling();
	}
}

It might also be nice to have execute methods return a value whether or not they succeeded/failed so that you can handle failures (such as being out of dueling rings), or you can just manage that with a global "shouldRun" variable.

 

Hope this helps.

Share this post


Link to post
Share on other sites
23 minutes ago, FALSkills said:

I'm going to start by looking over the  BankingItems class without looking at anything else, I will try to take a look at other stuff in the future (but my free time isn't always plentiful)..

Let's look at your first declaration.

public static final int duling[] = {2552,2554,2556,2558,2560,2562,2564,2566};

A common thing we look for is proper naming conventions.  I'm not sure of the best resource to review at this time, but this link has the right stuff. https://google.github.io/styleguide/javaguide.html#s5-naming

Constants should be in all caps, and ideally free of spelling errors. The proper naming convention would be:

public static final int[] DUELING = {2552,2554,2556,2558,2560,2562,2564,2566};

 

The next declaration can be considered a constant, and again is misspelled.  I would apply the same naming conventions to it.

RSArea castelWar

 

The validate method has several "magic numbers" in it.  I have no idea what the items with IDs 8431, 8013, 5331 are by looking at this method.  I can probably assume one of them is a seed dibber and one of them is a rake or spade, but again there is no indication.  A "magic number" is just a random number in code without any variable assigned or explanation as to what it means.  You should ideally declare those integers as constants, such as RAKE_ID, and assign the value to that variable (and refer to the variable RAKE_ID rather than the id).  You can also create a method such as "hasRake()" which returns Inventory.getCount(RAKE_ID) > 0, since that is quicker to type/understand and also will probably be used in other places in your code.

@Override
public boolean validate() {
	return Inventory.getCount(8431) == 0 || Inventory.getCount(8013) == 0 || Inventory.getCount(5331)==3
		&& !Banking.isBankScreenOpen();
}

I'm not really sure where to start with your execute method.  I would condense many of those if statements into separate methods which handle the desired tasks. I will give a brief idea of what I mean below.

@Override
public void execute() {
	if(!isWearingDueling()){
		getDuelingRing();
	}
	...
}

public void getDuelingRing(){
	if(hasInventoryDueling()){
		if(isBankOpen()){
			closeBank();
		} else {
			equipDueling();
		}
	} else if(!isInBank()){
		walkToBank();
	} else if(!isBankOpen()){
		openBank();
	} else {
		withdrawDueling();
	}
}

It might also be nice to have execute methods return a value whether or not they succeeded/failed so that you can handle failures (such as being out of dueling rings), or you can just manage that with a global "shouldRun" variable.

 

Hope this helps.

Man that helped me alot i wll take that all into consideration and will fix that all but about naming i was naming it with capitalization but a PScripter told me to use camel naming or something like that again thanks alot ❤️ 

Share this post


Link to post
Share on other sites
29 minutes ago, testing1 said:

Man that helped me alot i wll take that all into consideration and will fix that all but about naming i was naming it with capitalization but a PScripter told me to use camel naming or something like that again thanks alot ❤️ 

Camel case naming is preferred for variables, constants should be in all caps.

Share this post


Link to post
Share on other sites
17 hours ago, FALSkills said:

I'm going to start by looking over the  BankingItems class without looking at anything else, I will try to take a look at other stuff in the future (but my free time isn't always plentiful)..

Let's look at your first declaration.

public static final int duling[] = {2552,2554,2556,2558,2560,2562,2564,2566};

A common thing we look for is proper naming conventions.  I'm not sure of the best resource to review at this time, but this link has the right stuff. https://google.github.io/styleguide/javaguide.html#s5-naming

Constants should be in all caps, and ideally free of spelling errors. The proper naming convention would be:

public static final int[] DUELING = {2552,2554,2556,2558,2560,2562,2564,2566};

 

The next declaration can be considered a constant, and again is misspelled.  I would apply the same naming conventions to it.

RSArea castelWar

 

The validate method has several "magic numbers" in it.  I have no idea what the items with IDs 8431, 8013, 5331 are by looking at this method.  I can probably assume one of them is a seed dibber and one of them is a rake or spade, but again there is no indication.  A "magic number" is just a random number in code without any variable assigned or explanation as to what it means.  You should ideally declare those integers as constants, such as RAKE_ID, and assign the value to that variable (and refer to the variable RAKE_ID rather than the id).  You can also create a method such as "hasRake()" which returns Inventory.getCount(RAKE_ID) > 0, since that is quicker to type/understand and also will probably be used in other places in your code.

@Override
public boolean validate() {
	return Inventory.getCount(8431) == 0 || Inventory.getCount(8013) == 0 || Inventory.getCount(5331)==3
		&& !Banking.isBankScreenOpen();
}

I'm not really sure where to start with your execute method.  I would condense many of those if statements into separate methods which handle the desired tasks. I will give a brief idea of what I mean below.

@Override
public void execute() {
	if(!isWearingDueling()){
		getDuelingRing();
	}
	...
}

public void getDuelingRing(){
	if(hasInventoryDueling()){
		if(isBankOpen()){
			closeBank();
		} else {
			equipDueling();
		}
	} else if(!isInBank()){
		walkToBank();
	} else if(!isBankOpen()){
		openBank();
	} else {
		withdrawDueling();
	}
}

It might also be nice to have execute methods return a value whether or not they succeeded/failed so that you can handle failures (such as being out of dueling rings), or you can just manage that with a global "shouldRun" variable.

 

Hope this helps.

Updated all the source code too meet almost every thing u said i am still going to remove the supplie check node and will be using shouldRun variable soon waiting for your comments 

Share this post


Link to post
Share on other sites
2 hours ago, testing1 said:

Updated all the source code too meet almost every thing u said i am still going to remove the supplie check node and will be using shouldRun variable soon waiting for your comments 

I'm not going to be available to check your code on a daily or even weekly basis, so I wouldn't keep waiting.  

You have not included the "Vars" class in your source, which is rather important since it seems you have moved a lot of the code to that class.
I would suggest you separate some of those methods into other classes, such as your own "Banking" class, your own "GameTabs" class, etc. so that you can easily refer to those methods in the future based upon whatever topic they relate to.  "Vars" typically would be understood to be a class that stores variables, not a random mesh of different functions.

This:

Vars.waitTill(Inventory.getCount(RINGOFDUELING) == 0);

Probably isn't correct, but I can't see what Vars.waitTill method does.  I can assume that it is incorrect because that function is the equivalent of:

boolean b = Inventory.getCount(RINGOFDUELING) == 0;
Vars.waitTill(b);

I assume you are trying to wait until that boolean is true, however the Inventory.getCount call is only calculated once.  This means that, if it was false when checked, it will always be false.

You probably were trying to do something like this:

Vars.waitTill(() -> Inventory.getCount(RINGOFDUELING) == 0);

Which would be using the functional interface BooleanSupplier.  You would need to change your waitTill method to accept a BooleanSupplier as an argument.
Does your waitTill method use the Timing.waitCondition method inside of it?  If not, you probably should!

 

I have no idea what this could possibly be doing, my guess is probably nothing:

if (Vars.WATERINGCAN == 0) {
	Vars.getItemFromBank(Vars.WATERINGCAN, 3);
}

 

Share this post


Link to post
Share on other sites
19 minutes ago, FALSkills said:

You have not included the "Vars" class in your source

thanks for the update i thought i shouldn't include the vars in my source code is wise move !

 

19 minutes ago, FALSkills said:

I would suggest you separate some of those methods into other classes,

Noted and doing it right now 

 

19 minutes ago, FALSkills said:

Vars.waitTill(Inventory.getCount(RINGOFDUELING) == 0);

i think it will work as i supply it with boolean as argument and i just have to add the boolean to the method 

public static void waitTill(boolean Condition){
        Timing.waitCondition(() -> {
            General.sleep(500);
            return Condition;
        }, General.random(8000, 10000));
        General.sleep(500, 1000);

}

 

23 minutes ago, FALSkills said:

if (Vars.WATERINGCAN == 0) { Vars.getItemFromBank(Vars.WATERINGCAN, 3); }

this code withdraw wateringCan from bank it will be checking if in bank ,if bank screen open , and if bank contains wateringCan with else in between 

public static void getItemFromBankD(int item, int keep, int count, RunescapeBank Bank) {

    if (!Banking.isInBank()) {
        scripts.dax_api.api_lib.DaxWalker.walkToBank(Bank);
        Timing.waitCondition(() -> {
            General.sleep(500);
            return Banking.isInBank();
        }, General.random(8000, 9000));
        General.sleep(500, 1000);

    } else if (!Banking.isBankScreenOpen()) {
        if (Banking.openBank()) {
            Timing.waitCondition(() -> {
                General.sleep(500);
                return Banking.isBankScreenOpen();
            }, General.random(4500, 5500));
            General.sleep(500, 1000);

        }

    } else if (Inventory.getAll().length > 0) {
        Banking.depositAllExcept(keep);
        Timing.waitCondition(() -> {
            General.sleep(500);
            return Inventory.getAll().length == 0;
        }, General.random(1500, 2000));
        General.sleep(500, 1000);

    } else if (Banking.find(item).length > 0) {
        if (Banking.withdraw(count, item)) {
            Timing.waitCondition(() -> {
                General.sleep(500);
                return Inventory.getCount(item) > 0;
            }, General.random(1500, 2000));
            General.sleep(500, 1000);
        }
    } else {
        throw new RuntimeException("Out Of" + item);
    }
}

 

Again thanks alot i hope my code improved the way u wanted it to be i am keep getting more advice from u man u are a hero thanks again do u think there were some improvement or not 

Share this post


Link to post
Share on other sites
7 minutes ago, testing1 said:

 

public static void waitTill(boolean Condition){
        Timing.waitCondition(() -> {
            General.sleep(500);
            return Condition;
        }, General.random(8000, 10000));
        General.sleep(500, 1000);

}

That does not work how you think it does.  The boolean is only calculated once, when it is declared.  It is not calculated again.  

public static void waitTill(BooleanSupplier condition){
        Timing.waitCondition(condition, General.random(8000, 10000));
        General.sleep(500, 1000);

}

waitTill(() -> Inventory.getCount(RINGOFDUELING) > 0);

 

The method for Vars.getItemFromBank is not the one you shared there.  If you look at the method I was mentioning, it does not make sense. You check if Vars.WATERINGCAN == 0, and if so, you get Vars.WATERINGCAN (which is 0) from the bank. 

Share this post


Link to post
Share on other sites
16 minutes ago, FALSkills said:

The boolean is only calculated once, when it is declared.  It is not calculated again.  

The boolean is not calculated every time the node is validated ?

 

17 minutes ago, FALSkills said:

The method for Vars.getItemFromBank is not the one you shared there

both are the same the only difference is this one deposit all the inv if it is not empty 

20 minutes ago, FALSkills said:

check if Vars.WATERINGCAN == 0, and if so, you get Vars.WATERINGCAN (which is 0) from the bank.

fuck me i didnt see that yeah mb changed it 

if (Vars.wateringCanCount() == 0) {
    CustomBanking.getItemFromBank(Vars.WATERINGCAN, 3);
}

Share this post


Link to post
Share on other sites
On 1/30/2020 at 12:00 PM, testing1 said:

The boolean is not calculated every time the node is validated ?

It is calculated every time the node is validated. It is not calculated every loop of the wait condition, which is the entire purpose of the wait condition.

Share this post


Link to post
Share on other sites
1 minute ago, FALSkills said:

It is calculated every time the node is validated. It is not calculated every loop of the wait condition, which is the entire purpose of the wait condition.

yeah i got it already changed it to boolean supplier as u suggested working perfect now ❤️ thanks alot 

Edited by testing1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Our picks

    • Over the past few months, I’ve been working diligently on a new project - TRiBot X. Everything has been written from the ground up, with all of the best practices of software engineering. Every aspect of TRiBot has been re-imagined to support three main goals: flexibility, useability, and reliability.
        • Like
      • 31 replies
    • Come give us feedback on the next version of TRiBot!
      • 74 replies
    • TRiBot is looking to improve a lot of its customer relationship management, customer on boarding process, customer experience, design elements, community engagement and pretty much everything else you can imagine when it comes to marketing.

      Our goal: To ensure that the marketing done TRULY reflects the experience and does not shine an inaccurate light on what TRiBot is lacking in.

      So I ask, what do you love about TRiBot and what do you hate about TRiBot? What does O S Bot, Rune M8, PowR Bot and Dre amBot do better? (yes I purposely didn't spell it right 😂).

      Love, 

      RileyZ
      • 23 replies
    • Over the last three weeks, I've been working on upgrading our server infrastructure. It's finally ready and is now live!

      Why?

      Increased reliability - less server errors


      Increased availability - less downtime


      Increased security - keeping us and you secure


      Increased capacity - ability to serve you better


      Increased speed - less waiting for things to load


      Faster development - server and service updates will come faster


      What are the changes?

      Move from a single AWS EC2 instance to AWS ECS (Elastic Container Service)


      Distributed computing


      Load balancing


      Git management of server files and filesystem


      Redis caching


      How?

      AWS ECS (with 10 EC2 instances)


      AWS ElastiCache (Redis)


      AWS Load Balancing


      AWS EFS (Elastic file system)


      Please bare with us as I continue to tune the server for maximum performance. Slow loading speeds may occur temporarily. I thank everyone for their patience.

      Please post on this thread if you experience any issues other than slow loading times.
      • 51 replies
    • This release will:

      Fix prayers and world hopper API (Thanks @JoeDezzy1 and @erickho123)


      Improve banking API (Thanks @Encoded)


      Adds methods for returning and using Java Lists, rather than arrays


      Slightly randomizes some hardcoded behaviour


      Removes sleeps from waitConditions; the efficiency saving potential is negligible in these use-cases, therefore cleaner code is preferable


      Other back-end improvements





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

    No registered users viewing this page.

×
×
  • Create New...