openkore icon indicating copy to clipboard operation
openkore copied to clipboard

How to talk to NPC when below HP?

Open Reynbow opened this issue 9 years ago • 5 comments

When leveling a novice in the training grounds, I want the bot to talk to Brade, who's at 96,30 on all the novice maps.

I've tried adding this:

doCommand talknpc 96 30 c {
	hp < 25%
}

But if I'm not already near the NPC when I'm below 25% HP then it just says it can't find the NPC. So I tried adding this:

doCommand move 90 30 {
	hp < 25%
}

But all that does is SPAM the console log with "attempting to move" and basically locks up the program. The character never moves.

Any help would be appreciated.

Reynbow avatar Jul 17 '17 23:07 Reynbow

I could write an eventMacro for you that does that, but on macro plugin / doCommand that would prove very hard to do.

Henrybk avatar Jul 18 '17 00:07 Henrybk

Anything you could do to help would be amazing. I keep having to look over and manually tell it to talk to the NPC :(

Reynbow avatar Jul 18 '17 00:07 Reynbow

I am currently working on a macro to go through the entire zone and do all of the quests. This isn't 100% tested but something like this should do it.

Note: This heals you to 100% if your character has died and respawns (next to Brade). You would need to do some tweaking to the hook/conditions to check your HP and then move to him before death.

automacro death_locker_novice_zone {
  location new_1-3
  hook in_game
  call {
    lock respawned_novice_zone
  }
}

automacro respawned_novice_zone {
  location new_1-3
  hook Network::Receive::map_changed
  run-once 1
  call {
    pause @rand(1,2)
    do talknpc 96 30
    pause @rand(1,2)
  }
}

automacro died_novice_zone {
  location new_1-3
  hook self_died
  call {
    release respawned_novice_zone
  }
}

koynro avatar Jul 19 '17 18:07 koynro

How do I use these Macros? EDIT: I think I figured it out. Thanks man. :)

Reynbow avatar Jul 20 '17 00:07 Reynbow

Solved the problem using macro

alisonrag avatar Aug 04 '17 16:08 alisonrag