Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Script that picks up Feathers?


    mattjewww

    Recommended Posts

    Please do. Thanks!

     

    Hi Matt, 

     

    I wrote it (its simply loots feathers), haven't tested it as I am at work, please let me know if it works as expected :)

     

    Note: You will have to save it & run as Local 

     

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.Player;
    import org.dreambot.api.wrappers.items.GroundItem;
    
    
    @ScriptManifest(author = "Franjey", category = Category.MONEYMAKING, name = "Feather Looter", version = 0.1, description = "Loots Feathers")
    
    
    
    
    public class featherLooter extends AbstractScript {
    
    
    private State state = null;
    
    
    private enum State{
    LOOT, SLEEP
    }
    
    
    private State getState(){
    if(getLocalPlayer().isInCombat()){
    return State.SLEEP; 
    }
    else{
    GroundItem gi = getGroundItems().getClosest("Feather");
    return State.LOOT;
    }
    }
    
    
    @Override 
    public void onStart(){ 
    log("Time to loot feathers!");
    }
    
    
    public void onExit() {
    log("Ending script");
    }
    
    
    @Override
    public int onLoop() {
    
    
    Player myPlayer = getPlayers().myPlayer();
    
    
    if(!getWalking().isRunEnabled() && getWalking().getRunEnergy() > Calculations.random(30,50)){
    getWalking().toggleRun();
    }
    
    
    getDialogues().clickContinue();
    
    
    state = getState();
    switch(state){
    case LOOT: 
    GroundItem feather = getGroundItems().getClosest("Feather");
    if(feather != null){
    if(feather.isOnScreen()){
    feather.interact("Take");
    sleep(900,1200);
    }
    else{
    getWalking().walk(feather.getTile());
    }
    }
    break;
    
    
    case SLEEP:
    sleep(200,400);
    break;
    }
    return Calculations.random(300, 600);
    }
    
    
    
    
    }
    Link to comment
    Share on other sites

     

    Hi Matt, 

     

    I wrote it (its simply loots feathers), haven't tested it as I am at work, please let me know if it works as expected :)

     

    Note: You will have to save it & run as Local 

     

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.Player;
    import org.dreambot.api.wrappers.items.GroundItem;
    
    
    @ScriptManifest(author = "Franjey", category = Category.MONEYMAKING, name = "Feather Looter", version = 0.1, description = "Loots Feathers")
    
    
    
    
    public class featherLooter extends AbstractScript {
    
    
    private State state = null;
    
    
    private enum State{
    LOOT, SLEEP
    }
    
    
    private State getState(){
    if(getLocalPlayer().isInCombat()){
    return State.SLEEP; 
    }
    else{
    GroundItem gi = getGroundItems().getClosest("Feather");
    return State.LOOT;
    }
    }
    
    
    @Override 
    public void onStart(){ 
    log("Time to loot feathers!");
    }
    
    
    public void onExit() {
    log("Ending script");
    }
    
    
    @Override
    public int onLoop() {
    
    
    Player myPlayer = getPlayers().myPlayer();
    
    
    if(!getWalking().isRunEnabled() && getWalking().getRunEnergy() > Calculations.random(30,50)){
    getWalking().toggleRun();
    }
    
    
    getDialogues().clickContinue();
    
    
    state = getState();
    switch(state){
    case LOOT: 
    GroundItem feather = getGroundItems().getClosest("Feather");
    if(feather != null){
    if(feather.isOnScreen()){
    feather.interact("Take");
    sleep(900,1200);
    }
    else{
    getWalking().walk(feather.getTile());
    }
    }
    break;
    
    
    case SLEEP:
    sleep(200,400);
    break;
    }
    return Calculations.random(300, 600);
    }
    
    
    
    
    }

     

     

    What are the click continue and myPlayer lines for? You are wasting resources by leaving those unnecessary things in your script. You are also doing GroundItem feather = getGroundItems().getClosest("Feather"); twice. Sure, in a small script it doesn't make a big difference but if you continue this habit and make bigger scripts it will add up and your scripts will be more resource hungry than others. Also IMO you don't even need to use states for this. You only really need the following in you onLoop():

    GroundItem feather = getGroundItems().getClosest("Feather");
    if(feather != null){
    if(feather.isOnScreen()){
    feather.interact("Take");
    sleep(900,1200);
    }else{
    getWalking().walk(feather);
    }
    

    and

    getWalking().setRunThreshold(Calculations.random(30,50));

    in your onStart() for this script.

    Link to comment
    Share on other sites

    Hi Matt, 

     

    I wrote it (its simply loots feathers), haven't tested it as I am at work, please let me know if it works as expected :)

     

    Note: You will have to save it & run as Local 

     

     

     

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.Player;
    import org.dreambot.api.wrappers.items.GroundItem;
    
    
    @ScriptManifest(author = "Franjey", category = Category.MONEYMAKING, name = "Feather Looter", version = 0.1, description = "Loots Feathers")
    
    
    
    
    public class featherLooter extends AbstractScript {
    
    
    private State state = null;
    
    
    private enum State{
    LOOT, SLEEP
    }
    
    
    private State getState(){
    if(getLocalPlayer().isInCombat()){
    return State.SLEEP; 
    }
    else{
    GroundItem gi = getGroundItems().getClosest("Feather");
    return State.LOOT;
    }
    }
    
    
    @Override 
    public void onStart(){ 
    log("Time to loot feathers!");
    }
    
    
    public void onExit() {
    log("Ending script");
    }
    
    
    @Override
    public int onLoop() {
    
    
    Player myPlayer = getPlayers().myPlayer();
    
    
    if(!getWalking().isRunEnabled() && getWalking().getRunEnergy() > Calculations.random(30,50)){
    getWalking().toggleRun();
    }
    
    
    getDialogues().clickContinue();
    
    
    state = getState();
    switch(state){
    case LOOT: 
    GroundItem feather = getGroundItems().getClosest("Feather");
    if(feather != null){
    if(feather.isOnScreen()){
    feather.interact("Take");
    sleep(900,1200);
    }
    else{
    getWalking().walk(feather.getTile());
    }
    }
    break;
    
    
    case SLEEP:
    sleep(200,400);
    break;
    }
    return Calculations.random(300, 600);
    }
    
    
    
    
    }

    I'm new to this. How do I get it onto my client?

     

    Appreciate your help dearly, Franjey.

    Link to comment
    Share on other sites

    What are the click continue and myPlayer lines for? You are wasting resources by leaving those unnecessary things in your script. You are also doing GroundItem feather = getGroundItems().getClosest("Feather"); twice. Sure, in a small script it doesn't make a big difference but if you continue this habit and make bigger scripts it will add up and your scripts will be more resource hungry than others. Also IMO you don't even need to use states for this. You only really need the following in you onLoop():

    GroundItem feather = getGroundItems().getClosest("Feather");
    if(feather != null){
    if(feather.isOnScreen()){
    feather.interact("Take");
    sleep(900,1200);
    }else{
    getWalking().walk(feather);
    }
    

    and

    getWalking().setRunThreshold(Calculations.random(30,50));

    in your onStart() for this script.

    Click Continue is to handle dialogue boxes (in case any random appears that involves dialogues). Declared myPlayer in case I need to use it but I could just remove. As for the getWalking().set... it works properly

    Btw, I am still in the learning stage :P

     

    I'm new to this. How do I get it onto my client?

     

    Appreciate your help dearly, Franjey.

     

    Hey Matt, to add this script you can try perhaps copying this into a notepad, changing the extension to .java and then saving it in the bot client -> Scripts

    If you have any doubts, please dont hesitate to ask, I will be glad to help :P

    Link to comment
    Share on other sites

    I CBF waiting 24+ hours for such a shitty script upload so:

    .jar Link: https://hostr.co/6JDyjsS6SpQE

    Paste it at C:\Users\YourUsernameHere\DreamBot\Scripts\

     

    xFikrRb.png

     

     

    EDIT:

     

    Click Continue is to handle dialogue boxes (in case any random appears that involves dialogues). Declared myPlayer in case I need to use it but I could just remove. As for the getWalking().set... it works properly


    Btw, I am still in the learning stage  :P

     

     

    Hey Matt, to add this script you can try perhaps copying this into a notepad, changing the extension to .java and then saving it in the bot client -> Scripts


    If you have any doubts, please dont hesitate to ask, I will be glad to help  :P

     

    When you're looting feathers you can't get dialogue since DreamBot doesn't do randoms. 

     

    Also what you said above will not work. DreamBot will only read .jar files. You will need to save the code as "featherLooter.java" and then Google how to make .java files into a .jar file.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.