Jump to content

scriptersteve

Members
  • Posts

    258
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by scriptersteve

  1. Hi all, my name is rather obviously Steven and I have recently got into bot writing. A few of my scripts I have been working on include Tokens collecting and cyclops defender farming.

    I have now got dragon defenders (ban-free) on both my accounts and am looking to improve my scripting.

    As such I will be offering a Dragon defenders service. This will be botted and i will not be responsible for any bans that occur during the service.

    Although it will be botted, I will be babysitting it as I am looking to improve my script by making changes to my scripts so will be using your account as basically a tester account for changes that i make.

    Cost will be roughly 2m (stat dependent) or I will also be accepting $2 in the form of osbot vouchers for the dragon defender, I'll happily go first if trusted, otherwise we can use a verified MM.

    In the unlikely event that your account does get a ban either 2 day or perm, I will not charge you for the service. 

    My Discord is Stephen#4141

     

    Order form:

    Combat stats:

    Other details(whether you want script to alch loots e.t.c):

    Did you add me on discord?:

    What's your discord:

     

    TOS:

    1. You may not log into the account during a service unless you have permission from the owner of the service, doing so will result in the termination of the service with NO Refund.
    2. You MUST NOT change the details of the account until the service has been completed, doing so will result in a void service with NO Refund.
    3. If there are any items required for the service, it is between you and the service owner to come to an agreement on who covers them
    4. You MUST change your password after the service is completed
    5. If you have any substantial wealth on the account, it is your responsibility to protect it (Either Bank Pin/Transfer Trade)
    6. Once the service is complete you must leave Feedback for the relevant parties involved
    7. You MUST Post on the service thread to acknowledge their individual T.O.S and start the service

    8. If the Service is requested to be done legit, any T.O.S related to bans/mutes become obsolete (Unless evidence can be provided of prior botting)

  2. 14 minutes ago, liverare said:

    I wouldn't listen to what others have said, because from reading your code I can see you haven't quite grasped how loops work. You shouldn't be dabbling in enumerators, Lambda expressions, or even extending classes if you haven't figured out how to use loops. Also, be sure to separate chunks of logic into separate routines to make it easier to read and maintain:

    
    public String getNextArrow() {
    	
    	String result = null;
    	int arrowCount;
    	
    	String[] arrows = {
    		"Adamant arrow",
    		"Mithril arrow",
    		"Steel arrow",
    		"Iron arrow",
    		"Bronze arrow"
    	};
    
    	for (String arrow : arrows) {
    		
    		arrowCount = getInventory().getAmount(arrow);
    		
    		if (arrowCount > 500) {
    		
    			result = arrow;
    			break;
    		}
    	}
    	
    	return result;
    }
    
    public void equipArrows() {
    
    	String nextArrow = getNextArrow();
    
    	if (nextArrow != null) {
    		
    		getInventory().interact("Equip", nextArrow);
    	}
    }

    Now there are reasons to use enumerators and Lambda expressions to really enhance what it is you're trying to achieve. But sometimes, simple = better.

    Thanks, i actually understand everything you just wrote :')

    • Like 1
  3. 45 minutes ago, Orez said:

    Could you get the script to eat the whole cake?

    in future - maybe for now: no. It'll work with every other food so just select a different one.

    If i ever get to upload to SDN i will be adding extra stuff like that.

    Added some extra stuff since last upload but not much, working on other scripts now

  4. 1 hour ago, nosepicker said:

    Could also create an enum, cause it's by nature meant to be a "classifier". Then just go through all the list at one go and no need for lenghty hardcoded if statements

    
    enum Arrows {
    		BRONZE_ARROW("Bronze arrow", 1, 50),
    		IRON_ARROW("Iron arrow", 1, 50);
    		// Etc, add more
    		
    		private String name;
    		private int level;
    		private int minimumAmount;
    		
    		private Arrows(String name, int level, int minimumAmount) {
    			this.name = name;
    			this.level = level;
    			this.minimumAmount = minimumAmount;
    		}
    		
    		public String getName() {
    			return this.name();
    		}
    		
    		public int getLevel() {
    			return this.level;
    		}
    		
    		public int getMinimumAmount() {
    			return this.minimumAmount;
    		}
    	}
    	
    	public String getBestArrow(Script s) {
    		Optional<Arrows> arrowOpt =  Arrays.asList(Arrows.values()).stream()
    				// Only get those which you can wield
    				.filter(f -> s.skills.getStatic(Skill.RANGED) >= f.getLevel())
    				// Check if has in inventory
    				.filter(f -> s.inventory.contains(f.getName()))
    				// Check if has the minimum amount
    				.filter(f -> s.inventory.getAmount(f.getName()) >= f.getMinimumAmount())
    				// Sort in a descending order (last entries in enum first) returns best arrows first
    				.sorted((m, n) -> n.ordinal() - m.ordinal())
    				.findFirst();
    		if (arrowOpt.isPresent())
    			return arrowOpt.get().getName();
    		return "";
    	}

    This should (didn't test it) find the best arrow you can equip if it's in inventory

    Could use like this

    
    String bestArrow = getBestArrow(/*param*/);
    if (bestArrow != "")
    	s.inventory.interact("Equip", bestArrow);

     

    Hey mate, thanks - i had a few queries to help me understand: in the String bestArrow = getBestArrow(param) what is the param part?

    Also the streaming/ordinals part is not something i've come across - just read the Java api. But not quite sure how exactly it works - would you be able to explain a bit more? I dso get ordinal is kinda like position? but is that all it is?

  5. 11 minutes ago, Explv said:

    .contains(), .getAmount() and .interact() all accept a Filter<Item>:

    
    inventory.contains(item -> item.getName().endsWith(" arrow"))

     

    if(inventory.contains(inventory.contains(item -> item.getName().endsWith(" arrow"))))
        if(getInventory().getAmount(inventory.contains(item -> item.getName().endsWith(" arrow"))) > 500) {
    //       getInventory().interact("Equip", arrows2);

     

    when i try the above the error i get on both getaount and contains is the following: cannot resolve method get amount (boolean)

  6. 
     int a = getEquipment().getSlotForNameThatContains("arrow");
         Item  arrows2 = getEquipment().getItemInSlot(a);
    //     if(inventory.contains(arrows2) && getInventory().getAmount(arrows2) > 500) {
      //       getInventory().interact("Equip", arrows2);

    So I want to do something like above: make a filter for all possible arrow types that could be in inv and equip them once x amount are in the inventory. However due to inventory .contains and all other methods require a string input am struggling to see how this would work. 

    I can get it to workin the following way but this is cumbersome and messy:

    if (inventory.contains("Adamant arrow") & getInventory().getAmount("Adamant arrow") > 500) {
        getInventory().interact("Equip", "Adamant arrow");
    } else if (inventory.contains("Mithril arrow") & getInventory().getAmount("Mithril arrow") > 500) {
        getInventory().interact("Equip", "Mithril arrow");
    }else if(inventory.contains("Steel arrow") & getInventory().getAmount("Steel arrow") > 500) {
        getInventory().interact("Equip", "Steel arrow");
    }else if(inventory.contains("Iron arrow") & getInventory().getAmount("Iron arrow") > 500) {
        getInventory().interact("Equip", "Iron arrow");
    }else if(inventory.contains("Bronze arrow") & getInventory().getAmount("Bronze arrow") > 500) {
        getInventory().interact("Equip", "Bronze arrow");
    }

    Any feedback you have to improve my writing of situations like this would be appreciated

  7. Hi guys, need some testers for my Defenders script. I have one 'test' account but it already has like 15 d defs so not sure how the chat works with kamfreena if u actually don't have the defenders

    On 1/21/2018 at 1:07 PM, scriptersteve said:

    Hi guys, need some testers for my Defenders script. I have one 'test' account but it already has like 15 d defs so not sure how the chat works with kamfreena if u actually don't have the defenders

    PM if interested in testing for me:

    V1 loots defenders and talks with Kamfreena to reset cyclops, goes back in and starts killing again. But on my acc which has d def already

     

    Find latest version, wasn't going to release until i got SDN access but it's taking so long figure why not:

    Current link: https://www.dropbox.com/s/awrx4vtxjdl6dos/Cyclops.jar?dl=0

    If you want it to alch drops: place nats and fire runes in inventory.

    Automatically uses super str/att/def potions if u have them in the bank.

    Banks when out of food.

    eats food to make space for looting.

    Loots 'valueable' drops.

    If you want it to do dragon defender - ensure rune defender is in your inventory.

    Has got me 2 d defs so far although i only added the D def from rune after i got my 2nd d def so it's untested but think it should work so long as webwalking finds it ok

    If you like the script and enjoy it, please feel free to donate me RSGP, Only use it for bonding my accounts.

    Don't play other than for bot writing so my gp stash is low, especially when i spend time on scripts like this which don't really make any money

  8. On 1/19/2018 at 10:34 AM, Golden pk said:

    This is actually really nice

    Pleased to hear, final version of the script has now been done. May add extra bits in future:

     

    Currently: supports range/magic/melee all foods, uses potions if using melee, loots arrows if using range (only loots arrow stacks > size 5), has built in mechanics to stop if out of arrows or out of runes or if you somehow die. Script can be started anywhere (have only tested from lumly)

  9. 36 minutes ago, withoutidols said:

    If I'm not mistaken your current version of *arrows1* , is actually a filter. You're simply using some syntactical sugar to do it inline!

    For reference below is what is really happening behind the scenes

    
    GroundItem arrow = GroundItems.closest(new Filter<GroundItem>(){
      
      	public boolean match(GroundItem item){
      		return item != null && item.getName().contains("arrow") && Map.canReach(item);
      
      	}
      
      });

     

    Thanks - that does help my understanding reading it though

×
×
  • Create New...