OpenKore / openkore

A free/open source client and automation tool for Ragnarok Online
http://openkore.com
Other
1.28k stars 1.04k forks source link

How to talk to NPC when below HP? #708

Closed Reynbow closed 7 years ago

Reynbow commented 7 years ago

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.

Henrybk commented 7 years ago

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

Reynbow commented 7 years ago

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

koynro commented 7 years ago

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
  }
}
Reynbow commented 7 years ago

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

alisonrag commented 7 years ago

Solved the problem using macro