Помогите подправить плиз

Ask for help

Moderators: Murderator+, Murderator

Post Reply
kosrk
Posts: 20
Joined: 2010-12-02 23:00:07

Помогите подправить плиз

Post by kosrk »

Вот понять не могу вроде все скрипт работает убивает а потом бац и тупа стоит не че не делает :( помогите подправить плизз!


Var Dom = '0x40DF2929' ;тут ИД рунки домой

Var Zagon = '0x40DF2A0D' ;тут ИД рунки в загон

Var Chest = '0x402BC1B7' ;тут ИД сундука/сумки куда складываем нужное и берём реги

Var Kalitka = '0x086C' ;тут тип калитки чтобы чар открывал её когда реколится

Var WaitForRecall=1 ;не смотреть, просто надо!

VAR LastTimer

sub AnimalTaming()
repeat
st:
uo.Set('finddistance','14')
Uo.FindType('0x00CF',-1,'ground')
if uo.FindCount()>0 then
uo.DeleteJournal()
LastTimer=UO.Timer()
uo.DeleteJournal()
uo.waittargetobject('finditem')
uo.UseSkill('Animal Taming')
repeat
if UO.InJournal('fail to tame|Sheep is|see the creature|Targeting')or uo.FindCount()<0 OR UO.Timer()>LastTimer+120 then
wait(300)
goto st
end if
wait(300)
until UO.InJournal('It seems|far away.')
repeat
if uo.GetDistance('finditem') > 1 then
wait(200)
end if
until uo.GetDistance('finditem')==1
uo.waittargetobject('finditem')
uo.usetype('0x0F51')
wait(300)
uo.Set('finddistance','3')
Uo.findtype('0x00DF',-1,'ground')
if uo.FindCount() >1 then
uo.waittargetobject('finditem')
UO.Say('All kill')
repeat
wait(300)
until Uo.InJournal('Body of')
wait(300)
end if
Uo.WaitTargetObject('lastcorpse')
Uo.UseType('0x0F51')
wait(300)
loot()
wait(300)
Uo.FindType('0x1078',-1,'backpack')
wait(100)
Uo.WaitTargetObject('finditem')
UO.UseType('0x0F9E')
wait(500)
if UO.Weight>(uo.str*4) then
unload()
endif
until UO.Dead()
End Sub

sub unload()
RecallDom()
UO.UseFromGround(Kalitka)
MoveTo(Chest,1)
Razg()
wait(100)
RecallZagon()
end sub

sub Razg()
VAR d
VAR LastTimer
DIM Ovc[12]
Ovc[1]=0x0DF8 ; Шерсть
Ovc[2]=0x1067 ; Кожа
Ovc[3]=0x09F1 ; ribs
Ovc[4]=0x0C4F ; Хлопок

wait(100)
For d=1 to 4
While UO.Count(ovc[d])>0
UO.FindType(ovc[d],-1,-1)
UO.MoveItem('finditem',0,Chest)
wait(200)
uo.print(ovc[d])
Wend
next
takereg()
if UO.Mana < 30 then
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
endif
end sub

sub takereg()
DIM reg[3]
var i,n
reg[1]='0x0F86' ; MR
reg[2]='0x0F7A' ; BP
reg[3]='0x0F7B' ; BM

UO.UseObject(Chest)
for i=1 to 3
while UO.Count(reg[i])<5
UO.FindType(reg[i],-1,Chest)
n=UO.Count(reg[i])
UO.Grab(str(5-n),'finditem')
wait(200)
wend
next
end sub


sub Loot()
VAR i,Exit
DIM Loot[4]


Loot[0]=0x0DF8 ; Шерсть
Loot[1]=0x1078 ; Кожа
Loot[2]=0x09F1 ; ribs
Loot[3]=0x0C4F ; Хлопок


UO.SetReceivingContainer('0x40EE559B') ;ID backpacka
For i=0 to 3
Exit=0
repeat
;UO.Print(str(i))
UO.FindType(Loot[i],-1,'lastcontainer')
if UO.GetQuantity('finditem') then
UO.Grab('0','finditem')
wait(400)
Else
UO.UnSetReceivingContainer()
Exit=1
endif
until Exit==1 OR uo.injournal("loot")
Next
UO.UnSetReceivingContainer()
end sub


sub RecallDom()
var b
uo.print('Recoll')
for b=1 to 10
uo.deletejournal()
uo.waittargetobject(Dom)
uo.cast('Recall',Dom)
if WaitForRecall()==1 then
return 1
end if
next
return 0
end sub

sub RecallZagon()
var b
uo.print('Recoll')
for b=1 to 10
uo.deletejournal()
uo.waittargetobject(Zagon)
uo.cast('Recall',Zagon)
if WaitForRecall()==1 then
return 1
end if
next
return 0
end sub


sub WaitForRecall()
var Text1=uo.getname()+": The spell fizzles."
var mess='',lastX=uo.getX(),lastY=uo.getY()
for var v=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 MoveTo(object, prec)
var dx, dy
dim Key[9]
Key[0]=37
Key[1]=35
Key[2]=40
Key[3]=36
Key[4]=12
Key[5]=34
Key[6]=38
Key[7]=33
Key[8]=39
while uo.GetDistance(object) > prec
dx=uo.GetX(object)-uo.GetX()
dy=-uo.GetY(object)+uo.GetY()
uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
wait(10)
wend
end sub

sub Sig(num)
if num < 0 then
return -1
else
if num == 0 then
return 0
endif
endif
return 1
end sub


# Автоматический поиск (Авто) - для загонов. #
# Постоянно ищет животное из массива. При нахождении #
# сам подходит к нему и пытается приручить. При удачном #
# исходе отпускает или убивает (см. Настройки). #
# При неудачном (если мал скилл или уже притамлено) убивает. #
# Режим кормления не предусмотрен. #
# #
# НОВЫХ животных добавляем по типу и не забываем смеенить n #
# НАСТРОЙКИ #
# #
#####################################
# Настройки режима. #
#####################################################
# Что делать с прирученным животным #
var Release = 0 # 1 - Отпустить cказать All Release #
# 0 - Убить #
#####################################################################
var n=2 #количество животных в массиве
#####################################################################
#ДЛЯ СТАРТА ЗАПУСТИТЬ start()!!!
#####################################################################


sub start()
UO.WarMode(1)
wait(100)
UO.WarMode(0)
wait(100)
UO.exec("terminate main;exec main")
end sub



Sub main()
var a, j
var gl=''
dim Animal[n]
Animal[0]="0x0006"
Animal[1]="0x00D0"



UO.exec("terminate Reconnect;exec Reconnect")
UO.Set('finddistance', '4')
UO.IgnoreReset()
while (UO.SkillVal('Animal Taming','1') < 1000)
j = 0
For a = 0 to n-1
uo.FindType(Animal[a], -1, 'ground')
if uo.FindCount()>0 then
j = UO.GetSerial('finditem')
uo.click(j)
if UO.GetName(j) == gl then
UO.Print('ГЛЮКИ!!!')
else
TameAnimal(j,Release)
endif
endif
next
UO.Print('Анализ NPC закончин.')
if (j == 0) then
UO.Print('NPC Нет')
endif
wait(2000)
wend
endif
endsub

Sub TameAnimal(Animal, Rel)
var msg1 = "It seems to accept you"
var msg2 = "You fail to tame the"
var msg3 = "I am too far away"
var msg4 = "already"
var msg5 = "quantity"; taming skill"
UO.Print('Приручаем '+UO.GetName(Animal)+'...')
GotoXY(UO.GetX(Animal),UO.GetY(Animal),2)
DeleteJournal(msg1)
DeleteJournal(msg2)
DeleteJournal(msg3)
DeleteJournal(msg4)
DeleteJournal(msg5)
While not UO.InJournal(msg1) and not UO.InJournal(msg4) and not UO.InJournal(msg5)
UO.WarMode(0)
UO.WaitTargetObject(Animal)
UO.UseSkill('Animal Taming')
While not UO.InJournal(msg1) and not UO.InJournal(msg2) and not UO.InJournal(msg3) and not UO.InJournal(msg4) and not UO.InJournal(msg5)
wait(100)
wend
if UO.InJournal(msg2) or UO.InJournal(msg3) then
GotoXY(UO.GetX(Animal),UO.GetY(Animal),2)
endif
DeleteJournal(msg2)
DeleteJournal(msg3)
wend
if UO.InJournal(msg4) or UO.InJournal(msg5) then
UO.Print(UO.GetName(Animal)+' Не хочет приручатсья.')
KillAnim(Animal)
endif
if UO.InJournal(msg1) then
UO.Print(UO.GetName(Animal)+' Приручен!!!')
if not (UO.GetName(Animal) == '') then
if (Rel == 1) then
UO.msg('All Release')
UO.msg('GuArDs')
else
UO.sayu('All Come')
UO.Attack(Animal)
wait(500)
KillAnim(Animal)
endif
endif
endif
endsub

Sub DeleteJournal(msg)
While UO.InJournal(msg)
UO.SetJournalLine(UO.InJournal(msg) - 1,'')
wend
endsub

Sub KillAnim(Anim)
UO.Print('Идём убивать '+UO.GetName(Anim)+'...')
UO.Attack(Anim)
GotoXY(UO.GetX(Anim),UO.GetY(Anim),1)
UO.DeleteJournal()
repeat
if uo.GetDistance(Anim) > 1 then
GotoXY(UO.GetX(Anim),UO.GetY(Anim),1)
end if
wait(100)
until uo.dead() or uo.GetX(Anim)==0
UO.Ignore(Anim)
endsub

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.Lclick(316,270)
wait(3000)
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)
UO.exec("terminate main;exec start")
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 GotoXY(x,y,prec)
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) <= prec and Numb(y-myY) <= prec 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 att()
VAR monst
var timer
DIM R[24]
var c
R[1] = 0x0F86 # Mandrake
R[2] = 0x0F7A # Black Perl
R[3] = 0x0F88 # Nigthshade
R[4] = 0x0F8C # Sulphorius Ash
R[5] = 0x0F10 # Emerald
R[6] = 0x0F15 # Cytrine
R[7] = 0x0f26 # Diamond
R[8] = 0x0F16 # Ametist
R[9] = 0x0f25 # Piece of amber
R[10] = 0x0f11 # Saphire
R[11] = 0x0f13 # Ruby
R[12] = 0x0f26 # Granate
R[13] = 0x0f18 # Tourmaline
R[14] = 0x09AA # Pandora Box
R[15] = 0x14fb # 1 Lockpick
R[16] = 0x1bfb # Bolt
R[17] = 0x1b7a # Shield
R[18] = 0x0f4f # Crossbow
R[19] = 0x13b3 # Mace
R[20] = 0x1438 # War Hummer
R[21] = 0x0F86 # Mandrake
R[22] = 0x0F7A # Black Perl
R[23] = 0x0F88 # Nigthshade
R[24] = 0x0F8C # Sulphorius Ash
while UO.GetHP('self') < 500
Nachalo:
wait(1000)
UO.Set('finddistance','4')
repeat
UO.FindType('0x001c', -1, 'ground')
wait(500)
until uo.findcount()>0
if UO.FindCount() > 0 then
uo.click('finditem')
repeat
wait(110)
until uo.getname()
monst= UO.GetName( 'finditem' )
uo.print('Имя гада' + monst)
if monst == 'Covetous Spider' or monst == '*Covetous Spider атакует Вас*' then
uo.print('Идет')
else
uo.print('Не идет')
uo.exec('resend')
goto Nachalo
endif
uo.warmode(1)
UO.DeleteJournal()
uo.usetype('0x0f4f')
UO.Attack('finditem')
else
wait(50)
endif
UO.Set('finddistance','1')
timer=uo.timer()
repeat
UO.FindType('0x001c', -1, 'ground')
wait(200)
until uo.findcount()>0 or uo.injournal('Тело') or uo.timer()>timer+200
if UO.FindCount() > 0 then
uo.usetype('0x1b7a')
uo.usetype('0x13b3')
UO.Attack('finditem')
while not uo.injournal('Тело')
wait(500)
wend
else
wait(50)
endif
uo.usetype('0x1b7a')
uo.usetype('0x13b3')
wait(500)
if uo.armor<=140 then
uo.cast('Arch Protection')
wait(1000)
endif
uo.useobject('lastcorpse')
for c=1 to 24
repeat
wait(20)
uo.findtype(R[c],"-1","lastcontainer")
if UO.FindCount()>0 and Uo.GetDistance("lastcontainer")<=4 then
UO.Grab("0","finditem")
wait(100)
endif
until uo.getdistance("lastcontainer")>4 or uo.findcount()==0
wait(20)
next
uo.print('NEXT')
wend
end sub
Sirocco
Posts: 90
Joined: 2007-07-07 13:14:01

Re: Помогите подправить плиз

Post by Sirocco »

facepalm.jpg
kosrk
Posts: 20
Joined: 2010-12-02 23:00:07

Re: Помогите подправить плиз

Post by kosrk »

Sirocco wrote:facepalm.jpg

Что это?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Помогите подправить плиз

Post by Mirage »

180px-Not-again-picard2.jpg
180px-Not-again-picard2.jpg (5.23 KiB) Viewed 2295 times

facepalm
Post Reply