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
  • How to make my script loot?


    Random Loop

    Recommended Posts

     

    GroundItem feather = getGroundItems().getClosest("Feather");

    should be

    GroundItem feather = getGroundItems().closest("Feather");

     

    also

     

    		if (chicken != null) {
    			chicken.interact("Attack");
                            return 1500;
    			feather.interact("Take");
    		}
    
     
    the feather.interact("Take"); will never be reached, put it before the return
     
    		if (chicken != null) {
    			chicken.interact("Attack");
    			feather.interact("Take");
    			return 1500;
    		}
    

     

     

     

     

    You're my hero !!

    I can't believe I'm this dumb hahaha.

     

    Now I just need to find a better method for looting instead of just sleeping for 3000, is there a way to check if the enemy I'm attacking is at 0 hp?

    Link to comment
    Share on other sites

    You're my hero !!

    I can't believe I'm this dumb hahaha.

     

    Now I just need to find a better method for looting instead of just sleeping for 3000, is there a way to check if the enemy I'm attacking is at 0 hp?

     

    Check the API and see if you can find what you need  ;)

    Link to comment
    Share on other sites

    Check the API and see if you can find what you need  ;)

     

     

    is there a global animation to when npcs die? I could maybe check if that animation is playing, sleep 2-3 seconds and then loot the closest feathers? Not the perfect solution but it'd make sense right?

    Link to comment
    Share on other sites

    could try checking for death animation while in combat ye

    could check for npc.getHealth() <1

     

    many options, try them out and see what works

     

    is there a global animation to when npcs die? I could maybe check if that animation is playing, sleep 2-3 seconds and then loot the closest feathers? Not the perfect solution but it'd make sense right?

    Link to comment
    Share on other sites

    After tinkering around a bit (maybe a bit too much) I found out you can't really check if a chicken's health is at 0 or if it's lower than 25% (they have 3 hp so that'd be 0) because (I'm guessing here) when it healths reaches 0, it stops existing and isn't an npc anymore.

     

    I'd prolly have to use dying animation, but I have no idea to know how to know what the chicken dying animation is.

     

    edit: I think I've found the animation let's test it out now :) !

     

    Welp animation wasn't working either, I did something which doesn'T make 100% sense but it works even though it's clunky, will try to find something better but I'm happy for now.

    Link to comment
    Share on other sites

    After tinkering around a bit (maybe a bit too much) I found out you can't really check if a chicken's health is at 0 or if it's lower than 25% (they have 3 hp so that'd be 0) because (I'm guessing here) when it healths reaches 0, it stops existing and isn't an npc anymore.

     

    I'd prolly have to use dying animation, but I have no idea to know how to know what the chicken dying animation is.

     

    edit: I think I've found the animation let's test it out now :) !

     

    Welp animation wasn't working either, I did something which doesn'T make 100% sense but it works even though it's clunky, will try to find something better but I'm happy for now.

     

    Try checking until chicken you're attacking doesnt exist?

    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.