Jump to content

How do I make my script eat .


Recommended Posts

Posted (edited)

So I took the skeleton from the topic in tutorials and I wanted to know what I have to do to make my bot eat under a certain hp

This is the snippet of code.



    	NPC kurask = npcs.closest("Kurask");
        if(kurask != null){
            kurask.interact("Attack");
            getGroundItems().closest(loot).interact("Take");
           if (getSkills().getDynamic(Skill.HITPOINTS) > random(20,getSkills().getStatic(Skill.HITPOINTS)-22)){
    	
        	

Also if you know a formula that works well for calculating what hp to eat at I would love to know.

Edited by BotScaper
Posted
36 minutes ago, Prolax said:

- Check if npc is visible

- Check if npc not is null

- Check if myplayer not in combat

- Check if myplayer not interacting

That should be it, just look in the API for the methods.

if(kurask != null && !players.myPlayer().isUnderAttack()||!players.myPlayer().isAnimating()||kurask.isVisible()){

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...