Yoko

All sides of Injection
It is currently 2026-01-16 23:15:13

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2004-08-19 15:27:37 
Offline

Joined: 2004-08-18 21:51:28
Posts: 3
в ниже приведённом скрипте немогу найти строку, где выставляетсязадержка на то как долго чар будет стоять у дерева.Подскажите эту строчку
###############################################################
### Скрипт на ламбер ###
###############################################################
### (c) Elthar aka Duo. Adopted by ruff
### Требуется YokoInjection со скрипт парсером версии 0.3
### http://yoko.netroof.net
###############################################################
### Инструкции по применению ###
###############################################################
### Во время работы скрипта (анализ територии) рекомендуется не говорить,
### это будет тормозить его выполнение, хотя и не смертельно.
### Вердату желательно иметь нормальную, не с пеньками вместо
### деревьев.
###
### 1. До запуска скрипта необходимо прописать типы объектов
### axe - собсно топор, pila - карпентер тул (пила, рубанок,етц)
### brevna - тип логов, doski - тип досок (добавить на вкладке
### Object Types)
### Скрипт расчитан на то, что есть дом, в доме есть два ящика
### в один (woodbox) складываем доски, со второго (invbox) берем
### инструменты (топор и пилу) (добавить на вкладке Objects)
### Можно накидать топоров и пил в бакпак, тогда он не будет
### ходить за инструментами домой.
### Предполагается три координаты, Home - тайл перед входом в дом
### wbox - координаты ящика с досками, и ibox - координаты ящика
### с инструментами. Эти координаты необходимо тоже прописать перед
### запуском.
### 4. Если переменная GetFromFile=1, то скрипт считает из файла
### координаты деревьев и сразу побежит к первому дереву. Если
### GetFromFile=0, то начнется анализ территории. ВО ВРЕМЯ АНАЛИЗА
### ОКНО КЛИЕНТА ДОЛЖНО БЫТЬ АКТИВНО, И КУРСОР ДОЛЖЕН НАХОДИТЬСЯ
### НА ИГРОВОМ ПОЛЕ!!! Можно менять переменную Area от 1 до 4,
### чтобы увеличивать/уменьшать размер территории для анализа.
### Сколько выбирать, зависит от густоты леса и скилла Ламбера,
### пробуй сам.
### 5. Когда база загрузится, появится соответствующая мессага,
### и начнется бесконечный цикл на обход деревьев. Он происходит
### так: идем к дереву; если переменная TryHiding=1 то пытаемся
### уйти в хайд; начинаем рубить логи, пока все не вырубим, или
### пока не кончится таймер (30 ударов); если переменные HomeX и
### HomeY = 0, то уходим в хайд и закрываем клиент когда
### вес досок достиг грузоподьемности. Иначе идем домой согласно
### сценария.
###
### Вот собственно и все! Enjoy it!
###############################################################

sub main()
dim Home[2],wbox[2],ibox[2]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
var Area=4 ## Размер обрабатываемой территории, можно менять от 1 до 4.
var TryHiding=1 ## 1 - перед тем как рубить дерево, будет пытаться уйти в хайд, 0 - не будет
## после рубки будет пытатся застелиться
var ChkStealthStep=18 ## сколько шагов ходим в стелсе, если больше - стелсимся опять. 0 - не проверяем
var GetFromFile=1 ## 1 - координаты деревьев будут считыватся из файла, 0 - собиратся из клиента
Home[0]=3024
Home[1]=553
wbox[0]=3025
wbox[1]=549
ibox[0]=3026
ibox[1]=549
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Lumber(Area,TryHiding,ChkStealthStep,GetFromFile,Home,wbox,ibox);
end sub

