Grin wrote:
learning russian?:))
your infogump is corupted, do u see russian letters?
Это шард Оском, там шлется 2 гампа подряд , последний закрывается сразу и на экране мы видим 1-ый.
Ого пока дочитал до конца понял
СПасиба Грину )
Исправление скорей всего в том что ласт гамп считать последний открытый ( вернее открытый на экране ) гамп
А вот мой вариант
Работал на ура до тех времен пока Самуил не сделал 2 гампа подряд.
Запуск
exec an
ща проверил вроде все пашет
Code:
sub an()
var text
while 1
if uo.LastGump('text',11) == 'Ответ' and uo.LastGump('replyed') == 0 and (not uo.getglobal("code_text") == uo.LastGump('text',9)) then
#if uo.LastGump('text',11) == 'Ответ' and uo.LastGump('replyed') == 0 then
#if not uo.LastGump('text',9) == '0' then
uo.print(uo.LastGump('text',9))
#uo.print(uo.LastGump('text',1))
#uo.print(text)
antimacros(uo.LastGump('text',9))
wait(1000)
end if
wait(1)
wend
end sub
sub antimacros(text)
#Adм1R 2008 ForeVeR
var st,i=1,n,slovo
var slog_12=1
var summa
var slog1 = 0
var slog2 = 0
var mnogitel
var znak_num=2
Dim znak[3]
znak[0]="Умножить"
znak[1]="Сложить"
znak[2]="Отнять"
var chis_num=90
dim chis[91]
chis[0]="Ноль"
chis[1]="Один"
chis[2]="Два"
chis[3]="Три"
chis[4]="Четыре"
chis[5]="Пять"
chis[6]="Шесть"
chis[7]="Семь"
chis[8]="Восемь"
chis[9]="Девять"
chis[10]="Десять"
chis[11]="Одиннадцать"
chis[12]="Двенадцать"
chis[13]="Тринадцать"
chis[14]="Четырнадцать"
chis[15]="Пятнадцать"
chis[16]="Шестнадцать"
chis[17]="Семнадцать"
chis[18]="Восемнадцать"
chis[19]="Девятнадцать"
chis[20]="Двадцать"
chis[30]="Тридцать"
chis[40]="Сорок"
chis[50]="Пятьдесят"
chis[60]="Шестьдесят"
chis[70]="Семьдесят"
chis[80]="Восемьдесят"
chis[90]="Девяносто"
uo.print(text)
uo.print(uo.lastgump('text',9))
##st=uo.lastgump('text',9)
st=text
#if uo.LastGump('text',11) == 'Ответ' and uo.LastGump('replyed') == 0 and (not uo.getglobal("code_text") == st) then
uo.setglobal("code_text",st)
st=mid( st, 0,len(st)-2)
slovo = getword(st,i)
while (not slovo == "")
for n=0 to chis_num
if slovo == chis[n] then
if slog_12 == 1 then
slog1=slog1+n
else
slog2=slog2+n
end if
end if
next
for n=0 to znak_num
if slovo == znak[n] then
slog_12=2
mnogitel=znak[n]
end if
next
i=i+1
slovo = getword(st,i)
wait(10)
wend
If mnogitel == znak[0] then
summa = slog1 * slog2
end if
If mnogitel == znak[1] then
summa = slog1 + slog2
end if
If mnogitel == znak[2] then
summa = slog1 - slog2
end if
uo.print(str(slog1)+" "+mnogitel+" "+str(slog2)+" = "+str(summa))
uo.lclick(128,108)
wait(100)
uo.Say( Chr( 8 ) )
wait(300)
uo.lclick(128,108)
wait(300)
uo.sayu(summa)
wait(100)
uo.lclick(107,162)
#end if
end sub
Sub GetWord( st, nom )
; (c) Edred
; Возвращает слово из строки str за номером num
; если такого слова нет - возвращаем ''
;
; Разделителем слов считаем пробел. Несколько пробелов подряд считаются за один.
; Функция сделана без рекурсии специально для считывания слов из сверхдлинных строк!
;
VAR tmpst, i, dlin, kol = 0, start = 0
dlin = len( st )
For i=0 To dlin - 1
If mid( st, i, 1 ) == ' ' OR i == dlin - 1 Then
kol = kol + 1
If kol == nom Then
; это первый пробел после нужного нам слова
tmpst = mid( st, start, i - start )
return tmpst
Else
While mid( st, i, 1 ) == ' '
i = i + 1
Wend
If kol == nom - 1 Then
start = i
Endif
Endif
Endif
Next
tmpst = ''
return tmpst
endsub