Jump to content

Stesextro

Members
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

284 profile views

Stesextro's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. I am having a problem with my state node combat script. I have nodes for eating, attacking, and looting so far. It attacks perfectly fine, and eats when health goes below a certain %, but after it kills the monster it does not do anything. I am unsure if the problem lies in my attack node, or my node controller. Although I am assuming the problem is with the attack node. (Possibly not returning true? or getting stuck within the execute method). I will attach my Attack node source code to better help with debugging this issue. public class Attack extends Node { Constants c = new Constants(); NPC monster = sA.npcs.closest(" "); public Attack(Script sA) { super(sA); } @Override public String status() { return "Attacking!"; } @Override public boolean validate() throws InterruptedException { //If in area, and health is > 60, and inv contains lobs if (sA.inventory.contains(c.LOBSTER_ID) && sA.myPlayer().getHealth() > 60 && !sA.myPlayer().isUnderAttack()) { return true; } else { return false; } } @Override public boolean execute() throws InterruptedException { if (monster != null && monster.getHealth() > 0) { if (monster.isVisible()) { sA.camera.toEntity(monster); monster.interact("Attack"); sA.sleep(sA.random(1000, 3000)); } if (sA.myPlayer().isUnderAttack()) { return true; } } return false; } } Replaced the monster I am fighting with "monster", in order to keep some form of secrecy ;)
×
×
  • Create New...