openkore icon indicating copy to clipboard operation
openkore copied to clipboard

equipAuto block does not work with Russian target names

Open ya4ept opened this issue 5 years ago • 0 comments

  • Openkore version git: last
  • Server: rRO
  • Bug Report / Feature Request: config.txt:
equipAuto {
	disabled 0
	rightHand [NONE]
	armor Доспехи новичка
	target Поринг
}

i attack a Порин (Poring):

You are now attacking Monster Поринг  (1)
[AutoEquip] 1 monster=Поринг 
[AutoEquip][0] 1.1 monster is defined, targetList:ПорингПоринг
[ 32/100] You attack Monster Поринг  (1) (Dmg: 99) (Delay: 560ms)
You have gained 39/30 (0.52%/0.00%) Exp
Target died

debugging Utils::DataStructures::existsInList

sub existsInList {
	my ($list, $val, $test) = @_;
	if ($test) {
	print "[existsInList]1 list=$list\n";
	print "[existsInList]2 val=$val\n";
	}
	return 0 if ($val eq "");
	my @array = split / *, */, $list;
	$val = lc($val);
	foreach (@array) {
		s/^\s+//;
		s/\s+$//;
		s/\s+/ /g;
		next if ($_ eq "");
		print "[existsInList]3 _=$_, val=$val, lc_=".lc($_)."\n" if ($test);
		print "[existsInList]4 RETURN=1\n" if ($test and lc($_) eq $val);
		return 1 if (lc($_) eq $val);
	}
	return 0;
}
[existsInList]1 list=╨Я╨╛╤А╨╕╨╜╨│,Poring
[existsInList]2 val=╨Я╨╛╤А╨╕╨╜╨│
[existsInList]3 _=╨Я╨╛╤А╨╕╨╜╨│, val=╨┐╨╛╤А╨╕╨╜╨│ , lc_=╨┐╨╛╤А╨╕╨╜╨│
[existsInList]3 _=Poring, val=╨┐╨╛╤А╨╕╨╜╨│ , lc_=poring

why doesn't it return 1?

manual function call: eval existsInList("Поринг, Poring", "Поринг", 1)

[existsInList]1 list=╨Я╨╛╤А╨╕╨╜╨│, Poring
[existsInList]2 val=╨Я╨╛╤А╨╕╨╜╨│
[existsInList]3 _=╨Я╨╛╤А╨╕╨╜╨│, val=╨┐╨╛╤А╨╕╨╜╨│, lc_=╨┐╨╛╤А╨╕╨╜╨│
[existsInList]4 RETURN=1

ya4ept avatar Oct 30 '20 21:10 ya4ept