Jump to content
adamhackz

Progressive Leather/Glass Crafter [Updated 7.21.2018]

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
 

- Supports both Molten glass and Soft Leather( Leather).
- Will automatically switch to the next best glass/leather item upon level-up

- Clicks on the closest item to the needle/blowpipe instead of the same item every single time.


 

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

Version 3.00 Added support for progressive crafting with glass items, removed some custom antiban and static Abc, removed some unnecessary sleeps, added a little info to the paint such as runtime, and the current argument, added clicking on closest item instead of the same item every time

 

Edited by adamhackz
update v3
  • thonking 9

Share this post


Link to post
Share on other sites

V2 Released

Script actually stops when out of leather now

Removed long idle time after level up

 

 

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

17 hours ago, Einstein said:

Nice release @adamhackz

 

Can't wait to see it.

 

20 hours ago, ineu said:

Is this open source?

 

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

 Added support for progressive crafting with glass items, removed some custom antiban and static Abc, removed some unnecessary sleeps, added a little info to the paint such as runtime, and the current argument, added clicking on closest item instead of the same item every time

 

You can activate the script here

https://tribot.org/repository/script/id/2842

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 wastedbro
      Wasted Tanner

       
      Features:
      Supports all hides Supports Energy, Super Energy, and Stamina Potions Adjustable mouse speed ABCv2 antiban  
      Click here to activate it on the repository
       
       
      https://tribot.org/repository/script/id/2915
    • By adamhackz
      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 logs to turn into unstrung bows upon level-up
      - Supports arguments
      progressive (untested but should make arrow shafts up to level 5)-> shortbows -> longbows ->oak shortbow -> oak longbows ->willow shortbow - > willow longbow - >maple shortbow - > maple longbow -> yew shortbow - > yew longbow -> magic longbow maple shortbow maple longbow yew shortbow yew longbow magic shortbow magic longbow string (only works for magic longbows at the moment)
       
      Download: https://tribot.org/repository/script/id/2722
       
      Source: https://github.com/bolsilent/TRiBot/tree/master/progressiveFletcher2
       
      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
       
        Hide contents  
      Version 1.00 soon tm
      Version 2.00 Fixed a bug where script tried to fletch while bank was open
      Version 3.00 Fixed a bug with fletching arrow shafts
      Version 4.00 Added more human-like stringing(still only supports magic longs)
      Version 5.00 Fixed bug where inventory wouldn't deposit, removed unnecessary code, added a timeout to stop attempts to double withdraw
      Version 6.00 Rewrote the entire script with a different framework, still fairly basic but improved greatly.
    • 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 iant06
      Progressive Chopper


      -Start with axe in your inventory or equipped.
      -Automatically progresses to the next level tree by your woodcutting level.
      -Only supports Trees, Oak trees, and Willow trees.
      -Collects Bird's Nests
      -Drops Logs
      -ABC2 Anti-Ban
    • 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:

  • Our picks

    • Please welcome our new developers, @JoeDezzy1, @erickho123, @Encoded, and @wastedbro.

      These members will be responsible for working on, maintaining, and improving TRiBot.

      This means that bug fixes and improvements will now come at a much faster pace! We're committed to providing users with the best botting experience possible!
        • Thanks
        • Like
      • 30 replies
    • This release includes:

      More 3rd party libraries for script writers to use


      Apache Commons Codec


      Apache Commons Collections


      Apache Commons Configuration


      Apache Commons IO


      Apache Commons Lang


      Apache Commons Math


      GSON


      Guava


      JFoenix




      Hint arrow API


      Game#getHintArrowX


      Game#getHintArrowY




      Fix player hooks including Player#getSkullIcon and Prayer#getPrayerIcon
        • Thanks
        • Like
      • 41 replies
    • This update includes:

      Fix broken hooks


      Fix login bot for the message "No reply from login server. Please wait 1 minute and try again."


      Fix bug relating to which bot tab is sent human input


      General#randomLong bug fix involving negative numbers


      Fix GE API



      Please note: There are still some issues with the login bot due to a change in the game mechanisms handling the login screen. We're working on a fix and will upload it when ready.
        • Thanks
        • Like
      • 37 replies
    • This release will:

      Fix key event handling issue


      Fix other event handling issue


      Fix RSServer hook


      Update world hopper to have it use OCR, thanks to Todd


      Use proper disposal of old Graphics objects


      Reformat code


      Rearrange code


      Organize code imports


      Apply around 8000 automated code refactorings


      Make preparations for Java 9


      Fix 11 various bugs


      Add more reliable debugging support


      Fix mouseEntered/Exited event dispatching bug


      Fix minimap walking bug where it opens the map


      Fix broken hooks for today's game update
        • Thanks
        • Like
      • 100 replies
    • This update will:

      Fix GE inventory item positioning bug


      Fix broken object hooks
        • Like
      • 27 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×