Ищу чек

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Ищу чек

Post by kuviCk »

Собственно ищу грамотный чек на рубку определенного типа логов.
Чек по журналу: если выпал лог который в игноре, то переходим к следующему дереву, если нет то рубим дальше.
Если есть у кого-нить похожий положите. Заранее спасибо!
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Ищу чек

Post by Mirage »

Code: Select all

sub checklog()
   var i
   VAR log = '0x1BDD'
   DIM collog[3]
   collog[0]='0x19B7' ; цвет лога 1
   collog[1]='0x19BA' ; цвет лога 2
   collog[2]='0x19B8' ; цвет лога 3
   
   For i=0 to 2
      UO.FindType(log, collog[i], 'backpack')
      if UO.FindCount() > 0 Then
         UO.MoveItem('finditem',0,'ground')
         wait(500)
         return 0
      endif
   Next
   return 1
end sub

в основном скрипте делаешь проверку на

Code: Select all

if checklog()=0 then 
переходим
elsу
рубим дальше пока не кончится дерево
endif
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Mirage wrote:

Code: Select all

sub checklog()
   var i
   VAR log = '0x1BDD'
   DIM collog[3]
   collog[0]='0x19B7' ; цвет лога 1
   collog[1]='0x19BA' ; цвет лога 2
   collog[2]='0x19B8' ; цвет лога 3
   
   For i=0 to 2
      UO.FindType(log, collog[i], 'backpack')
      if UO.FindCount() > 0 Then
         UO.MoveItem('finditem',0,'ground')
         wait(500)
         return 0
      endif
   Next
   return 1
end sub

в основном скрипте делаешь проверку на

Code: Select all

if checklog()=0 then 
переходим
elsу
рубим дальше пока не кончится дерево
endif

Спасибо Мираж выручаешь! Будем пробовать
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Mirage wrote:

Code: Select all

sub checklog()
   var i
   VAR log = '0x1BDD'
   DIM collog[3]
   collog[0]='0x19B7' ; цвет лога 1
   collog[1]='0x19BA' ; цвет лога 2
   collog[2]='0x19B8' ; цвет лога 3
   
   For i=0 to 2
      UO.FindType(log, collog[i], 'backpack')
      if UO.FindCount() > 0 Then
         UO.MoveItem('finditem',0,'ground')
         wait(500)
         return 0
      endif
   Next
   return 1
end sub

в основном скрипте делаешь проверку на

Code: Select all

if checklog()=0 then 
переходим
elsу
рубим дальше пока не кончится дерево
endif

Распиши если не сложно как этот чек вставить вот сюда:

Code: Select all

sub GetTree(Type,X,Y,Z)
var i
uo.Print('Начинаем рубку дерева...')
for i=0 to QuantityImpact
if uo.Warmode()==1 then
return 0
end if
wait(200)
uo.DeleteJournal()
uo.WaitTargetTile(Type,X,Y,Z)
uo.UseObject('Axe')
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub

или сюда:

Code: Select all

sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4='That is too far away.'
var Text5="You can't do much in your current state."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
return 1
end if
if uo.Journal(0)==Text1 then
return 0
end if
if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
return 0
end if
wait(50)
next
return 0
end sub

