Yoko

All sides of Injection
It is currently 2025-10-14 20:43:12

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Lamberjacking
PostPosted: 2011-05-29 05:27:23 
Offline

Joined: 2011-03-04 05:58:46
Posts: 15
Code:
################## 
### Переменные ###
##################
###################################################################################################
var f=file("D:\Хлам UO\Хлам к UO\trees30.dat") ## - Путь к файлу в котором будут хранится координаты деревьев.
###
var GetFromFile=1 ## 1 - Координаты деревьев будут считыватся из файла, 0 - собиратся из клиента
### (сначала соберите а потом считывайте из файла).
###
var TryHiding=1 ## 1 - Перед тем как рубить дерево, будет пытаться уйти в хайд, 0 - не будет .
###
var TryRecall=1 ## 1 - После того как соберет LogsQty логов, будет пытаться реколиться домой,
### складывать логи в сундук и реколиться обратно , 0 - не будет.
###
var RechargeBook=0 ## 1 - Включить речарж рунбуки, 0 - отключить речарж.
###
var RuneToHome=1 ## -  Номер руны Домой,по счёту в рунбуке.(сейчас в 9ом слоте,можно менять от 1-9)
###
var RuneToLumber=3 ## - Номер руны в Лес,по счёту в рунбуке.(сейчас в 1ом слоте,можно менять от 1-9)
###
var LogsQty=450 ## - Количество логов, добыв которое надо реколиться домой.
###
var AttackEnts=1 ## 1 - Включить рекол по руне(в паке) при атаке, 0 - отключить рекол.
###
var CastAtAttack=0 ## 1 - Включить каст - "Magic Arrow" на напавшего, 0 - отключить каст.
###
var EatingFood=1 ## 1 - Будем есть, 0 - нет. 
###
var TypeFood='0x097B' ## - Тип еды которую будем кушать.(сейчас фиштейки)
###
var Reconnect=1 ## 1 - Включить реконнект на сервер если выкинет, 0 - отключить реконнект.
###
var RecallDrop=1 ## 1 - Включить рекол после побега от ента домой и выложить логи, 0 -выключить.
###
var RecallLumber=0 ## 1 - Включить рекол в лес после указания обьектов, 0 - выключить.
###
var Chest='0x402C6F01' ## - ID сундука куда будут выгружаться логи, где должны лежать реколы и еда.
###
var LumberSound=('C:\WINDOWS\Media\ringin.wav') ## - Звук которы будет пригран при атаке.(замените на свой)
###
var oldX,oldY,time ## - Для рекола.
###
var i=0
var Runebook='0x403DD33A'
var TOPOR='0x0F43' ##battle axe
var logs='0x1BDD'
var Axe
################################################################################################### 
###
### После настройки (переменных выше) :
### Идите в лес в котором вы хотите рубить.
### Запустите cкрипт Lumberjacking(), Инжект попросит вас указать Топор
### (появится прицел, прицелом на топор который вы с собой взяли),
### затем инжект попросит вас указать Рунбук(появится прицел, прицелом на него).
### После этого чар пойдет по координатам и будет вырубать деревья.
###########
### Код ###
###########
 
sub Lumberjacking()
var j=0,k=0,r=0,q=0,ii,jj
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.Exec("filterspeech on")
uo.Exec("filterspeech add 'What do you want to use'")
uo.set('finddistance','10')

  uo.findtype(TOPOR, '-1', 'my')
  if uo.findcount()>0 then
    Axe=TOPOR
    uo.print('Axe='+str(Axe))
  endif
  if uo.findcount()==0 then
    uo.Print('Viberi TOPOR: ')
    uo.Exec('addobject Axe')
    while uo.Targeting()
      wait(100)
    wend
    uo.equip('Rhand', Axe)
  endif

if TryRecall==1 and Runebook=='' then
uo.Print('Viberi RuneBook: ')
uo.Exec('addobject Runebook')
while uo.Targeting()
wait(100)
wend
end if

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

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

if RecallLumber==1 then
uo.Exec('exec RecallToLumber')
wait(9000)
end if

Uo.exec("set norbcheck 1"); для рекола
uo.exec("set norbcalc 1"); тоже

