Скрипт на убивание овечек
Moderators: Murderator+, Murderator
Скрипт на убивание овечек
Есть загон в Еве 23 на 23 клетки,в нём респятся овцы,препятствий нет,напишите плз скриптик,чтобы как появлялась овца он шёл к ней,состригал бучером шерсть,убивал оружием,резал труп и доставал шерсть из трупа плз 0)
Code: Select all
sub Abs(num)
if num < 0 then
return -num
end if
return num
end sub
sub Sig(num)
if num < 0 then
return -1
else
if num == 0 then
return 0
endif
endif
return 1
end sub
sub MoveToXY(x, y, 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
dx=x-uo.GetX()
dy=-y+uo.GetY()
while (Abs(dx) > prec) or (Abs(dy) > prec)
dx=x-uo.GetX()
dy=-y+uo.GetY()
uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
wait(10)
wend
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 KillIt()
var animal=0x00CF #тип животного
var n=1
var x=uo.GetX()
var y=uo.GetY()
uo.ignorereset()
uo.forget('far')
uo.forget('counters')
uo.SetGlobal('KillCount', 0)
Repeat
wait(10)
uo.Set('finddistance', n)
uo.FindType(animal, -1, 'ground')
if uo.FindCount() then
wait(100)
if uo.IsNPC('finditem') then
uo.info('finditem')
while uo.IsNPC('finditem')
if uo.GetDistance('finditem') > 1 then
MoveTo('finditem', 1)
uo.attack('finditem')
end if
wait(100)
wend
uo.SetGlobal('KillCount', val(uo.GetGlobal('KillCount'))+1)
uo.forget('finditem')
uo.warmode(0)
uo.waittargetobject('lastcorpse')
uo.usetype(0x0F51)
while uo.waiting()
wait(100)
wend
uo.disarm()
n=1
else
uo.Ignore('finditem')
end if
else
n=n+1
if n > 20 then
if (uo.GetX() <> x) or (uo.GetY() <> y) then
MoveToXY(x, y, 1)
end if
n=1
end if
end if
Until uo.Dead()
end sub
sub Stat()
uo.charprint(257, 'От ваших рук погибло: '+uo.GetGlobal('KillCount')+' невинных овец')
end sub
непомню что за шард
Бегает за овцами киляет и режит, дальше сам.
Лутше встать в центр поля и запустить.
Code: Select all
sub Abs(num)
if num < 0 then
return -num
end if
return num
end sub
sub Sig(num)
if num < 0 then
return -1
else
if num == 0 then
return 0
endif
endif
return 1
end sub
sub MoveToXY(x, y, 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
dx=x-uo.GetX()
dy=-y+uo.GetY()
while (Abs(dx) > prec) or (Abs(dy) > prec)
dx=x-uo.GetX()
dy=-y+uo.GetY()
uo.Press(Key[(sig(dy)+1)*3+1+sig(dx)])
wait(100)
wend
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(100)
wend
end sub
sub KillIt()
var animal=0x00CF #тип животного
var n=1
var x=uo.GetX()
var y=uo.GetY()
var IsLamb
var MaxWeight = 640
uo.ignorereset()
uo.forget('far')
uo.forget('counters')
uo.SetGlobal('KillCount', 0)
while not uo.Dead()
uo.Set('finddistance', n)
uo.FindType(animal, -1, 'ground')
if uo.FindCount() then
wait(100)
if uo.IsNPC('finditem') then
IsLamb = 0
while uo.IsNPC('finditem')
if uo.GetDistance('finditem') > 1 then
MoveTo('finditem', 1)
if not IsLamb then
uo.waittargetobject('finditem')
uo.usetype(0x0F51)
IsLamb = 1
endif
uo.attack('finditem')
end if
wait(100)
wend
uo.SetGlobal('KillCount', val(uo.GetGlobal('KillCount'))+1)
uo.forget('finditem')
uo.warmode(0)
uo.waittargetobject('lastcorpse')
uo.usetype(0x0F51)
while uo.waiting()
wait(100)
wend
wait(500)
if uo.Weight > MaxWeight then
uo.WaitTargetType(0x1078)
uo.UseType(0x0F9E)
while uo.Waiting()
wait(100)
wend
endif
uo.grab(-1, 'lastcorpse.0x1078')
n=1
else
uo.Ignore('finditem')
end if
else
n=n+1
if n > 20 then
if (uo.GetX() <> x) or (uo.GetY() <> y) then
MoveToXY(x, y, 1)
end if
n=1
end if
end if
wait(100)
wend
end sub
sub Stat()
uo.charprint(257, 'От ваших рук погибло: '+uo.GetGlobal('KillCount')+' невинных овец')
end sub
Делал кому то под антарес, только там не шерсть а кустики хлопка собирает из овцы. Поменяете тип заместо кустика - шерсть и вперед с песней.
Code: Select all
var Stoplocation ; Переменная отслеживает остановку чара
var nogik = '0x0f51' ; тип ножа для резки
var Box = '0x40079d3a' ; бокс откуда брать и куда складывать кустики
var Derevo = '0x0c4f' ; Кустик
var hаvka = '0x09f2' ; еда
var dich = '0x00cf' ; Овца
var paus = 300
sub pvm()
nac:
repeat
warka()
uo.print('ishem')
until uo.life == 0 ; or uo.count(nogik) == 0
go_bank() ; бежим к банку
if uo.Life ==0 then ; Если мы прибежали к банку по причине смерти то бежим чуть далее до креста
uo.print('umer')
uo.warmode(1)
gotoxy(634,851,1) ; забегаем
gotoxy(635,824,1) ; к двери скрестом
gotoxy(635,817,1)
uo.usefromground('0x0005')
gotoxy(635,824,1) ; к двери скрестом
uo.opendoor() ; открываем ее
gotoxy(634,855,1) ; к двери наружной
uo.opendoor() ; открываем ее
gotoxy(634,857,1) ; выходим
end if
GrKust() ; Скидываем кустики
GrNog() ; Берем ножи
havaem() ; хаваем
go_past() ; бежим к пастбищу
goto nac ; к началу скрипта
end sub
Sub GrKust() ; Скидываем кусты если они есть
repeat
uo.say("BANK")
wait(500)
uo.useobject(Box)
uo.findtype(Derevo) #Derevo
uo.moveitem('finditem','0',Box,1,1,1) ; выкидываем в аккуратную стопочку все кустики
wait(500)
until not uo.count(Derevo)
end sub
Sub GrNog() ; берем нож
uo.deletejournal()
uo.print('Berem nog')
wait(1000)
if uo.count(nogik) < 1 then
uo.findtype(nogik,'-1',Box)
UO.grab('1','finditem')
Wait(1200)
end if
end sub
Sub havaem()
var h
uo.deletejournal()
uo.print('Berem edu')
wait(3000)
if uo.count(hаvka) < 5 then
uo.findtype(hаvka,'-1',Box)
UO.grab('5','finditem')
Wait(1200)
end if
for h = 1 to 5
uo.usetype(hаvka) ; пытемся сожрать еду
wait(500)
next
uo.findtype(hаvka)
uo.moveitem('finditem','0',Box,1,1,1) ; выкидываем обратно еду если что осталось
wait(500)
end sub
sub warka()
var dx,dy, obj, i, obj2
if Stoplocation == 1 then ; если застряли то отбежим в средину пастбища
gotoxy(570,1099,1)
end if
UO.Set('finddistance',40) ; дистанция для поиска
UO.FindType(Dich, '-1', '1') ; Ищем животное
wait(paus)
If UO.FindCount() > 0 Then ; если нашли
obj = UO.GetSerial("finditem") ; запоминаем его
dx=UO.GetX(obj) ; находим координаты
dy=UO.GetY(obj)
uo.warmode(1) ; входим в вармод
wait(paus)
Gotoxy(dx,dy,1) ; подходим поближе
uo.attack(obj) ; атакуем
repeat
wait(200) ; чуть подождем пока убьет жертву, или если промахнулись То дальще
until uo.GetHP(obj) == 0 or uo.GetDistance(obj) > 1
UO.Set('finddistance',2) ; дистанция для поиска
wait(200)
UO.FindType('0x2006', '-1', '1') ; Ищем на земле труп
uo.print('poisk trupa')
wait(200)
if uo.findcount() > 0 then ; если находим то далее режем и т.д.
obj2 = UO.GetSerial("finditem")
uo.warmode(0) ; выходим из вармод
uo.print('vihod iz wara')
wait(paus)
uo.waittargetobject(obj2) ; установить прицел на труп
wait(paus)
UO.usetype('0x0f51') ; Использовать нож на прицеле
wait(paus)
; UO.FindType('0x0c4f', '-1', obj2) ; Искать ростки
UO.FindType('0x09f1', '-1', obj2) ; Искать ростки
uo.print('poisk rostkov')
wait(500)
if uo.findcount() > 0 then ; если находим ростки то
UO.Grab( 100, 'finditem' ) ; грабим
wait(paus)
uo.print("Vziali")
else
uo.print("Pusto")
end if
uo.ignore(obj2) ; игнорировать обьект в дальнейшем
uo.disarm() ; разоружаемся
wait(paus)
end if
end if
end sub
Sub gotoxy(x,y,prec)
VAR ld=0,ldc=0
VAR dx,dy
VAR mx,my
VAR ox,oy,mk,k
start:
mx=Uo.GetX()
my=Uo.GetY()
dx=mx-x
IF dx<0 then
dx=0-dx
endIF
dy=my-y
IF dy<0 then
dy=0-dy
endIF
IF dy>dx then
dx=dy
End IF
IF dx<=prec then
return
End IF
IF dx<3 then
mk=70
else
mk=15
End IF
ox=mx
oy=my
for k=1 to mk
mx=Uo.GetX()
my=Uo.GetY()
IF mx<>ox or my<>oy then
goto sdidapl
End IF
wait(10)
next
sdidapl:
mx=Uo.GetX()
my=Uo.GetY()
dx=mx-x
IF dx<0 then
dx=0-dx
endIF
dy=my-y
IF dy<0 then
dy=0-dy
endIF
IF dy>dx then
dx=dy
End IF
IF dx<=prec then
return
End IF
IF ld==dx then
ldc=ldc+1
IF ldc>50 then
Uo.print("Zastrial!"+"***"+" "+Time())
Stoplocation = 1
return
End IF
else
ld=dx
End IF
IF mx==x then
IF my==y then
return
endIF
IF my>y then
Uo.Press(33)
goto start
endIF
Uo.Press(35)
goto start
End IF
IF mx<x then
IF my>y then
Uo.Press(39)
goto start
endIF
IF my==y then
Uo.Press(34)
goto start
endIF
Uo.Press(40)
goto start
End IF
IF my<y then
Uo.Press(37)
goto start
endIF
IF my==y then
Uo.Press(36)
goto start
endIF
Uo.Press(38)
goto start
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 GetNumb(C,I)
VAR J,T,K
J=0
K=1
While K>0
J=J+1
IF (Mid(C,J,1)==" ") Or (J>=Len(C)-1) Then
IF I==0 Then
T=Val(Left(C,J))
Else
T=GetNumb(Right(C,Len(C)-J-1),I-1)
EndIF
K=0
EndIF
wend
return T
end sub
sub go_bank() ; Бег к банку
gotoxy(561,1110,1) ; бежим ближе к выходу
uo.opendoor() ; открываем двери
uo.print('1 точка')
GotoXY(563,1126,1)
uo.print('4 точка')
GotoXY(542,1133,1)
uo.print('5 точка')
GotoXY(539,1114,1)
uo.print('6 точка')
GotoXY(538,1085,1)
uo.print('7 точка')
GotoXY(551,1067,1)
uo.print('8 точка')
GotoXY(549,1039,1)
uo.print('9 точка')
GotoXY(554,1005,1)
uo.print('10 точка')
GotoXY(590,995,1)
uo.print('11 точка')
GotoXY(612,997,1)
uo.print('15 точка')
GotoXY(631,970,1)
uo.print('16 точка')
GotoXY(631,962,1)
uo.print('17 точка')
GotoXY(633,933,1)
uo.print('18 точка')
GotoXY(637,915,1)
uo.print('19 точка')
GotoXY(646,915,1)
uo.print('20 точка')
GotoXY(649,900,1)
uo.print('21 точка')
GotoXY(640,892,1)
uo.print('22 точка')
GotoXY(635,875,1)
uo.print('23 точка')
GotoXY(634,856,1)
end sub
sub go_past() ; бег к пастбищу
uo.print('1 точка')
GotoXY(635,864,1)
uo.print('2 точка')
GotoXY(639,890,1)
uo.print('3 точка')
GotoXY(648,899,1)
uo.print('4 точка')
GotoXY(647,911,1)
uo.print('5 точка')
GotoXY(633,916,1)
uo.print('6 точка')
GotoXY(625,922,1)
uo.print('6_1 точка')
GotoXY(606,933,1)
uo.print('7 точка')
GotoXY(634,961,1)
uo.print('8 точка')
GotoXY(646,981,1)
uo.print('9 точка')
GotoXY(612,997,1)
uo.print('10 точка')
GotoXY(590,995,1)
uo.print('11 точка')
GotoXY(554,1005,1)
uo.print('12 точка')
GotoXY(549,1039,1)
uo.print('13 точка')
GotoXY(551,1067,1)
uo.print('14 точка')
GotoXY(538,1085,1)
uo.print('15 точка')
GotoXY(539,1114,1)
uo.print('16 точка')
GotoXY(542,1133,1)
uo.print('17 точка')
GotoXY(556,1145,1)
uo.print('19 точка')
GotoXY(563,1126,1)
uo.print('20 точка')
GotoXY(562,1112,0)
uo.opendoor() ; открываем ворота
gotoxy(562,1109,0) ; забегаем внутрь
end sub
; ---- Вспомоагтельные сабы, для сбора тайлов и для сбора ид обьектов
sub Metka() #
repeat
uo.infotile()
wait(3000)
until false
end sub
sub ukazka_boxa() ; это не нужная утилита
uo.Exec('addobject Box')
while uo.Targeting()
wait(100)
wend
end sub