Сам пробую ничего не выходит он просто начинает рубить и сразу отходит к другому дереву до завершения рубки, вообщем просто носится по точкам :( буду благодарен.
Irina E
Posts: 240
Joined: 2009-06-12 20:10:00
Location: Vasa Smerti(RASToMAN) DRW

Re: Ищу чек

Post by Irina E »

скинь весь скрипт
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Irina E wrote:скинь весь скрипт

Code: Select all

##################
### Переменные ###
##################
##################################################################################################################
###
var FileName=('D:\trees.dat') ## - Путь к файлу в котором будут хранится координаты деревьев.
###
var TryHiding=1 ## 1 - Перед тем как рубить дерево, будет пытаться уйти в хайд, 0 - не будет .
###
var TryRecall=1 ## 1 - После того как соберет LogsQty логов, будет пытаться реколиться домой,
### складывать логи в сундук и реколиться обратно , 0 - не будет.
###
var RuneToHome=3 ## - Номер руны Домой,по счёту в рунбуке.(сейчас в 4ом слоте,можно менять от 1-9)
###
var RuneToForest=4 ## - Номер руны в Лес,по счёту в рунбуке.(сейчас в 5ом слоте,можно менять от 1-9)
###
var GetFromFile=0 ## 1 - Координаты деревьев будут считыватся из файла, 0 - собиратся из клиента
### (сначала соберите а потом считывайте из файла).
###
var LogsQty=500 ## - Количество логов, добыв которое надо реколиться домой.
###
var QuantityImpact=15 ## - Сколько раз чар будет ударять по дереву, прежде чем перейдет к другому.(стандарт - 15)
###
var ControlOfDanger=1 ## 1 - Включить рекол по руне(в паке) при атаке, 0 - отключить рекол.
###
var DisturbingSound=('D:\Музыка\inna_-_hot_radio_edit') ## - Звук которы будет пригран при атаке.(замените на свой)
###
var DangerousTime=50000 ## - Время которое чар будет ждать(после рекола) пока уйдет ПК или Ент.(сейчас 50 секунд)
###
var CycleScript=1 ## 1 - Скрипт не отключается после рекола от атакующего, 0 - отключаетсяи закрывает UO.
###
var Reconnect=1 ## 1 - Включить реконнект на сервер если выкинет, 0 - отключить реконнект.
###
##################################################################################################################
###
### После настройки:
### Идите в лес в котором вы хотите рубить.
### Запустите cкрипт GoLumberjacking(), Инжект попросит вас указать Топор
### (появится прицел, прицелом на топор который вы с собой взяли),
### затем инжект попросит вас указать Рунбук(появится прицел, прицелом на него) ,Руну(прицелом на неё) и Сундук для логов.
### После этого чар пойдет по координатам и будет вырубать деревья.
###########
### Код ###
###########
sub GoLumberjacking()
uo.Print('Выбери Топор: ')
uo.Exec('addobject Axe')
while uo.Targeting()
wait(100)
wend

if TryRecall==1 then
uo.Print('Выбери PунБук: ')
uo.Exec('addobject Runebook')
while uo.Targeting()
wait(100)
wend
end if

if ControlOfDanger==1 then
uo.Print('Выбери Руну: ')
uo.Exec('addobject Rune')
while uo.Targeting()
wait(100)
wend
end if

uo.Print('Выбери Сундук: ')
uo.Exec('addobject Chest')
while uo.Targeting()
wait(100)
wend

if ControlOfDanger==1 then
uo.Exec('exec ControlOfDanger')
end if

if Reconnect==1 then
uo.Exec('exec Reconnect')
end if

RecallToLumber()

uo.Exec('exec Lumberjacking')
end sub

sub Lumberjacking()
var i=0,j=0,k=0,r=0,q=0,ii,jj,f
var TopX=324,TopY=65
dim TreeX[5000],TreeY[5000],TreeT[5000]
dim TreeTile[29]
var flag=0,TreeCount=0,clicks=0,flag2=0
########################
### Графика деревьев ###
########################
TreeTile[0]=3277
TreeTile[1]=3280
TreeTile[2]=3283
TreeTile[3]=3286
TreeTile[4]=3289
TreeTile[5]=3291
TreeTile[6]=3294
TreeTile[7]=3296
TreeTile[8]=3299
TreeTile[9]=3302
TreeTile[10]=3393
TreeTile[11]=3394
TreeTile[12]=3395
TreeTile[13]=3396
TreeTile[14]=3415
TreeTile[15]=3416
TreeTile[16]=3417
TreeTile[17]=3418
TreeTile[18]=3419
TreeTile[19]=3438
TreeTile[20]=3439
TreeTile[21]=3440
TreeTile[22]=3441
TreeTile[23]=3442
TreeTile[24]=3460
TreeTile[25]=3461
TreeTile[26]=3462
TreeTile[27]=3290
TreeTile[28]=3288

uo.FilterSpeech('on')
uo.FilterSpeech('add', 'Where do you want to use the pickaxe?')

#####################################
### Загружаем координаты из файла ###
#####################################
if GetFromFile==1 then
uo.Print('Загружаем координаты из файла...')
f=file(FileName)
f.Open()
TreeCount=safe call f.ReadNumber()
for i=1 to TreeCount
TreeT[i]=safe call f.ReadNumber()
TreeX[i]=safe call f.ReadNumber()
TreeY[i]=safe call f.ReadNumber()
next
f.Close()
else
######################################
### Собираем координаты из клиента ###
######################################
uo.Print('Выбери Кирку: ')
uo.Exec('addobject Pickaxe')
while uo.Targeting()
wait(100)
wend
uo.Print('Собираем координаты деревьев в округе...')
repeat
clicks=0
flag=0
uo.DeleteJournal()
#######################
### Кликаем на тайл ###
#######################
uo.UseObject('Pickaxe')
waitForTarget()
uo.DeleteJournal()
WaitForTryRock()
###############################
### Проверяем дерево ли это ###
###############################
flag=0
for k=0 to 28
if uo.LastTile(0)==TreeTile[k]+1 then
flag=2
end if
next
if flag==0 then
for k=0 to 28
if uo.LastTile(0)==TreeTile[k] then
flag=1
end if
next
end if
if uo.Lasttile(1)==uo.GetX() and uo.Lasttile(2)==uo.GetY() then
flag=3
end if
#########################
### Кликнули на ствол ###
#########################
if flag==1 then
flag2=0
if TreeCount>0 then
for ii=1 to TreeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
TreeCount=TreeCount+1
TreeX[TreeCount]=uo.LastTile(1)
TreeY[TreeCount]=uo.LastTile(2)
TreeT[TreeCount]=uo.LastTile(0)
uo.Print('Найдено дерево номер '+str(TreeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
##########################
### Кликнули по листве ###
##########################
if flag==2 then
flag2=0
if TreeCount>0 then
for ii=1 to TreeCount
if TreeX[ii]==uo.LastTile(1) and TreeY[ii]==uo.LastTile(2) then
flag2=1
end if
next
end if
if flag2==0 then
TreeCount=TreeCount+1
TreeX[TreeCount]=uo.LastTile(1)
TreeY[TreeCount]=uo.LastTile(2)
TreeT[TreeCount]=uo.LastTile(0)-1
uo.Print('Найдено дерево номер '+str(TreeCount)+' : x='+str(uo.Lasttile(1))+' y='+str(uo.LastTile(2)))
end if
end if
until (flag==3) or (TreeCount==5000)
uo.FilterSpeech('off')
uo.Print('Анализ закончен, координаты деревьев записаны в файл ' + FileName)
SaveToFile(TreeCount,TreeX,TreeY,TreeT)
end if
uo.Print('Деревьев найдено: '+str(TreeCount))
wait(2000)
######################################
### Ходим по собранным координатам ###
######################################
while 1==1
if TreeCount>0 then
for i=1 to TreeCount
if TryRecall==1 and uo.Count('ZLK')>=LogsQty or uo.Weight>=uo.STR*4+20 then
ToRecall()
end if
uo.Print('Идем к дереву номер '+str(i)+': x='+str(TreeX[i])+' y='+str(TreeY[i]))
InfoLogs()
flag=GotoXY(TreeX[i],TreeY[i])
if flag==1 then
if TryHiding==1 then
ToHide()
end if
GetTree(str(TreeT[i]),str(TreeX[i]),str(TreeY[i]),str(uo.GetZ()))
end if
next
end if
wend
end sub

sub SaveToFile(TreeCount,TreeX,TreeY,TreeT)
var s=0,i=0,f
f=file(FileName)
f.Open()
f.Create()
s=safe call f.Writeln(TreeCount)
for i=1 to TreeCount
s=safe call f.Writeln(str(TreeT[i])+' '+str(TreeX[i])+' '+str(TreeY[i]))
next
f.Close()
end sub

sub GetTree(Type,X,Y,Z)
var i
uo.Print('Начинаем рубку дерева...')
for i=0 to QuantityImpact
if uo.Warmode()==1 then
return 0
end if
wait(200)
uo.DeleteJournal()
uo.WaitTargetTile(Type,X,Y,Z)
uo.UseObject('Axe')
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub

sub WaitForRecall()
var Text1=uo.GetName()+': The spell fizzles.'
var LastX=uo.GetX()
var LastY=uo.GetY()
var mess=''
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 0
end if
if uo.GetX()<>LastX or uo.GetY()<>LastY then
return 1
end if
wait(50)
next
return 0
end sub

sub WaitForHide()
var Text1=uo.GetName()+': You have hidden yourself well'
var Text2=uo.GetName()+": You can't seem to hide here."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text1 then
return 1
end if
if uo.Journal(0)==Text2 then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForChange()
var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
var Text2='There are no logs here to chop.'
var Text3="You can't reach this."
var Text4='That is too far away.'
var Text5="You can't do much in your current state."
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
return 1
end if
if uo.Journal(0)==Text1 then
return 0
end if
if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForTryRock()
var Text1='That is too far away.'
var Text2='Try mining in rock.'
var Text3='There is no ore here to mine.'
var Text4='You have no line of sight to that location'
var Text5="You can't see the target"
for var i=0 to 50
if uo.Journal(0)==Text1 or uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 or uo.Journal(0)==Text5 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForTarget()
for var i=0 to 50
if uo.Targeting()==1 then
return 1
end if
wait(200)
next
return 0
end sub

sub WaitForChangeXY(MyX,MyY,LastX,LastY)
for var i=1 to 50
if LastX<>MyX or LastY<>MyY then
return 1
end if
wait(200)
next
return 0
end sub

sub Open(Container)
uo.DeleteJournal()
uo.UseObject(Container)
repeat
wait(500)
until uo.InJournal('Contains')
end sub

sub GotoXY(x,y)
var myX,myY,LastX=0,LastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.GetX()
myY=uo.GetY()
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
end if
if x<=myX then
if y<=myY then
for z=0 to 3
uo.Press(38)
next
else
for z=0 to 3
uo.Press(37)
next
end if
else
if y<=myY then
for z=0 to 3
uo.Press(39)
next
else
for z=0 to 3
uo.Press(40)
next
end if
end if
LastX=myX
LastY=myY
wait(200)
next
return 0
end sub

sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub

sub InfoLogs()
uo.Print('У вас всего '+str(uo.Count('0x1BDD'))+' логов в сумке')
uo.Print('Из них '+str(uo.Count('0x1BDD','0x0000'))+' простых и ' +str(uo.Count('0x1BDD')-uo.Count('0x1BDD','0x0000'))+' цветных')
end sub

sub ToHide()
while not uo.Hidden()
uo.Print('Пытаемся уйти в хайд...')
uo.DeleteJournal()
uo.Exec('warmode 0')
uo.UseSkill('Stealth')
wait(4100)
wend
wait(100)
end sub

sub ToRecall()
RecallToHome()
DropLogs()
InfoLogs()
RecallToLumber()
end sub

sub RecallToHome()
uo.Print('Прыгаем Домой.')
RuneBookRecall(RuneToHome)
end sub

sub RecallToLumber()
uo.Print('Прыгаем в Лес.')
RuneBookRecall(RuneToForest)
end sub

sub RuneBookRecall(n)
var OldX=uo.GetX()
var OldY=uo.GetY()
var Time
repeat
uo.Exec('warmode 0')
uo.UseObject('Runebook')
CheckLag()
uo.Lclick(135, n*15+55)
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs')
end sub

sub DropLogs()
ToHide()
repeat
uo.FindType('0x1BDD')
if uo.GetQuantity('finditem')>0 then
uo.MoveItem('finditem','0','Chest')
CheckLag()
wait(500)
until uo.Count('0x1BDD')<=0 or uo.Dead()
end if
end sub

sub ControlOfDanger()
var danger
var RecallEnt=1
var RecallPhysicalDanger=1
var RecallSeenDanger=1
var RecallBluePlayer=1
while 1
uo.DeleteJournal()
while not uo.InJournal(':')
wait(100)
wend
danger=uo.GetNotoriety(uo.JournalSerial(0))
if RecallEnt==1 then
if uo.InJournal('OOPS') then
uo.Exec('exec RecallRune')
end if
end if
if RecallPhysicalDanger==1 then
if uo.InJournal('attacking you') then
uo.Exec('exec RecallRune')
end if
end if
if RecallSeenDanger==1 then
if danger==6 and uo.JournalSerial(0)<>uo.GetSerial() then
uo.Exec('exec RecallRune')
end if
if danger==4 and uo.JournalSerial(0)<>uo.GetSerial() then
uo.Exec('exec RecallRune')
end if
end if
if RecallBluePlayer==1 then
if danger==1 and uo.JournalSerial(0)<>uo.GetSerial() then
uo.Exec('exec RecallRune')
end if
end if
wend
end sub

sub RecallRune()
var MX=uo.GetX('self')
var MY=uo.GetY('self')
Terminate()
uo.PlayWav(DisturbingSound)
uo.UseType('0x0F0E','0x0631')
wait(100)
Recall:
uo.DeleteJournal()
if uo.Waiting() then
uo.CancelTarget()
end if
uo.WaittargetObject('Rune')
wait(100)
uo.Cast('Recall')
wait(3000)
if not uo.GetX('self')<>MX and not uo.GetY('self')<>MY then
goto Recall
end if
repeat
uo.DeleteJournal()
uo.WaittargetObject('Rune')
uo.Cast('Mark')
if uo.InJournal('mana for this spell') then
ManaUp('Bottle')
wait(100)
end if
wait(3000)
until not uo.InJournal('spell fizzles')
if uo.Life<uo.STR then
LifeUp('Bottle')
wait(100)
end if
if CycleScript==1 then
uo.Exec('exec DangerWait')
end if
if CycleScript==0 then
uo.Exec('exec ExitUO')
end if
end sub

sub DisturbingSound(amount)
var i
for i=1 to amount
uo.PlayWav(DisturbingSound)
wait(1500)
next
end sub

sub DangerWait()
wait(DangerousTime)
ToRecall()
uo.Exec('exec Lumberjacking')
end sub

sub ExitUO()
wait(3000)
uo.CloseUO()
end sub

sub LifeUp(Mode)
if Mode=='Healing' then
while uo.Life<uo.STR
uo.Exec('bandageself')
wait(4000)
wend
end if
if Mode=='Bottle' then
if uo.Life<uo.STR then
uo.UseType('0x0F0E','0x09BB')
wait(100)
end if
end if
end sub

sub ManaUp(Mode)
if Mode=='Meditation' then
while uo.Mana<uo.INT
uo.Exec('useskill Meditation')
wait(4000)
wend
end if
if Mode=='Bottle' then
if uo.Mana<uo.INT then
uo.UseType('0x0F0E','0x09DF')
wait(100)
end if
end if
end sub

sub Reconnect()
var ReconnectTime,rflag
ReconnectTime='0'
rflag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rflag then
ReconnectTime=Time()
rflag=0
end if
wait(20000)
uo.Say('')
wait(3000)
uo.Say('')
wait(3000)
uo.Say('')
wait(3000)
uo.Ldblclick(357,164)
uo.Lclick(616,459)
wait(3000)
wend
wait(3000)
if (rflag==0) and (ReconnectTime<>'0') then
uo.TextOpen()
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
rflag=1
ReconnectTime='0'
end if
until false
end sub

sub Time()
var Date,nTime,uTime,i
uTime=str(uo.Time())
nTime=''
for i=0 to Len(uTime)
nTime=uTime[Len(uTime)-i]+nTime
if (i==2) or (i==4) then
nTime=':'+nTime
end if
next
uTime=str(uo.Date())
Date=''
for i=0 to Len(uTime)
Date=uTime[Len(uTime)-i]+Date
if (i==2) or (i==4) then
Date='.'+Date
end if
next
uTime=nTime+' @ '+Date
return uTime
end sub

sub Terminate()
uo.Exec('terminate Lumberjacking')
end sub

sub TerminateAll()
uo.Exec('terminate Lumberjacking')
uo.Exec('terminate ControlOfDanger')
uo.Exec('terminate Reconnect')
uo.Exec('terminate RecallRune')
uo.Exec('terminate DropLogs')
uo.Exec('terminate DangerWait')
uo.Exec('terminate DangerWait')
end sub

sub CheckLag()
if uo.Waiting()>0 then
uo.Exec('canceltarget')
end if
uo.DeleteJournal()
uo.Click('backpack')
repeat
wait(50)
until uo.InJournal('backpack')
end sub
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Ищу чек

Post by Mirage »

Code: Select all

sub WaitForChange()
   var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
   var Text2='There are no logs here to chop.'
   var Text3="You can't reach this."
   var Text4='That is too far away.'
   var Text5="You can't do much in your current state."
   var mess
   for var i=0 to 200
      mess=uo.Journal(0)
      if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
         return 1
      end if
      if uo.Journal(0)==Text1 then
         return 0
      end if
      if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
         return 0
      end if
      wait(50)
      if checklog()==1 then
         uo.charprint('1069','Логи скинуты, переходим к другому дереву.') ; если потребуется убрать ЭТУ строку.
         return 1
      end if
   next
   return 0
end sub

sub checklog()
   var i
   VAR log = '0x1BDD'
   DIM collog[3]
   collog[0]='0x03E9' ; цвет лога 1
   collog[1]='0x19BA' ; цвет лога 2
   collog[2]='0x19B8' ; цвет лога 3
   
   For i=0 to 2
      UO.FindType(log, collog[i], 'backpack')
      if UO.FindCount() > 0 Then
         UO.MoveItem('finditem',0,'ground')
         wait(500)
         return 1
      endif
   Next
   return 0
end sub
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Mirage wrote:

Code: Select all

sub WaitForChange()
   var Text1=uo.GetName()+': You hack at the tree for a while, but fail to produce any useable wood.'
   var Text2='There are no logs here to chop.'
   var Text3="You can't reach this."
   var Text4='That is too far away.'
   var Text5="You can't do much in your current state."
   var mess
   for var i=0 to 200
      mess=uo.Journal(0)
      if uo.Journal(0)==Text2 or uo.Journal(0)==Text3 or uo.Journal(0)==Text4 then
         return 1
      end if
      if uo.Journal(0)==Text1 then
         return 0
      end if
      if mess[0]=='Y' and mess[1]=='o' and mess[2]=='u' and mess[4]=='p' and mess[5]=='u' and mess[6]=='t' then
         return 0
      end if
      wait(50)
      if checklog()==1 then
         uo.charprint('1069','Логи скинуты, переходим к другому дереву.') ; если потребуется убрать ЭТУ строку.
         return 1
      end if
   next
   return 0
end sub

sub checklog()
   var i
   VAR log = '0x1BDD'
   DIM collog[3]
   collog[0]='0x03E9' ; цвет лога 1
   collog[1]='0x19BA' ; цвет лога 2
   collog[2]='0x19B8' ; цвет лога 3
   
   For i=0 to 2
      UO.FindType(log, collog[i], 'backpack')
      if UO.FindCount() > 0 Then
         UO.MoveItem('finditem',0,'ground')
         wait(500)
         return 1
      endif
   Next
   return 0
end sub

все бы хорошо но он не прекращает рубить когда переходит к следующему дереву ...
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

сечас еще попробую вроди бы разобрался. Спс если что еще напишу...
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

А если мне их дропать не надо... как тогда проверять логи?
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Code: Select all

sub CheckLogs()
var l1,l2,l3,l4,l5
l1="the Oak"
l2="the Gold"
l3="the Orion"
l4="the Logs"
l5="the Copper"

if UO.InJournal(l1) or UO.InJournal(l2) or UO.InJournal(l3) or UO.InJournal(l4) or UO.InJournal(l5) then
wait(500)
return 1
end if
return 0
end sub

сделал чек по журналу вроди бы норм.
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Ищу чек

Post by Mirage »

И рядом будет постоянно какоу-нибудь Вася бегать и орать
Oak!
Oak!!
Oak!!!

И твой чар будет постоянно переходить и переходить... :roll:
kuviCk
Posts: 127
Joined: 2004-09-08 13:09:13
Contact:

Re: Ищу чек

Post by kuviCk »

Mirage wrote:И рядом будет постоянно какоу-нибудь Вася бегать и орать
Oak!
Oak!!
Oak!!!

И твой чар будет постоянно переходить и переходить... :roll:

Да но можно написать так что никакой вася не узнает :)
Post Reply