sub HomeWork(ibox)
uo.print("Delaem uroki");
uo.print("Doski nafik");
uo.findtype('doski');
uo.moveitem('finditem',0,'woodbox');
wait(200)
uo.print("Sho tam u nas");
if CheckInventory() == 0 then
uo.print("Cheta nehvatat");
gotoxy(ibox[0],ibox[1],0);
wait(900)
if HaveItem('pila') == 0 then
uo.findtype('pila',-1,'invbox');
uo.grab(1,'finditem');
wait(500);
else
uo.ignore('finditem');
end if
wait(3000);
if HaveAxe() == 0 then
uo.findtype('axe',-1,'invbox');
uo.grab(1,'finditem');
wait(900)
end if
uo.ignorereset();
uo.equipt('Lhand','axe');
end if
uo.print("Vse v norme, gulyaem dalshe");
end sub

sub CheckInventory()
var oh
if HaveItem('pila')==1 and HaveAxe()==1 then
return 1
end if
return 0
end sub
sub HaveItem(iname)
uo.print("Ishem "+iname);
uo.findtype(iname,-1,"backpack");
if uo.FindCount() > 0 then
return 1
end if
return 0
end sub
sub HaveAxe()
uo.findtype('axe',-1,"my");
if uo.FindCount() > 0 then
wait(500);
return 1
end if
return 0
end sub

sub Lumber(Area,TryHiding,ChkStealtStep,GetFromFile,home,wbox,ibox)
var i=0,j=0,k=0,r=0,q=0,ii,jj
var TopX=324,TopY=65
dim TreeX[100], TreeY[100],TreeT[100]
dim TreeTile[100]
var flag=0,treeCount=0,clicks=0,flag2=0
var f=file("C:\trees.dat")
var instealth=0,ws

#Графика деревьев
TreeTile[0]=3283
TreeTile[1]=3277
TreeTile[2]=3293
TreeTile[3]=3296
TreeTile[4]=3302
TreeTile[5]=3299
TreeTile[6]=3290
TreeTile[7]=3288
TreeTile[8]=3286
TreeTile[9]=3280