#####################################
### Загружаем координаты из файла ###
#####################################
if GetFromFile==1 then
uo.Print('Загружаем координаты из файла...')
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('Viberi Kirku: ')
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))+' '+str(treeCount))
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.Exec("filterspeech off")
uo.Print('Анализ закончен, координаты деревьев записаны в файл C:\trees3.dat')
SaveToFile(treeCount,TreeX,TreeY,TreeT)
end if
uo.Print('Деревьев найдено: '+str(treeCount))
wait(2000)
######################################
### Ходим по собранным координатам ###
######################################
while not uo.dead()
if treeCount>0 then
for i=1 to treeCount
if TryRecall==1 and uo.Count(logs)>=LogsQty then
ToRecall()
end if
uo.Print('Idem k derevu '+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 GetTree(Type,X,Y,Z)
var i
uo.Print('Nachinaem rubku dereva...')
for i=0 to 15
if uo.Warmode()==1 then
return 0
end if
wait(200)
##uo.DeleteJournal()
CheckLag()
uo.WaitTargetTile(Type,X,Y,Z)
uo.Usetype(Axe)
if WaitForChange()==1 then
return 1
end if
next
return 0
end sub
######################################

sub ToRecall()
RecallToHome()
DropLogs()
InfoLogs()
if RechargeBook==1 then
RechargeBook()
wait(4000)
end if
if EatingFood==1 then
EatingFood()
end if
wait(3000)
RecallToLumber()
end sub
######################################

sub RecallToHome()
uo.Print('Prigaem domoy.')
RunebookRecall(RuneToHome)
end sub
######################################

sub RecallToLumber()
uo.Print('Prigaem v les.')
RunebookRecall(RuneToLumber)
end sub
######################################

sub ToHide()
var status
 if not uo.Hidden() then
  uo.Print('Uhodim v Hide...')
  uo.DeleteJournal()
  uo.warmode(0)
  uo.useskill('Stealth')
  while not uo.InJournal('seem') and not uo.InJournal('You have hidden')
    wait(100)
  wend
  if uo.InJournal('battle') then
    uo.Print('WAR MODE OFF...')
    uo.warmode(1)
    wait(100)
    uo.warmode(0)
  endif 
 endif 
end sub
######################################

sub WaitForRecall()
var Text1=uo.GetName()+": The spell fizzles."
var mess='',lastX=uo.getX(),lastY=uo.getY()
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 Text6="You put the Ent's body part at your feet. it is too heavy.."
var Text7="Ent"
var mess
for var i=0 to 200
mess=uo.Journal(0)
if uo.InJournal(Text6) or uo.InJournal(Text7) then
AttackEnts()
return 0
end if
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 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 flag==1 then
if TryHiding==1 then
ToHide()
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
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 SaveToFile(treeCount,TreeX,TreeY,TreeT)
var f=file("C:\trees3.dat")
var s=0,i=0
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 DropLogs()
ToHide()
if uo.Waiting() then
uo.CancelTarget()
end if
var a,Exit
dim Logs[1]
Logs[0]=0x1BDD
uo.Print('Vikladivaem logi.')
uo.useobject(Chest)
uo.SetReceivingContainer(Chest)
wait(500)
for a=0 to 0
Exit=0
repeat
uo.FindType(Logs[a])
if uo.GetQuantity('finditem')>0 then
uo.Grab('0','finditem')
wait(1500)
else
Exit=1
end if
until Exit==1
next
uo.UnSetReceivingContainer(Chest)
uo.Print('Logi vilogeni.')
end sub
######################################

sub InfoLogs()
uo.Print('Vsego '+str(uo.Count('0x1BDD'))+' logov v sumke')
uo.Print('Iz nih '+str(uo.Count('0x1BDD','0x0000'))+' prostih i ' +str(uo.Count('0x1BDD')-uo.Count('0x1BDD','0x0000'))+' cvetnih')
end sub

######################################
sub RunebookRecall(n)
oldX=uo.getX()
oldY=uo.getY()
dim rb_slots[10]
  rb_slots[0]=0
  rb_slots[1]=21
  rb_slots[2]=33
  rb_slots[3]=46
  rb_slots[4]=58
  rb_slots[5]=64
  rb_slots[6]=73
  rb_slots[7]=88
  rb_slots[8]=94
  rb_slots[9]=1025
repeat
uo.Exec('warmode 0')
;uo.UseObject(Runebook)
;wait(1000)
;uo.LClick(135, n*15+55)
;wait(500)
;uo.LClick(135, n*15+55)
uo.recall(Runebook, rb_slots[n]) ; домой ( в рунбуке слот 1 )
time=uo.Timer()
repeat
wait(500)
until oldX<>uo.getX() or oldY<>uo.getY() or uo.Life==0 or uo.InJournal('needs') or time+200<uo.Timer()
uo.DeleteJournal()
until oldX<>uo.getX() or oldY<>uo.getY()
end sub
######################################

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

sub RechargeBook()
ToRecharge()
DropScrolls()
end sub
######################################

sub ToRecharge()
uo.SetReceivingContainer('backpack')
Open(Chest)
uo.FindType('0x1F4C','-1',Chest)
uo.Grab('50','finditem')
wait(500)
Checklag()
uo.UseObject('Runebook')
wait(1000)
Checklag()
uo.Lclick(296,91)
wait(1000)
uo.UnsetReceivingContainer()
end sub
######################################

sub DropScrolls()
if uo.Waiting() then
uo.CancelTarget()
end if
var s,Exit
dim Scrolls[1]
Scrolls[0]=0x1F4C
uo.SetReceivingContainer(Chest)
wait(500)
for s=0 to 0
Exit=0
repeat
uo.FindType(Scrolls[s])
if uo.GetQuantity('finditem')>0 then
uo.Grab('0','finditem')
wait(1500)
else
Exit=1
end if
until Exit==1
next
uo.UnSetReceivingContainer(Chest)
end sub
######################################

sub EatingFood()
ToEat()
DropFood()
end sub
######################################

sub ToEat()
uo.SetReceivingContainer('backpack')
Open(Chest)
uo.FindType(TypeFood,'-1',Chest)
uo.Grab('50','finditem')
wait(500)
repeat
Checklag()
uo.UseType(TypeFood)
wait(1000)
until uo.InJournal('You are simply too full to eat any more!')
uo.UnsetReceivingContainer()
end sub
######################################

sub DropFood()
if uo.Waiting() then
uo.CancelTarget()
end if
var f,Exit
dim Food[1]
Food[0]=TypeFood
uo.SetReceivingContainer(Chest)
wait(500)
for f=0 to 0
Exit=0
repeat
uo.FindType(Food[f])
if uo.GetQuantity('finditem')>0 then
uo.Grab('0','finditem')
wait(1500)
else
Exit=1
end if
until Exit==1
next
uo.UnSetReceivingContainer(Chest)
end sub
######################################

sub AttackEnts()
##uo.DeleteJournal()
var Enemy='0x00000000'
var elem='0x002F'
var elem_ser=0

;while not uo.dead()
  if UO.InJournal('Ent') then
uo.print('Obnarugen ENT!!')
    wait(20000)
    uo.findtype(elem, '-1', 'ground')
    while uo.findcount()>0
      wait(30000)
      uo.findtype(elem, '-1', 'ground')
    wend
  endif
  wait(200)
;wend
end sub
######################################

sub RecallAtAttack()
var mX,mY
reccal:
uo.DeleteJournal()
if uo.Waiting() then
uo.CancelTarget()
end if
mX=uo.getX("self")
mY=uo.getY("self")
uo.DeleteJournal()
uo.FindType('0x1F14',-1,'mY')
uo.Cast('Recall','finditem')
uo.Print('Атака! Реколимся!')
wait(4000)
if not uo.getX("self")<>mX and not uo.getY("self")<>mY then
goto reccal
end if
if RecallDrop==1 then
RecallToHome()
DropLogs()
InfoLogs()
end if
Terminate()
end sub
######################################

sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime='0'
rFlag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rFlag then
ReconnectTime=MakeTime()
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 MakeTime()
var d,t,ret,i
ret=str(uo.Time())
t=""
for i=0 to Len(ret)
t=ret[Len(ret)-i]+t
if (i==2) or (i==4) then
t=":"+t
end if
next
ret=str(uo.Date())
d=""
for i=0 to Len(ret)
d=ret[Len(ret)-i] + d
if (i==2) or (i==4) then
d="."+d
end if
next
ret=t+" @ "+d
return ret
end sub
######################################

sub Terminate()
uo.Print('Все функции скрипта выключены!')
uo.DeleteJournal()
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
uo.Exec('terminate all')
wait(100)
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

#####################################################

sub log_transfer()
var i=0, count=20
var in_storage=0
var in_source=0
var get_count=0
var travel_bag, source_bag
var log=0x1BDD
dim log_col[21]
   log_col[0]=0x0000  ## logs
   log_col[1]=0x047C  ## oak
   log_col[2]=0x0279  ## red tree
   log_col[3]=0x096B  ## dark tree
   log_col[4]=0x0237  ## swamp
   log_col[5]=0x0482  ## silwer
   log_col[6]=0x010F  ## keranit
   log_col[7]=0x0014  ## perit
   log_col[8]=0x03C1  ## petrified
   log_col[9]=0x0085  ## dragon
   log_col[10]=0x04C2 ## vampire
   log_col[11]=0x0033 ## eridan
   log_col[12]=0x002B ## helios
   log_col[13]=0x0071 ## illusions
   log_col[14]=0x09A4 ## crystal
   log_col[15]=0x0B82 ## dead tree
   log_col[16]=0x00BE ## paradise
   log_col[17]=0x0035 ## titan
   log_col[18]=0x0BB6 ## avalon
   log_col[19]=0x0487 ## elven
   log_col[20]=0x0498 ## asterxylon

dim log_X[21]
   log_X[0]=44   ## logs
   log_X[1]=54   ## oak
   log_X[2]=64   ## red tree
   log_X[3]=74   ## dark tree
   log_X[4]=84   ## swamp
   log_X[5]=94   ## silwer
   log_X[6]=104  ## keranit
   log_X[7]=114  ## perit
   log_X[8]=124  ## petrified
   log_X[9]=134  ## dragon
   log_X[10]=44  ## vampire
   log_X[11]=54  ## eridan
   log_X[12]=64  ## helios
   log_X[13]=74  ## illusions
   log_X[14]=84  ## crystal
   log_X[15]=94  ## dead tree
   log_X[16]=104 ## paradise
   log_X[17]=114 ## titan
   log_X[18]=124 ## avalon
   log_X[19]=134 ## elven
   log_X[20]=44  ## asterxylon

dim log_Y[21]
   log_Y[0]=65   ## logs
   log_Y[1]=65   ## oak
   log_Y[2]=65   ## red tree
   log_Y[3]=65   ## dark tree
   log_Y[4]=65   ## swamp
   log_Y[5]=65   ## silwer
   log_Y[6]=65   ## keranit
   log_Y[7]=65   ## perit
   log_Y[8]=65   ## petrified
   log_Y[9]=65   ## dragon
   log_Y[10]=95  ## vampire
   log_Y[11]=95  ## eridan
   log_Y[12]=95  ## helios
   log_Y[13]=95  ## illusions
   log_Y[14]=95  ## crystal
   log_Y[15]=95  ## dead tree
   log_Y[16]=95  ## paradise
   log_Y[17]=95  ## titan
   log_Y[18]=95  ## avalon
   log_Y[19]=95  ## elven
   log_Y[20]=125 ## asterxylon

uo.Print('Viberi sumku s rubki...')
uo.Exec('addobject source_bag')
while uo.Targeting()
  wait(100)
wend
uo.useobject('source_bag')

uo.Print('Viberi sumku dla logov...')
uo.Exec('addobject storage_bag')
while uo.Targeting()
  wait(100)
wend
uo.useobject('storage_bag')

for i=0 to 20

 uo.findtype(log, log_col[i], 'source_bag')
 in_source=uo.findcount()
 if in_source>0 then
   uo.findtype(log, log_col[i], 'storage_bag')
   in_storage=uo.findcount()
   if in_storage==0 then
     uo.findtype(log, log_col[i], 'source_bag')
     uo.moveitem('finditem', '-1', 'storage_bag', log_X[i], log_Y[i],0)
     wait(650)
   endif
   if in_storage>0 then
     uo.findtype(log, log_col[i], 'source_bag')
     uo.moveitem('finditem', '-1', 'storage_bag')
     wait(650)
   endif
 endif
 wait(10)
next
end sub
#####################################################

sub reg_sync()
var i=0, count=20
var in_travel=0
var in_source=0
var get_count=0
var travel_bag, source_bag
dim reg[8]
reg[0]=0x0F7B ## BM
reg[1]=0x0F7A ## BP
reg[2]=0x0F84 ## GA
reg[3]=0x0F85 ## GS
reg[4]=0x0F86 ## MR
reg[5]=0x0F88 ## NS
reg[6]=0x0F8C ## SA
reg[7]=0x0F8D ## SS
dim coord_reg_X[8]
coord_reg_X[0]=44 ## BM
coord_reg_X[1]=120 ## BP
coord_reg_X[2]=77 ## GA
coord_reg_X[3]=93 ## GS
coord_reg_X[4]=95 ## MR
coord_reg_X[5]=74 ## NS
coord_reg_X[6]=44 ## SA
coord_reg_X[7]=120 ## SS
dim coord_reg_Y[8]
coord_reg_Y[0]=65 ## BM
coord_reg_Y[1]=83 ## BP
coord_reg_Y[2]=83 ## GA
coord_reg_Y[3]=83 ## GS
coord_reg_Y[4]=65 ## MR
coord_reg_Y[5]=65 ## NS
coord_reg_Y[6]=83 ## SA
coord_reg_Y[7]=65 ## SS

uo.Print('Выбери сумку с регами...')
uo.Exec('addobject source_bag')
while uo.Targeting()
  wait(100)
wend
uo.useobject('source_bag')
uo.Print('Выбери сумку для регов...')
uo.Exec('addobject travel_bag')
while uo.Targeting()
  wait(100)
wend
uo.useobject('travel_bag')

for i=0 to 7
 uo.findtype(reg[i], '-1', 'source_bag')
 in_source=uo.GetQuantity('finditem')
##uo.print('naydeno1 reg #'+str(i)+' = '+str(in_source))

 uo.findtype(reg[i], '-1', 'travel_bag')
 in_travel=uo.GetQuantity('finditem')
##uo.print('naydeno2 reg #'+str(i)+' = '+str(in_travel))

; if in_travel<50 then
     if in_source>0 then
       get_count=count-in_travel
uo.print('kladem # '+str(i)+' = '+str(get_count)+ '  ('+str(count)+' - '+str(in_travel)+')')
       if in_travel==0 then
           uo.findtype(reg[i], '-1', 'source_bag')
           uo.moveitem('finditem',get_count,'travel_bag',coord_reg_X[i],coord_reg_Y[i],0)
        else
         if get_count>0 then
           uo.findtype(reg[i], '-1', 'source_bag')
           uo.moveitem('finditem',get_count,'travel_bag')
         endif
         if get_count<0 then
           get_count=in_travel-count
           uo.findtype(reg[i], '-1', 'travel_bag')
           uo.moveitem('finditem',get_count,'source_bag')
         endif
       endif
      else
       uo.Print('Недостаточно регов!!')
     endif
; endif
 wait(650)
next
end sub
#####################################################
sub hiding_w()
var status
  uo.DeleteJournal()
  status=uo.warmode()
##  uo.print('status='+str(status))
  uo.warmode(0)
  uo.useskill('Stealth')
  while not uo.InJournal('seem') and not uo.InJournal('You have hidden')
    wait(100)
  wend
  uo.warmode(status)
end sub


Сделал файл с координатами, прописал все идешки и тупе. Запускаю скрипт, хайдится, берет в руки топор и начинает рубить, рубить и рубить :) Т.е. каждую секунду юзает топор на дерево и в итоге то нифига не рубится...
Заранее благодарен за помощь.


Top
   
 Post subject: Re: Lamberjacking
PostPosted: 2011-05-29 06:52:41 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Code:
   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 Text6="You put the Ent's body part at your feet. it is too heavy.."
   var Text7="Ent"

убрать точки, проверить регистр, проверить сообщения.

Видимо чтото поменял в первоисточнике скрипта.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
 Post subject: Re: Lamberjacking
PostPosted: 2011-05-29 12:10:55 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Code:
##uo.DeleteJournal()


Это проблемное место по-моему


Top
   
 Post subject: Re: Lamberjacking
PostPosted: 2011-05-29 12:34:40 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
ага, и не в одном месте.
проще взять оригинал и начать править под себя снова.

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 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:  
Powered by phpBB® Forum Software © phpBB Limited