Jump to content

Prolax

Members
  • Posts

    1729
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Prolax

  1. Well, that method looks very good.
  2. Hi all, Which methods would you advice for the following inventory interactions: - if inventory not contains Peaches && inventory contains bones -> Click on Bones to Peaches tab - if inventory not contains Peaches && inventory not contains bones -> stop script Thanks Prolax
  3. I guess the following implementations would be a good idea: - Create random paths to walk - Moving mouse out of screen at random times - Hovering over next entity or npc - No bugs in script
  4. I'm not using this for attacking goblins. I'm using the variable npc_name, just implementing this into a fighter script.
  5. if(myPlayer().getInteracting() != null) { NPC npc = npcs.closest(npc_name); if (npc != null && npc.isVisible()) { if (hoverEntityOption(npc, "Attack")) { if (myPlayer().getInteracting() != npc) { if (npc.isVisible()) { npc.interact("Attack"); log("Attacking " + npc_name); sleep(random(400, 800)); } else { camera.toEntity(npc); } } } } }else { if(menu.isOpen()) { if(mouse.click(false)) { for(int i = 0; i < 100 && !myPlayer().isUnderAttack(); i++) { sleep(random(20,40)); } } } else { if(npc != null && npc.isVisible()) { if(npc.interact("Attack")) { for(int i = 0; i < 100 && !myPlayer().isUnderAttack(); i++) { sleep(random(20,40)); } } } else if(npc != null && !npc.isVisible()) { camera.toEntity(npc); } else { log(npc_name + " gone?"); } } } I'm having trouble implementing your method. What am I doing wrong? The script keeps logging "npc_name gone?"
  6. Thanks a lot, the attacking is now working perfect. Next I'm going to implement looting and eating. I've read that using states is not adviced, what should I use instead?
  7. public int onLoop() throws InterruptedException { NPC minotaur = getNpcs().closest("Minotaur"); if (!myPlayer().isUnderAttack() || !myPlayer().isAnimating()) { if (minotaur != null && minotaur.isAttackable() && minotaur.getHealth() > 0) { if (minotaur.isVisible()) { minotaur.interact("Attack"); } else if (!minotaur.isVisible()) { camera.toEntity(minotaur); minotaur.interact("Attack"); } } } return (random(100, 300)); } Hi, I still have the following problem, my player keeps spam clicking minotaurs, while it is already fighting a minotaur. public int onLoop() throws InterruptedException { NPC minotaur = getNpcs().closest("Minotaur"); if(minotaur.exists() && !myPlayer().isUnderAttack()){ if(!minotaur.isVisible()){ camera.toEntity(minotaur); } minotaur.interact("attack"); sleep(700); } return (random(100, 300)); } I edited a bit.
  8. Thanks, looks a lot better. Still sometimes my player spamclicks the minotaur.
  9. if(!myPlayer().isAnimating() && !myPlayer().isMoving() && !myPlayer().isUnderAttack()) { if(minotaur != null && minotaur.exists()) { if (minotaur.isVisible()) { minotaur.interact("Attack"); sleep(random(300, 600)); } else { camera.toEntity(minotaur); } } } Ok thanks for the answer. Could you explain why I need a global variable for minotaur? It's only used in OnLoop() I edited my code, see above.
  10. package ProLaxMinotaurFighter; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest( version = 1.0, name = "ProLaxMinotaurFighter", author = "ProLax", info = "This is a Minotaur Fighter script.", logo = "" ) public class ProLaxMinotaurFighter extends Script{ private int currentLevelStr; private int beginningLevelStr; private int beginningXpStr; private int currentXpStr; private int xpGainedStr; private int currentLevelAtt; private int beginningLevelAtt; private int beginningXpAtt; private int currentXpAtt; private int xpGainedAtt; private int currentLevelHp; private int beginningLevelHp; private int beginningXpHp; private int currentXpHp; private int xpGainedHp; public void onStart(){ log("The Minotaur fighter script started."); beginningLevelStr = skills.getStatic(Skill.STRENGTH); beginningXpStr = skills.getExperience(Skill.STRENGTH); beginningLevelAtt = skills.getStatic(Skill.ATTACK); beginningXpAtt = skills.getExperience(Skill.ATTACK); beginningLevelHp = skills.getStatic(Skill.HITPOINTS); beginningXpHp = skills.getExperience(Skill.HITPOINTS); } public int onLoop() throws InterruptedException { NPC minotaur = npcs.closest("Minotaur"); if(!myPlayer().isAnimating() && !myPlayer().isMoving()) { if(minotaur != null) { if (minotaur.isVisible()) { minotaur.interact("Attack"); sleep(random(300, 600)); } else { camera.toEntity(minotaur); } } } else { sleep(random(300, 600)); } return(random(100, 300)); } public void onPaint(Graphics2D g) { Graphics2D gr = g; gr.setColor(Color.cyan); gr.drawString("Prolax Minotaur killer", 10, 230); currentLevelAtt = skills.getStatic(Skill.ATTACK); gr.drawString("Starting Attack level: " + beginningLevelAtt + " ~ Current Attack level: " + currentLevelAtt, 10,245); currentXpAtt = skills.getExperience(Skill.ATTACK); xpGainedAtt = currentXpAtt - beginningXpAtt; gr.drawString("Attack XP gained: " + xpGainedAtt, 10, 260); currentLevelStr = skills.getStatic(Skill.STRENGTH); gr.drawString("Starting Strength level: " + beginningLevelStr + " ~ Current Strength level: " + currentLevelStr, 10,275); currentXpStr = skills.getExperience(Skill.STRENGTH); xpGainedStr = currentXpStr - beginningXpStr; gr.drawString("Strength XP gained: " + xpGainedStr, 10, 290); currentLevelHp = skills.getStatic(Skill.HITPOINTS); gr.drawString("Starting Hitpoints level: " + beginningLevelHp + " ~ Current Hitpoints level: " + currentLevelHp, 10,305); currentXpHp = skills.getExperience(Skill.HITPOINTS); xpGainedHp = currentXpHp - beginningXpHp; gr.drawString("Hitpoints XP gained: " + xpGainedHp, 10, 320); } public void onExit(){ this.log("The Minotaur fighter script stopped."); } } Hi, I started a Minotaur Fighter script. I have a few questions. - Once my player is attacking a NPC, the script keeps clicking on the NPC? - How can I include more antibans methods? - How can I implement more camera turns? Thanks, ProLax
×
×
  • Create New...