#Загружаем координаты из файла
if GetFromFile==1 then
uo.print('Loading trees data...')
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('Seeking trees out there nah...')
for q=1 to Area
if q==2 then
gotoxy(uo.getx()+20,uo.gety()-10,0)
end if
if q==3 then
gotoxy(uo.getx(),uo.gety()+20,0)
end if
if q==4 then
gotoxy(uo.getx()-20,uo.gety(),0)
end if
for r=0 to 3
if r==1 then
gotoxy(uo.getx()+10,uo.gety(),0)
end if
if r==2 then
gotoxy(uo.getx(),uo.gety()+10,0)
end if
if r==3 then
gotoxy(uo.getx()-10,uo.gety(),0)
end if
for j=0 to 8
for i=0 to 8
clicks=0
flag=0
uo.DeleteJournal()
#Кликаем на тайл
uo.usetype('axe')
if uo.Journal(0) == 'cliloc# 0xA307' then
uo.exec('equipt Lhand axe');
wait(900);
uo.usetype('axe')
end if
if uo.Journal(0) == 'cliloc# 0xA197' then
wait(500)
uo.usetype('axe')
end if
waitForTarget()
uo.DeleteJournal()
uo.LClick(TopX+i*21-j*21,TopY+i*21+j*21)
if WaitForTryTree()==1 then
flag=0
#Проверяем что это
for k=0 to 9
if uo.LastTile(0)==TreeTile[k]+1 then
flag=2
end if
next
if flag==0 then
for k=0 to 9
if uo.LastTile(0)==TreeTile[k] then
flag=1
end if
next
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('Found tree nah: 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('Found tree poh: x='+str(uo.lasttile(1))+' y='+str(uo.lastTile(2)))
end if
end if
end if
next
next
next
next
uo.exec("filterspeech off");
uo.print('Analiz finished, trees saved to C:\trees.dat');
SaveToFile(treeCount,TreeX,TreeY,TreeT);
GetFromFile=1;
end if
uo.print('Trees found number: '+str(treeCount))
wait(200)
#Ходим по собранным координатам
while 1==1
if treeCount>0 then
for i=1 to treeCount
uo.print('Go to tree nah '+str(i)+': x='+str(treex[i])+' y='+str(treey[i]))
if CheckInventory() == 0 then
GoHome(home,wbox);
HomeWork(ibox);
end if
if CheckWeight() == 0 then
GoHome(home,wbox);
HomeWork(ibox);
end if
flag=gotoxy(treex[i],treey[i],instealth)
if flag==1 then
if TryHiding==1 then
ToHide()
end if
GetTree(str(treeT[i]),str(treeX[i]),str(TreeY[i]),str(uo.getz()))
if TryHiding==1 then
if ToStealth() == 1 then
instealth=ChkStealtStep;
else
instealth=0;
end if
end if
CheckWeight()
end if
next
end if
wend
end sub
sub CheckWeight()
var mywcap=(((uo.STR*7)/2)+39),i;
if uo.weight >= mywcap then
uo.print("Pilim drova");
MakeLastEx();
wait(3000);
for i = 0 to 20
uo.findtype('brevna');
if uo.FindCount() == 0 then
if uo.weight >= mywcap then
return 0;
else
return 1;
end if
end if
wait(300)
next
else
return 1;
end if
return 0
end sub
sub SaveToFile(treeCount,TreeX,TreeY,TreeT)
var f=file("C:\trees.dat");
var i;
f.Create();
f.WriteLn(treeCount);
for i=1 to treeCount
f.Write(str(treeT[i])+" ");
f.Write(str(treeX[i])+" ");
f.WriteLn(str(treeY[i]));
next
f.Close();
end sub

sub GetTree(type,x,y,z)
var i
uo.print('Chop and hack nah...')
for i=0 to 15
if uo.warmode()==1 then
return 0
end if
wait(200)
uo.deletejournal()
uo.waittargettile(type,x,y,z)
uo.usetype('axe')
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub

sub GoHome(home,wbox)
var i;
ToHide();
if home[0] == 0 then
uo.closeuo();
end if
wait(10000);
ToStealth();
gotoxy(home[0],home[1],25);
gotoxy(wbox[0],wbox[1],0);
end sub

sub ToHide()
var i
uo.print('Hiding myself nah...')
if uo.Hidden() == 1 then
return 1
end if
for i=1 to 20
uo.deletejournal()
uo.useskill('Hiding')
if WaitForHide()==1 then
return 1
end if
next
return 0
end sub
sub ToStealth()
var i,rwh,hs=uo.Hidden()
uo.print('Stealthing myself nah...')
if hs == 0 then
uo.print("HS: "+str(hs));
ToHide();
wait(8000);
end if
for i=1 to 20
uo.deletejournal()
uo.useskill('Stealth')
rwh=WaitForHide();
if rwh==1 then
return 1
end if
if rwh==2 then
return 0
end if
next
return 0
end sub
sub YouSee()
var TextYouSee='cliloc# 0x05BD'
if uo.Journal(0)==TextYouSee then
uo.deletejournal();
return 1
end if
return 0
end sub

sub WaitForHide()
var Text1='cliloc# 0xA5F8'
var Text2='cliloc# 0xA5F9'
var Text3='cliloc# 0xA196'
var Text4='cliloc# 0xABCB'
var Text5='cliloc# 0xABCA'
var Text6='cliloc# 0xABC5'
for var i=0 to 200
if YouSee() == 1 then
return 0
end if
if uo.Journal(0)==Text1 then
return 1
end if
if uo.Journal(0)==Text2 then
wait(5000)
return 0
end if
if uo.Journal(0)==Text3 then
wait(1000)
return 0
end if
if uo.Journal(0)==Text4 then
return 2
end if
if uo.Journal(0)==Text6 then
ToHide();
return 0;
end if
if uo.Journal(0)==Text5 then
return 1
end if
wait(500)
next
return 0
end sub

sub WaitForChange()
var Text1='cliloc# 0xA30F'
var Text2='cliloc# 0xA30D'
var Text3='cliloc# 0xA2DE'
var Text4='cliloc# 0xA312'
var Text5='cliloc# 0xA313'
var Text6='cliloc# 0xA307'
var Text7='cliloc# 0xA197'
for var i=0 to 200
if YouSee() == 1 then
return 0
end if
if uo.Journal(0) == Text5 or uo.Journal(0) == Text6 then
wait(500);
uo.equipt('Lhand','axe');
return 0
end if
if uo.Journal(0)==Text2 OR uo.Journal(0)==Text3 then
return 1
end if
if uo.Journal(0)==Text1 OR uo.Journal(0)==Text4 OR uo.Journal(0)==Text7 then
return 0
end if
wait(50)
next
return 0
end sub

sub WaitForTryTree()
var Text1="cliloc# 0xA2DE" ## faruway
var Text2="cliloc# 0xA30D" ## not enaf
var Text3="cliloc# 0xA309" ## cant use
var Text4="cliloc# 0xA197" ## must wait
var Text5="You can't see the target"
for var i=0 to 50
if uo.Journal(0)==Text1 OR uo.Journal(0)==Text2 then
return 1
end if
# OR uo.Journal(0)==Text5
if uo.Journal(0)==Text3 then
return 0
end if
if uo.Journal(0)==Text4 then
return 2
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 abs(x)
if x>0 then
return x
else
return -x
end if
end sub

sub gotoXY(x,y,instealth)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0,steps=0
for i=1 to 60
MyX=uo.getX();
MyY=uo.getY();
if instealth > 0 and steps > instealth then
ToStealth();
steps=0;
end if
if LastX==MyX AND LastY==MyY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
uo.press(40,5)
steps=steps+5
end if
if uo.GetDir()==3 then
uo.press(37,5)
steps=steps+5
end if
if uo.GetDir()==5 then
uo.press(38,5)
steps=steps+5
end if
if uo.GetDir()==7 then
uo.press(39,5)
steps=steps+5
end if
halt=15
end if
if abs(x-myX)<=1 AND abs(y-myY)<=1 then
return 1
end if
if x<=MyX then
if y<=MyY then
uo.press(38,3)
steps=steps+3
else
uo.press(37,3)
steps=steps+3
end if
else
if y<=MyY then
uo.press(39,3)
steps=steps+3
else
uo.press(40,3)
steps=steps+3
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub

sub MakeLastEx()
var i
uo.deletejournal()
uo.usetype('pila')
wait(500)
WaitMenuEx("special",7)
wait(500)
while not uo.injournal("of type 0xC79351A0 choiced") and not uo.injournal("you have worn out")
wait(100)
wend
uo.deletejournal()
for i=0 to 50
if uo.injournal("of type 0xC79351A0") then
wait(100);
uo.rclick(47,46);
return
end if
wait(200);
next
end sub
sub WaitMenuEx(category,number)
while not uo.injournal("of type 0xC79351A0")
wait(100)
wend
if category == "categories" and number > -1 and number < 11 then
uo.lclick(70,110+18*number)
endif
if category == "selections" and number > -1 then
while number > 9
number = number - 9
uo.lclick(423,311)
wait(300)
wend
uo.lclick(275,110 + 18*number)
endif
if category == "special" and number < 8 and number > -1 then
if IsOdd(number) then
uo.lclick(70,395+18*number/2)
else
uo.lclick(325,395+18*(number-1)/2)
endif
endif
end sub

sub IsOdd(num)
var i = num
i = int(i/2)
i = i*2
if i == num then
return 1
endif
return 0
end sub


Top
   
 Post subject:
PostPosted: 2004-08-19 15:37:43 
Offline
Expert!
User avatar

Joined: 2004-05-31 09:31:51
Posts: 838
В скрипте вместо задержки стоит проверка на Месагу в журнале.

_________________
Все просто.
BETEPAH ™


Top
   
 Post subject:
PostPosted: 2004-08-19 16:59:01 
Offline

Joined: 2004-08-18 21:51:28
Posts: 3
как весело однако
а где мне надо исправить месагу, можеш место показать???
и писать там надо просто словами или какнить символами??


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited