Jump to content
adamhackz

Progressive Crafter

Recommended Posts

Posted (edited)

Script Status 

The script is currently Free/Open Access to all Non-VIP and VIP users.
If you'd like to support me, you can go ahead give me a :thonking: emoji. 

 

Features

- Will automatically switch to the next best leather item upon level-up
- Free xd

 

Download

Get the Latest Version: Here

 

Bug Reports
Think you've found a bug? I'll happily fix it as long as you say more than "skript broke plz fix".

 

 

ChangeLog

Version 1.00 First release xd

Version 2.00 Script actually stops when out of leather now

                       Removed long idle time after level up

                       Source included: https://github.com/bolsilent/TRiBot/blob/master/progressiveCrafter/main.java

Edited by adamhackz
update
  • thonking 6

Share this post


Link to post
Share on other sites

@adamhackz not bad, but you could definitely reduce the amount of duplicate code.

 

Instead of calling Skills.SKILLS.CRAFTING.getActualLevel() 12 times in the same method, you could simply declare a local variable that holds the correct value and use this variable when needed:

int level = Skills.SKILLS.CRAFTING.getActualLevel();

The same goes with RSInterface i = Interfaces.get(270); which doesn't have to be contained within the if blocks and repeated 7 times will all the null checks. Simply declare it, get it and null check it once, outside the if blocks.

 

 

RSItem[] leathers = Banking.find("Leather");
     if (leathers[0].getStack() < 1) {
          continuerunning = false;
     }

Banking.find might return an array of length 0. I'm quoting from the API: An array of RSItem, which has a length of zero if no bank items are found based on the criteria.

Line 2 might throw an IndexOutOfBoundsException because there is no guarantee that leathers[0] exists.

 

Share this post


Link to post
Share on other sites

Looks alright.

Not quite sure why you're doing things such as using a boolean in your onStart  when you don't really need to utilise it and there's a Starting interface.

You can also like Einstein said reduce a lot of the code by creating a method for handling the crafting interface.

Share this post


Link to post
Share on other sites
    private boolean onStart() { // Use the Starting interface it has onStart method that gets called before run()
            General.println("Script Started");
            General.println("Welcome back " + General.getTRiBotUsername());

        return true;
    }


    public void run() {
        if (onStart()) { //The fucks the point this always returns true lol.
            while (true) {
                if (continuerunning) { //Could just do while (continuerunning) lol
                    General.sleep(General.randomSD(250, 1200, 725, 500));
                    loop();
                }
            }
        }
    }


    public void onPaint(Graphics g) { //Don't think sleeps should be used in the onPaint method
        sleep(50); 
        g.drawString("State: " + SCRIPT_STATE, 5, 80);
        //g.drawString("Running for: " + Timing.msToString(runtime), 5, 70);
    }

    private int loop() {
        SCRIPT_STATE = getState();
        General.sleep(General.random(50, 250));
        switch (SCRIPT_STATE) {

            case BANKING:
                if (!Banking.isBankScreenOpen()){ //Whats the point the script state already determined the bank isn't open.
                    Banking.openBank(); //Use a Timing.waitCondition after this to wait until the bank screen is open if you are having issues with it calling this multiple times before bank opens
                }

                break;
            case FLETCHING:


                if (continuouslyAnimating())
                    currentlyPerformingAction = true;
                    else
                    currentlyPerformingAction = false;
                if (!currentlyPerformingAction && !Interfaces.isInterfaceValid(270)){
                    combine();
                }


                if (Interfaces.isInterfaceValid(270)){
			//Switch all ur Skills.SKILLS.CRAFTING.getActualLevel and set a single int variable to this method.
                    if (Skills.SKILLS.CRAFTING.getActualLevel() < 7) {
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(14);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 14);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();

                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 7 && Skills.SKILLS.CRAFTING.getActualLevel() < 9){
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(15);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 15);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();


                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 9 && Skills.SKILLS.CRAFTING.getActualLevel() < 11){
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(16);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 16);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();


                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 11 && Skills.SKILLS.CRAFTING.getActualLevel() < 14){
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(17);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 17);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();


                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 14 && Skills.SKILLS.CRAFTING.getActualLevel() < 18){
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(18);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 18);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();


                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 18 && Skills.SKILLS.CRAFTING.getActualLevel() < 38){
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(19);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 19);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();
                                }
                            }

                        }
                    }
                    if (Skills.SKILLS.CRAFTING.getActualLevel() >= 38) {
                        General.sleep(General.randomSD(250, 1200, 725, 500));
                        RSInterface i = Interfaces.get(270);
                        if (i != null) {
                            RSInterface c = i.getChild(20);
                            if (c != null) {
                                RSInterface gloves = Interfaces.get(270, 20);
                                General.sleep(General.randomSD(70, 210, 140, 70));
                                if (gloves != null) {
                                    gloves.click();
                                }
                            }
                        }

                    }
                }



                break;

            case WITHDRAW:
                if (Banking.isBankScreenOpen()) { //You already confirmed the bank is open in your state generator
                    RSItem[] leathers = Banking.find("Leather"); 
                    if (leathers[0].getStack() < 1) { //As said this could be null
                        continuerunning = false;
                    }
                    else continuerunning = true; //shit tier spacing the fuck just do continuerunning = leathers.length > 0 && leathers[0].getStack() > 1; lol
                    RSItem[] allitems = Inventory.find(Filters.Items.nameContains("Leather").combine(Filters.Items.nameNotEquals("Leather"), true));
                    RSItem[] coif = Inventory.find("Coif");
                    if (!hasleather() && allitems.length > 0 || coif.length > 0) {
                        General.sleep(600, 1200);
                         Banking.depositAllExcept(1733,1734); 
                        General.sleep(600,1200); //Switch to Timing.waitCondition (!Inventory.contains(1733, 1734)) 
                    }
                    if (!hasleather() && !(allitems.length > 0) && leathers.length > 0) {
                        General.sleep(600,1200);
                        if (Banking.withdraw(0, "Leather")) {
                            General.sleep(600,1200);//Switch to Timing.waitCondition (Inventory.contains("Leather")) 
                            if (canCloseBank()){
                                closeBank();
                            }

                        }
                    }

                }
                break;

            case IDLING: //Shit teir antiban nice.
                int low = 0;
                int high = 10;
                int Result = General.random(low, high);
                if (Result <= 6) {
                    //do nothing
                }
                if (Result > 6 && Result <= 8){
                    General.sleep(General.randomSD(250, 1200, 725, 500));
                    abc.leaveGame();
                }
                if (Result > 8){
                    General.sleep(General.randomSD(250, 1200, 725, 500));
                    int low1 = 0;
                    int high1 = 10;
                    int Result1 = General.random(low, high);
                    if (Result1 > 3){
                        ExaminePlayer();
                    }
                    General.sleep(600,1200);
                    abc.moveMouse();
                }
                break;
        }


        return 50;
    }


    public enum State {
        BANKING,
        IDLING,
        FLETCHING, WITHDRAW
    }

    private State getState() { //Change up ur logic abit.

        if (!isBankOpen() && !hasleather()) {
            return State.BANKING;
        }
        if (needle.length > 0 && thread.length > 0 && hasleather() && !isBankOpen()) {
            return State.FLETCHING;
        }
        if (isBankOpen() && !hasleather()){
            return State.WITHDRAW;
        }
        if (continuouslyAnimating()){
            return State.IDLING;
        }
        else return State.IDLING;

	//Maybe something like this.
	if (isBankOpen()) {
		if (hasLeather()) return CLOSE_BANK
		else return WITHDRAW
	} else {
		if (hasSupplies()) return FLETCHING
		else return OPEN_BANK
	}
    }
}

Comments are my criticism. Lots to work on besides what I listed.

Share this post


Link to post
Share on other sites

This pattern also makes like 0 sense lol. Whats the point of getting the interface again if you already checked that its != null.

c is the same thing as gloves in this example.

if (Skills.SKILLS.CRAFTING.getActualLevel() >= 38) {
	General.sleep(General.randomSD(250, 1200, 725, 500));
	RSInterface i = Interfaces.get(270);
	if (i != null) {
		RSInterface c = i.getChild(20);
		if (c != null) {
			RSInterface gloves = Interfaces.get(270, 20);
			General.sleep(General.randomSD(70, 210, 140, 70));
			if (gloves != null) {
				gloves.click();
			}
		}
	}
}

Also having tons of these could be easily replaces by something like this.

int craftingLevel = Skills.SKILLS.CRAFTING.getActualLevel();
int childInterface = craftingLevel >= 38 ? 20 : craftingLevel >= 18 ? 19 : craftingLevel >= 14 ? 18 : craftingLevel >= 11 ? 17 : craftingLevel >= 9 ? 16 : craftingLevel >= 7 ? 15 : 14;

RSInterface itemInterface = Interfaces.get(270, childInterface);
if (itemInterface != null) {
	itemInterface.click();
}

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

  • Similar Content

    • By Beg
      About
      This script is aimed to bank-standing skills such as Fletching, Crafting, Herblore or Cooking.
      It comes with a task-based system that you can set up to train with different items and even multiple skills in one go.

      Tasks
      You can create or load from a previously saved file multiple tasks to be executed by order.
      A task is complete once you reach the desired amount or level.
      A task can also be unfinished if you don't supply enough items for its completion or if you don't meet the required level to execute it.
       
      Script Argument
      The rules for script argument are the following:
      1. Each task is separated by a vertical bar, "|"
      2. Each task setting has an associated key and value, "key=value"
      3. Each task setting is separated by a comma, ","
      4. Option settings follow the same rules as task settings  
      5. Not case-sensitive

      Available task settings:
      skill - the skill you are training with this task. This setting can be ignored if task doesn't give experience in any skill
      item - item's amount and name separated by a space. The first and second items will be used on each other. The last item must be the product. E.g. 1000 cookies.
      master_interface_id -  set master interface id. This setting can be ignored if there isn't any interface after you combine first with second item
      child_interface_id - set child interface id. This setting can be ignored if there isn't any interface after you combine first with second item
      component_interface_id - set component interface id. This setting can be ignored if there isn't any interface after you combine first with second item
      amount - the amount to combine on the task. If this setting is not present, or a number of zero or lower is set, the amount is ignored.
      stop_level - the stop level that interrupts the task. If this is not present, or a number of zero or lower is set, the stop level is ignored. Also, this only works if you input a valid skill on "skill" setting
      inventory_timeout - the inventory timeout for this task. Value is in miliseconds

      Available option settings:
      mouse_speed - indicates the average mouse speed to use
      save_on_system_update -  when set to true, attempts to save the task progress on a .dat file right before an ingame update. The task can then be reloaded on gui
      antiban_reaction - enables with value "true" or disables with value "false" the antiban reaction sleep after an inventory has finished
      antiban_debug - to print anti-ban actions debug on bot debug panel. "true" to enable, "false" to disable
      close_with_esc_button - to use escape keyboard button to close the bank. "true" to enable, "false" to disable
      auto_bank_walking - to walk to the nearest bank whenever the player is not on a bank. "true" to enable, "false" to disable
      auto_ge_walking - to walk to grand exchange before starting a task. "true" to enable, "false" to disable
      disable_mouse_offscreen - disables feature mouse offscreen from antiban to increase efficiency when combining some items

      Example:
      skill=herblore, item=14 avantoe potion (unf), item=14 mort myre fungus, item=14 super energy(3), master_interface_id=270, child_interface_id=14, amount=5000, stop_level=75, inventory_timeout=20000 |
      skill=crafting, item=1 needle, item=26 leather, item=10000 thread, item=26 leather gloves, master_interface_id=154, child_interface_id=93, amount=100, inventory_timeout=50000 |
      mouse_speed=110, save_on_system_update=true, antiban_reaction=false, antiban_debug=true, close_with_esc_button=true, auto_ge_walking=true

      User Interface



      Note: The last item must be the product produced by combining the first and second items.
                 Exact non case sensitive names are a must.
                 You must press enter or click on a empty row to set the last row's value on the table.

      The setup above has four tasks:
      1st.  Using a Knife on a Maple logs to produce 27 Maple longbow (u) per inventory. Ends after 500 Maple longbow (u) are made, or a supply is missing from bank.
      2nd. Using a Bow string on Maple longbow (u) to produce 14 Maple longbow per inventory. Ends after 500 Maple longbow are made or a supply is missing from bank.
      3rd. Using Jug of water on Pot of flour to produce 9 Pizza base per inventory. Ends after 10000 Pizza base are made, or a supply is missing from bank.
      4th. Using a Needle on Leathers to produce 26 Leather boots per inventory. Ends after 1000 Leather boots are made, or a supply is missing from bank.

      Paint




      Updates
      18 April 2017 - Ability to combine two items with same name.
                                 Ability to bypass "make interface" by setting master or child interface id to -1 value.
      27 May 2017 -  Ability to combine items that require going through a selection interface and then an amount interface.
      02 July 2017 - Added script argument.
      20 November 2017 - Updated the script to support the new interfaces. 
                                            Script argument changed.
      06 February 2018 - Changed the script to support more than 2 items on inventory. This will allow the combination of a greater variety of items.
      23 April 2018 - Added option to enable/disable auto bank walking and grand exchange bank walking.
                                 Added option to enable/disable mouse offscreen when idling.
                            
    • By JordiLaFjord
      Hey.
      Just trying to right click make all on the gold bracelet interface. Most recent thing i've trid is getting the RSInterfaceChild braceInterface = Interfaces.get(446,47); then calling it as braceInterface.click("Make-All");
      I've tried a few other things from the forum that I can't thing of atm, so any help would be appreciated.
    • By Potat OG
      Evening all, 

      I'm looking for a crafting/magic script that can:

      1. Purchase Buckets of Sand & Soda Ash at various dock locations.
      2. Use the lunar spell SuperGlass Make to melt the glass.
      3. Use a blowpipe to craft the glass into various items which are sold afterwards.
      4. Hop worlds and repeat the process.

      This is an effective ironman method to get crafting to a higher level. 

      I am willing to discuss payment options if a script like this were to surface.

      I look forward to hearing back from the community on this. 
      Very curious to see how many people would be interested. 

      Cheers & Happy Botting,

      P

       
    • By show ya gunt
      any crafting script i use will work except for the glass blowing.
      bot will use the glassblowing pipe on the molten glass continuously "wont select *make all*"

      if anyone could give some information or help it would be much appreciated!
       
    • By montreal176
      Hey! Thanks for having a look at my second Tribot script!
      This script will spin flax at lumbridge.
       
      NOTE: Source code is at bottom, critiques on code are appreciated.
       
      Features
      - ABC2 7/10 - Everything except the Reaction Times
      - Spins flax at lumbridge
      - Log's out if no materials are detected
      - Spins ~1150 Bowstring's per hour
       
      Source
      https://github.com/jroy8/TribotScripting/tree/master/src/scripts/MontsFlax
       
      Repository Link
       
      To-do List
       - Craft more Bowstrings per hour
      - Add ABC2 reaction times
       
      Update Log
       
    • By KiwiRun
      kSpinner
      KiwiRun
       
      I have written this script as I have found spinning flax at Seers Village to have a lower ban rate than when spinning in Lumbridge, which makes up for it being slightly less bow strings per hour. 
       
      Features
      Spins flax in Seers Village. Logs out when out of flax. Deposits all items when banking. Will logout and end script is bot is lost. Can be started anywhere (Theoretically). Uses webWalking to get to Seers Village. Usage
      To use this script, simple start it while near Seers Village. If have flax on you it will run straight to the Spinner otherwise bank for flax. If your character is not near Seers Village it will use WebWalking to get there.
       
      Changelog
       
      Download
    • By pkerman
      Rune Crafter 6000!   Looking for that script that will craft multiple Runes for you for hours on end? Look no further!         What does it do? This script will effortlessly craft all of the Runes of your choice your heart desires!!  Supports multiple Rune Crafting: Air, Mind, Body, Earth. Supports multiple Banks: Varrock West, Varrock East, Falador West, Falador East, and Edgeville. Will keep track of how many runes you have crafted.   Where do I start it? ​You must start the script at whichever bank you'd like to bank at.   What levels/items do I need? The required RC level for the rune you wish to craft. The tiara of whichever rune you wish to craft, equipped! Pure Essence (will add Rune Essence if someone gives me ID)  
      Recommendations?
      Bank Varrock E. for Earth runes, Edgeville for Body, Fally W. for Mind, and Fally E. for Air.  
      To Do:
      Add Multiple pouch support  
       
      I would really appreciate feed back & proggies (when I add paint).
      REPORT ALL BUGS IF YOU WANT THIS SCRIPT TO BE FLAWLESS.
       
       
      Get This Script!
       
      Proggies:


       
       
       
      updates:

    • By pkerman
      Body Crafter 6000!
       
      Looking for that script that will craft Body Runes for you for hours on end? Look no further!
       
       
       
       
      What does it do?
      This script will effortlessly craft all the Body Runes your heart desires!! 
      Supports Small Pouch (only have small pouch - if you guys supply me with ID's of other pouches I'll gladly add them).
       
      Where do I start it?
      Wherever (Preferably Edge Bank).
      What levels/items do I need?
      Level 20 RC
      Body Tiara(equipped) - will add talisman support if someone gets me ID.
       

      To Do:

      Add Paint
      Add Multiple pouch support
      Add talisman support
       

       

      *Warning! I haven't implemented measures to stop script/log out once out of essence.*

       

       

       

      Get This Script!

       

       

       

      Post feedback if you'd like. Please report any bugs! Enjoy!

    • By pkerman
      Mind Crafter 6000!
       
      Looking for that script that will craft Mind Runes for you for hours on end? Look no further!
       
       
       
       
      What does it do?
      This script will effortlessly craft all the Mind Runes your heart desires!! 
      Supports Small Pouch (only have small pouch - if you guys supply me with ID's of other pouches I'll gladly add them).
       
      Where do I start it?
      Wherever (Preferably Falador West Bank).
      What levels/items do I need?
      Level 2 RC
      Mind Tiara(equipped) - will add talisman support if someone gets me ID.
       

      To Do:

      Add Paint
      Add Multiple pouch support
      Add talisman support
       

       

      *Warning! I haven't implemented measures to stop script/log out once out of essence.*

       

       

       

      Get This Script!

       

       

       

      Post feedback if you'd like. Please report any bugs! Enjoy!

    • By pkerman
      Earth Crafter 6000!   Looking for that script that will craft Earth Runes for you for hours on end? Look no further!         What does it do? This script will effortlessly craft all the Earth Runes your heart desires!!  Supports Small Pouch (only have small pouch - if you guys supply me with ID's of other pouches I'll gladly add them).   Where do I start it? Varrock East Bank What levels/items do I need? Level 9 RC Earth Tiara(equipped) - will add talisman support if someone gets me ID.  
      To Do:
      Add Paint Add Multiple pouch support Add talisman support  
       
      *Warning! I haven't implemented measures to stop script/log out once out of essence.*
       
       
       
      Get This Script!
       
       
       
      Post feedback if you'd like. Please report any bugs! Enjoy!
  • Our picks

    • 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
    • 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


      Bug fix for intelligent banking


      Improvement to the stability of LG over time



      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
      • 10 replies
    • - Updated the banking API to use the game item cache instead of interfaces. This will result in less delay, greater efficiency, and greater reliability. LG will especially benefit from this update.
      - Fixed a bug with the Grand Exchange API relating to searching for items.
        • Like
      • 5 replies
    • This release includes:

      * Banking update fix
      * Cache loader bug fix
      ** When TRiBot detects the cache reader has issues loading the cache, it will reload it all. This fixes the problem of loading an old cache which is re-written after loading a new client update.
        • thonking
        • Sad
        • Haha
        • Thanks
        • Like
      • 43 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×