SVN 337: support for russian client / cast prior cooldown

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

SVN 337: support for russian client / cast prior cooldown

#1 Post by d003232 » Thu Oct 08, 2009 5:21 pm

With SVN 337 there are two major changes:
  • full UTF8 -> ASCII conversion so we should now support russian RoM client
  • we now cast 500 ms prior the end of the skill cooldowns.
I tested the prior skill use with mage and priest. I hope there are no problems with melee characters. We now cast much faster ... and need perhaps some more mana potions. :-) If you have problems, you can change the prior casting value with the profile option:

Code: Select all

<option name="SKILL_USE_PRIOR"	value="500" />
.

Russion client support should work for the UTF8 conversation of mobnames and player names. I suppose there are wrong values in the 'utf8_ascii.xml' for the dos replacement characters.

Let me explain the dos replacement:
RoM bot works with lua. And lua don't support umlauts or some other special characters. But RoM bot tries to look for a profile name that is eaqual with your characters name. If you use special characters in your characters name, we will try to translate them ( e.g. ü => ue, û => u, ...) and search for a profile with that replaced characters. I can't read that dos replacement characters in the 'utf8_ascii.xml' file for the russion version. But I doubt that lua can work with that ASCII codes from 128 - 229 as a replacement. If not, then they should be replaced with some characters from 'a-z'.
The RoM Bot Online Wiki needs your help!

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: SVN 337: support for russian client / cast prior cooldown

#2 Post by x_art » Fri Oct 09, 2009 2:46 am

