openkore icon indicating copy to clipboard operation
openkore copied to clipboard

add new TableFile "pets.txt"

Open ya4ept opened this issue 5 years ago • 8 comments

  1. this file contains the names of the monsters that the pets look like
  2. this file can be obtained from "data\luafiles514\lua\datainfo\petinfo.lua"
  3. this is an optional file

If a bot meets a pet "Alice", but before that time it has never seen this monster, then the pet type will always be "Unknown". This patch fixes this problem.

Before:

----------------------------- Pet List -----------------------------
#   Name                      Type             Distance  Coordinates
0   Poring                    Unknown #1002    2.2       (275, 234)
--------------------------------------------------------------------

ya4ept avatar Jan 10 '21 20:01 ya4ept

I have an idea for a better one: 1.we can add pet names to monsters.txt file. 2.add a function to overwrite the monsters.txt file if the monster name is different from the default

ya4ept avatar Jan 12 '21 08:01 ya4ept

I have an idea for a better one: 1.we can add pet names to monsters.txt file. 2.add a function to overwrite the monsters.txt file if the monster name is different from the default

need to check the code, but monster.txt uses the name given from server, sometimes some monsters has different names (event/quest) Example: assassin test quest

also take a look at: https://github.com/OpenKore/openkore/blob/29fe641ca35879b62cfb970a9bf9c2c091694b3b/src/Misc.pm#L2320-L2323

alisonrag avatar Jan 12 '21 13:01 alisonrag

current logic: We only add the name of the monster if its id is not found in monters.txt

If I write 1002 abracadabra to monsters.txt, then when poring is encountered, this value will never change.

I believe we should use the current logic (my second option) instead of adding a new file. @alisonrag what do you think?

ya4ept avatar Jan 12 '21 13:01 ya4ept

current logic: We only add the name of the monster if its id is not found in monters.txt

If I write 1002 abracadabra to monsters.txt, then when poring is encountered, this value will never change.

I believe we should use the current logic (my second option) instead of adding a new file. @alisonrag what do you think?

will this function be safe? what about assassin test? in this test a lot of same monster have different names for every monster in the screen openkore will re-write the name in monsters.txt

to me the file is better, just like the ragexe

alisonrag avatar Jan 12 '21 14:01 alisonrag

in this test a lot of same monster have different names for every monster in the screen openkore will re-write the name in monsters.txt

Now the ml command reads the original names of the monsters without overwriting the monsters.txt file. After my second patch we will rewrite monster names if the current name does not match monsters.txt

After the thief quest, most likely monsters.txt will contain incorrect monster names, but this will be corrected when the bot meets a real monster. Or we can add a dirty hack for this location

ya4ept avatar Jan 12 '21 16:01 ya4ept

If attack logic use name given from server to me is ok update monsters.txt

alisonrag avatar Jan 12 '21 18:01 alisonrag

long long time ago, me :

  • made default monsters.txt from rathena
  • made option inside config to turn on/off force actor name Given from server to handle this assasin quest

c4c1n6kr3m1 avatar Jan 12 '21 19:01 c4c1n6kr3m1

do not merge this request yet

ya4ept avatar Feb 26 '21 13:02 ya4ept