Trentnz
Members-
Posts
2 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Trentnz's Achievements
-
Pandemic reacted to a post in a topic: Beginner coder (Al Kahrid killer) - how does my code look
-
Haha well thats because it is chatGPT I’ve been playing around with it and I think thats actually a bad example of some of the code its spat out, but I was curious to see if it could actually spit something workable out
-
Wanting to start off with a simple Al Kahrid warrior killer please let me know what you think of my code import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.wrappers.interactive.Character; import org.dreambot.api.wrappers.interactive.NPC; public class AlKahridWarriorKiller extends AbstractScript { private static final int AL_KAHRID_WARRIOR_ID = 2634; private static final int LOBSTER_ID = 379; private static final int RUNE_SCIMITAR_ID = 4587; @Override public void onStart() { if (!getInventory().contains(RUNE_SCIMITAR_ID)) { log("You do not have a rune scimitar in your inventory. Stopping script."); stop(); } } @Override public int onLoop() { NPC alKahridWarrior = getNpcs().closest(AL_KAHRID_WARRIOR_ID); if (alKahridWarrior != null) { if (!alKahridWarrior.isInteractingWithLocalPlayer()) { if (getInventory().contains(LOBSTER_ID)) { getInventory().interact(LOBSTER_ID, "Eat"); } if (getCombat().getHealthPercent() < 50) { alKahridWarrior.interact("Attack"); } } } else { getWalking().walk(Calculations.random(3095, 3105), Calculations.random(3236, 3247)); } return Calculations.random(1000, 2000); } }