The player name should be converted from UTF8 to ASCII before reading the profile. but all other string resources should be converted from UTF8 to OEM (DOS) charset, because these strings will be outputted on the screen. There isn't a problem with the player name, because the russian client doesn't allow to use russian characters in the player name (I didn't see russian characters yet), so we may use UTF8-to-OEM for the player name too.

I've slightly changed your function:

Code: Select all

	local function convert_utf8_ascii_character( _str, _v )
		local found;
--		local tmp = database.utf8_ascii[_ascii];
		local _tmp2 = tonumber(_v.dos_replace);
		if(_tmp2 == nil)then
			_tmp2 = _v.dos_replace
		else
			_tmp2 = string.char(_tmp2)
		end
		_str, found = string.gsub(_str, string.char(_v.utf8_1, _v.utf8_2), _tmp2);
		return _str, found;
	end
Of course. It should be adapted and tested for other languages.

P.S. utf8_ascii.xml should be updated too. It is necessary to remove "\" from dos_replace attributes.
P.P.S I would suggest to use the following function instead of decoding whole table, that works much faster.

Code: Select all

function utf82oem(txt)
  txt = string.gsub(txt, string.char(0xD0, 0x81), "Ё");
  txt = string.gsub(txt, string.char(0xD1, 0x91), "Ñ‘");
  -- lower case
  local patt = string.char(0xD1) .. "([" .. string.char(0x80, 0x2D, 0x8F) .. "])";
  txt = string.gsub(txt, patt, function (s)
            return string.char(string.byte(s,1,1)+0x60);
          end
  );
  -- upper case
  patt = string.char(0xD0) .. "([" .. string.char(0x90, 0x2D, 0xBF) .. "])";
  txt = string.gsub(txt, patt, function (s)
            return string.char(string.byte(s,1,1)-0x10);
          end
  );
  return txt;
end

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 337: support for russian client / cast prior cooldown

#3 Post by d003232 » Fri Oct 09, 2009 3:13 am

x_art wrote:The player name should be converted from UTF8 to ASCII before reading the profile. but all other string resources should be converted from UTF8 to OEM (DOS) charset, because these strings will be outputted on the screen. There isn't a problem with the player name, because the russian client doesn't allow to use russian characters in the player name (I didn't see russian characters yet), so we may use UTF8-to-OEM for the player name too.
I'm not sure, if I understand everything. The field 'ascii' is what we use to print in the MM window. Because that also contains umlauts and we so can see the umlauts in the mm window protocol. The field 'dos_replace' is used to convert player names to profile names. Because lua don't accept umlauts and special characters in profile names.

ATM the field 'ascii' contains the character according to the extended ASCII table:

Or if we used your second funtion, we don't need the whole table? Or it is only for the OEM (DOS) part, without umlauts? Perhaps you want to do that conversation coding?
The RoM Bot Online Wiki needs your help!

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: SVN 337: support for russian client / cast prior cooldown

#4 Post by x_art » Fri Oct 09, 2009 7:39 am

d003232 wrote:I'm not sure, if I understand everything. The field 'ascii' is what we use to print in the MM window. Because that also contains umlauts and we so can see the umlauts in the mm window protocol. The field 'dos_replace' is used to convert player names to profile names. Because lua don't accept umlauts and special characters in profile names.


ATM the field 'ascii' contains the character according to the extended ASCII table:
Russian Windows uses ASCII charset for filenames and OEM (DOS) russian charset for the console window. This is different charsets. Therefore if I want to output readable data on the screen I should use dos_replace.
d003232 wrote:Or if we used your second funtion, we don't need the whole table? Or it is only for the OEM (DOS) part, without umlauts? Perhaps you want to do that conversation coding?
This function only for russain language. If you'll use this function then we don't need the table.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 337: support for russian client / cast prior cooldown

#5 Post by d003232 » Fri Oct 09, 2009 7:44 am

x_art wrote:Russian Windows uses ASCII charset for filenames and OEM (DOS) russian charset for the console window. This is different charsets. Therefore if I want to output readable data on the screen I should use dos_replace.
d003232 wrote:Or if we used your second funtion, we don't need the whole table? Or it is only for the OEM (DOS) part, without umlauts? Perhaps you want to do that conversation coding?
This function only for russain language. If you'll use this function then we don't need the table.
Ok, I will put that function to SVN and use it for the conversion of player names and mob names (only for the russian client). And use the table conversation for the player names -> profile name conversion. Then we will see, how it works.
The RoM Bot Online Wiki needs your help!

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 337: support for russian client / cast prior cooldown

#6 Post by d003232 » Fri Oct 09, 2009 8:15 am

x_art wrote:

Code: Select all

function utf82oem(txt)
  txt = string.gsub(txt, string.char(0xD0, 0x81), "Ё");
  txt = string.gsub(txt, string.char(0xD1, 0x91), "Ñ‘");
What are the string.char() values for the Ё and ё ? 211 and 137 ?
The RoM Bot Online Wiki needs your help!

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: SVN 337: support for russian client / cast prior cooldown

#7 Post by x_art » Fri Oct 09, 2009 8:38 am

d003232 wrote:
x_art wrote:

Code: Select all

function utf82oem(txt)
  txt = string.gsub(txt, string.char(0xD0, 0x81), "Ё");
  txt = string.gsub(txt, string.char(0xD1, 0x91), "Ñ‘");
What are the string.char() values for the Ё and ё ? 211 and 137 ?
txt = string.gsub(txt, string.char(0xD0, 0x81), string.char(0xA8));
txt = string.gsub(txt, string.char(0xD1, 0x91), string.char(0xB8));

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 337: support for russian client / cast prior cooldown

#8 Post by d003232 » Fri Oct 09, 2009 8:54 am

x_art wrote:
d003232 wrote:
x_art wrote:

Code: Select all

function utf82oem(txt)
  txt = string.gsub(txt, string.char(0xD0, 0x81), "Ё");
  txt = string.gsub(txt, string.char(0xD1, 0x91), "Ñ‘");
What are the string.char() values for the Ё and ё ? 211 and 137 ?
txt = string.gsub(txt, string.char(0xD0, 0x81), string.char(0xA8));
txt = string.gsub(txt, string.char(0xD1, 0x91), string.char(0xB8));
It's in SVN 342. Do you have a link to a OEM (DOS) russian charset table?
The RoM Bot Online Wiki needs your help!

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: SVN 337: support for russian client / cast prior cooldown

#9 Post by x_art » Fri Oct 09, 2009 2:04 pm

Russian OEM code page (866).
http://en.wikipedia.org/wiki/Code_page_866

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: SVN 337: support for russian client / cast prior cooldown

#10 Post by x_art » Sat Oct 10, 2009 4:42 am

I've tested the latest build. The bot works perfectly with the russian client. Thank you for your work :)!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests