Plsnojagex 0 Share Posted January 7, 2019 Just like the title says Link to comment Share on other sites More sharing options...
Hashtag 8694 Share Posted January 7, 2019 To get your health, use https://dreambot.org/javadocs/org/dreambot/api/methods/combat/Combat.html#getHealthPercent-- To calculate potion boosts, use https://dreambot.org/javadocs/org/dreambot/api/methods/skills/Skills.html To interact with a piece of food or potion, use https://dreambot.org/javadocs/org/dreambot/api/methods/container/impl/Inventory.html#interact-java.lang.String-java.lang.String- Link to comment Share on other sites More sharing options...
Plsnojagex 0 Author Share Posted January 7, 2019 So to utilize this in my script, I would first use getHealthPercent(), and then place an if statement with the following code: interact(lobster,eat); ? Link to comment Share on other sites More sharing options...
Hashtag 8694 Share Posted January 7, 2019 15 minutes ago, Plsnojagex said: So to utilize this in my script, I would first use getHealthPercent(), and then place an if statement with the following code: interact(lobster,eat); ? That's right, so: // Eats at 50% or below if (getCombat().getHealthPercent() <= 50) { getInventory().interact("Lobster", "Eat"); } Link to comment Share on other sites More sharing options...
Plsnojagex 0 Author Share Posted January 7, 2019 What package would I need to interact with an NPC? Like during quests when you have to communicate with a lot of NPCs, which packages should I be using? Sorry if im asking a bit too much Im just trying to learn Link to comment Share on other sites More sharing options...
Nuclear Nezz 2055 Share Posted January 7, 2019 9 hours ago, Plsnojagex said: What package would I need to interact with an NPC? Like during quests when you have to communicate with a lot of NPCs, which packages should I be using? Sorry if im asking a bit too much Im just trying to learn npc.interact NPC n = getNpcs().closest("Plsnojagex"); n.interact("Help"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.