Скрипт пишет в UO-шную книгу из указанного файла, переводя русские буквы в транслит. Перед запуском необходимо открыть книгу и ткнуть по ней, чтобы курсор стоял в поле, где набирается текст. Кроме того, нужно указать, из какого файла читать текст, во второй строчке кода.
Не тестил особо, но, вроде, работает
Код:
sub write_book()
var f=file('d:\kort.txt')
var s
var i, a, buf
var buf_len=80
f.Open()
buf=''
While not f.Eof()
s=safe call f.readln()
if s<>'File read error' then
For i=0 to Len(s)-1
a=s[i]
buf=buf+translit(a)
Next
UO.SayU(buf)
buf=''
end if
WEnd
f.Close()
end sub
Sub translit(a)
var b
b=a
if a=='?' then
b='7'
end if
if a=='а' then
b='a'
end if
if a=='б' then
b='b'
end if
if a=='в' then
b='v'
end if
if a=='г' then
b='g'
end if
if a=='д' then
b='d'
end if
if a=='е' then
b='e'
end if
if a=='ё' then
b='yo'
end if
if a=='ж' then
b='zh'
end if
if a=='з' then
b='z'
end if
if a=='и' then
b='i'
end if
if a=='й' then
b='j'
end if
if a=='к' then
b='k'
end if
if a=='л' then
b='l'
end if
if a=='м' then
b='m'
end if
if a=='н' then
b='n'
end if
if a=='о' then
b='o'
end if
if a=='п' then
b='p'
end if
if a=='р' then
b='r'
end if
if a=='с' then
b='s'
end if
if a=='т' then
b='t'
end if
if a=='у' then
b='u'
end if
if a=='ф' then
b='f'
end if
if a=='х' then
b='h'
end if
if a=='ц' then
b='ts'
end if
if a=='ч' then
b='ch'
end if
if a=='ш' then
b='sh'
end if
if a=='щ' then
b='sch'
end if
if a=='ъ' then
b="'"
end if
if a=='ы' then
b='y'
end if
if a=='ь' then
b="'"
end if
if a=='э' then
b='e'
end if
if a=='ю' then
b='yu'
end if
if a=='я' then
b='ya'
end if
if a=='А' then
b='A'
end if
if a=='Б' then
b='B'
end if
if a=='В' then
b='V'
end if
if a=='Г' then
b='G'
end if
if a=='Д' then
b='D'
end if
if a=='Е' then
b='E'
end if
if a=='Ё' then
b='YO'
end if
if a=='Ж' then
b='ZH'
end if
if a=='З' then
b='Z'
end if
if a=='И' then
b='I'
end if
if a=='Й' then
b='J'
end if
if a=='К' then
b='K'
end if
if a=='Л' then
b='L'
end if
if a=='М' then
b='M'
end if
if a=='Н' then
b='N'
end if
if a=='О' then
b='O'
end if
if a=='П' then
b='P'
end if
if a=='Р' then
b='R'
end if
if a=='С' then
b='S'
end if
if a=='Т' then
b='T'
end if
if a=='У' then
b='U'
end if
if a=='Ф' then
b='F'
end if
if a=='Х' then
b='H'
end if
if a=='Ц' then
b='TS'
end if
if a=='Ч' then
b='CH'
end if
if a=='Ш' then
b='SH'
end if
if a=='Щ' then
b='SCH'
end if
if a=='Ъ' then
b="'"
end if
if a=='Ы' then
b='Y'
end if
if a=='Ь' then
b="'"
end if
if a=='Э' then
b='E'
end if
if a=='Ю' then
b='YU'
end if
if a=='Я' then
b='YA'
end if
return b
end sub
_________________ "Весь мир в предвкушении очередного апокалипсиса, у нас в стране он судя по всему уже прошёл..." Askaneli.
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете голосовать в опросах