Jump to content

How do I make my script eat .


BotScaper

Recommended Posts

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
Link to comment
Share on other sites

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()){

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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