Jump to content

Extreme Scripts

Trade With Caution
  • Posts

    10702
  • Joined

  • Last visited

  • Days Won

    27
  • Feedback

    96.2%

Posts posted by Extreme Scripts

  1. If you purchase a script from the store it should automatically be added to your account... Sometimes it takes an hour or so, if it's not there within one hour of purchase please contact @Maldesto

  2. You would need to use a scanner/buffered reader for this. Very simple assignment.

    private String fName;
    private String sName;
    private double pay;
    private double increase;
    
    private BufferedReader br;
    
    private void readData(){
       br = new BufferedReader(new InputStreamReader("FiLE PATH"));
       String input = "";
       while((input = br.readLine()) != null){
           String[] fields = input.split(" ");
           sName = fields[0];
           fName = fields[1];
           pay = Double.parseDouble(fields[2]);
           increase = Double.parseDouble(fields[3]);
       }
    }
    

    Then you would have to use a PrintWriter/FileWriter for the output part... Sure you can figure out the rest happy.png

    • Like 1
  3. @Botre

    it will sometimes click on another chicken while he's alrdy in combat with a chicken, and sometimes while he's fighting a chicken, it will reclick on the chicken, while it is alrdy fighting it.

    And after it has killed the chicken, it will keep clicking on it till it completely dissapears (the animation of one dying and dissapearing).

     

    "1) Get the instance of the NPC"

    if i do that, and the chicken is alrdy under attack by someone else, it will do nothing and wait till it's dead, while it should be looking for another one to kill, that can be located a bit further than the one in the instance. So basically it is wasting time while he could be attacking another one.

     

    Or do you mean something else, or did i misunderstand u?

    i meant use filters;

    NPC chicken = getNpcs().closest(new Filter<NPC>({
        @Override
        public boolean match(NPC npc){
           return npc.getName().equalsIgnoreCase("chicken") && !npc.isUnderAttack() && getMap().canReach(npc) && npc.getHealth() > 0;
        }
    });
    

    Don't copy and paste cos I wrote that with no code assist so the filter could be wrong. This in essence will return the closest chicken that you can attack, is reachable, has health > 0, not currently being attacked. Of course you can tweak the boolean as you wish but that's all you need really.

     

    Much more efficient/cleaner/easy to read & understand happy.png

    • Like 2
  4. Well firstly, you don't need to iterate the npc's in the region to get the best one you can just use filters for that and return the npc best suited based on the conditions you provide. 

     

    1) Get the instance of the NPC

    2) Check if your player is interacting with it

    3) If not attack if yes, sleep

     

    I would give you the code for it but then I don't think you would learn from it unless you familiarize yourself with the api by digging through it.

  5. Works fine, thanks, does OSRS client have to be on the whole time?

     

    Yes it will, the whole idea of mirror is that it attaches itself to an existing instance of Runescape to make it seem as if you are playing from the client you are running it on.

×
×
  • Create New...