The next autoloot version is out.
Добавлено:
- Резалка трупов
-- Нужно указать только тип предмета которым будем резать
-- Когда дорезал трупы одевает прежнее оружие
- Подбор вещей без разбору
- Больше переменных настраиваються
- Отдельно настраиваеться время лута на земле и в трупах
- Функция отключения сообщений в клиенте
Пофиксено:
- Помоему решил проблему с 0xFFFFFFFF
- Вместо кривого ручного определения расстояния, используеться finddistance
Added:
- Auto-Carving
-- You need only type of the object with which you want to carve
-- Gets last weapon on after carving
- All items loot
- More user variables
- Different corpse and ground loot times
- No client message function
Fixed:
- I think that 0xFFFFFFFF problem is fixed
- New distance checking
Code: Select all
##################################
### AutoLoot v 3.2 by Beyonder # FIXED ###
##################################
#
### Запускать auto_loot()
### Run the function auto_loot()
#
### Нужна любая функция CheckLag()
### Any CheckLag() function is needed for script
#
## Время достаточное для открытия контейнера
## Time enough for container to open
var OpenContWait=400
## Время между лутом вещей с трупов
## Delay after looting each item from corpses
var LootItemWait=400
## Время между лутом вещей с земли
## Delay after looting each item from ground
var LootGroundWait=400
## Нужно ли брать вещи без разбору?
## Taking items without specification
var LootAllItems=0 # 1=true 0=false
## Сначала резать трупы?
## Carve corpses first
var CutCorpse=true
## Тип вещи которой будем резать
## Type of the item we want to carve the corpses
var CutItemType='0x0EC2'
## Как далеко лежащие трупы можно лутить
## Distance to the corpse we can loot
var maxlen=3
## ID мешка куда будем складывать вещи
## ID of the bag we want to put the items to
var BagID='0x40032183'
## Забирать вещи с земли?
## Do you want loot from the ground too?
var LootGround=false
## Время достаточное на разрезание трупа
## Time enough for carving the corpse
var CutTime=300
## Отключить вывод системных сообщений в клиенте
## Disable verbosing in client
var NoVerbose=true
### Основная функция лута # ContainerID - ID контейнера # BagID - ID мешка куда складывать вещи
### Main looting function # Container ID - ID of the container to loot # BagID - bag where to put
sub loot_container(ContainerID,BagID)
var ContCnt=2 #Количество указанных контейнеров # Container count
var NeedCnt=8 #Количество указанных вещей для лута # Loot items count
dim ContFr[10] #Массив контейнеров. Число в скобках должно быть больше ContCnt # Container array, value must be set >ContCnt
dim ContTo[10] #То-же условие что и выше # Same as for ContFr
dim NeedFr[20] #Массив вещей. Число в скобках должно быть больше NeedCnt # Item array # Value must be set > NeedCnt
dim NeedTo[20] #То-же условие что и для NeedFr # Same as for NeedFr
dim NeedTypes[20] #То-же условие что и для NeedFr # Same as for NeedFr
var ItemGr
var ItemID
var FCnt
var iItem
var waittime
if ContainerID==UO.GetSerial('ground') then
waittime=LootGroundWait
else
waittime=LootItemWait
end if
##### Настройка вещей
##### Item config
#### Контейнеры
#### Containers
ContFr[0]='0x0E70'
ContTo[0]='0x0E80'
#
ContFr[1]='0x09B0'
ContTo[1]='0x09B0'
#### Вещи
#### Items
#### Gold
NeedFr[0]='0x0EED'
NeedTo[0]='0x0EED'
#### Gems
NeedFr[1]='0x0F00'
NeedTo[1]='0x0F30'
#### Scrolls
NeedFr[2]='0x1F10'
NeedTo[2]='0x1FFF'
#### Jewerly
NeedFr[3]='0x1F05'
NeedTo[3]='0x1F0F'
NeedFr[4]='0x1080'
NeedTo[4]='0x108F'
####
#### Bandages
NeedFr[5]='0x0E20'
NeedTo[5]='0x0E21'
#### Arrows
NeedFr[6]='0x0F3F'
NeedTo[6]='0x0F3F'
####
#### Reagents
NeedFr[7]='0x0F70'
NeedTo[7]='0x0F90'
####
#### Какие из перечисленных типов нам нужны
#### Which of the types we need
NeedTypes[0]=1
NeedTypes[1]=1
NeedTypes[2]=1
NeedTypes[3]=1
NeedTypes[4]=1
NeedTypes[5]=1
NeedTypes[6]=0
NeedTypes[7]=1
#### Getting items up
repeat
UO.FindType(-1,-1,ContainerID)
FCnt=UO.FindCount()
if UO.FindCount()>0 then
ItemGr=UO.GetGraphic('finditem')
ItemID=UO.GetSerial('finditem')
if LootAllItems==0 then
## Scanning for bags
iItem=0
while iItem<ContCnt
if IsDip(ItemGr,ContFr[iItem],ContTo[iItem]) then
UO.UseObject(ItemID) ## Opening container
wait(OpenContWait)
loot_container(ItemID,BagID)
UO.Hide(ItemID) ## Closing opened container
iItem=ContCnt
end if
iItem=iItem+1
wend
## Scanning for items
iItem=0
while iItem<NeedCnt
if NeedTypes[iItem] AND IsDip(ItemGr,NeedFr[iItem],NeedTo[iItem]) then
UO.MoveItem(ItemID,0,BagID)
wait(waittime)
iItem=NeedCnt
end if
iItem=iItem+1
wend
else
UO.MoveItem(ItemID,0,BagID)
wait(waittime)
end if
UO.Ignore(ItemID)
end if
until FCnt==0
end sub
## Функция режет выбранный труп
## Function cuts selected corpse
Sub CutCorpseID(CorpseID)
var CutID
var Dressed=true
if UO.GetGraphic(UO.ObjAtLayer('Rhand'))==CutItemType then
CutID=UO.GetSerial(UO.ObjAtLayer('Rhand'))
else
if UO.GetGraphic(UO.ObjAtLayer('Lhand'))==CutItemType then
CutID=UO.GetSerial(UO.ObjAtLayer('Lhand'))
else
UO.FindType(CutItemType,-1,'my')
CutID=UO.GetSerial('finditem')
Dressed=false
end if
end if
if not Dressed then
UO.SetArm('cutting_start_arm')
end if
UO.WaitTargetObject(CorpseID)
UO.UseObject(CutID)
wait(CutTime)
return Dressed
end sub
### Функция возвращает следующий труп
### Function returns next corpse
sub next_corpse()
var CorpseID
repeat
UO.FindType('0x2006',-1,'ground') ### Finding corpse
CorpseID=UO.GetSerial('finditem')
if UO.FindCount()==0 then
CorpseID=0 ## No more corpses
else
UO.Ignore(CorpseID)
return CorpseID
end if
until CorpseID==0
return CorpseID
end sub
### Проверка на принадлежность значения диапазону
### Check for a value being between bounds
sub IsDip(x,f,t)
var i_x=UO.Hex2Int(x)
var i_f=UO.Hex2Int(f)
var i_t=UO.Hex2Int(t)
if (i_x>=i_f AND i_x<=i_t) OR (i_x<=i_f AND i_x>=i_t) then
return true
else
return false
end if
end sub
Sub CollectCorpses(Arr)
var CorpseID=1
var CorpseCnt=0
UO.IgnoreReset()
while CorpseID<>0
CorpseID=next_corpse()
if CorpseID<>0 then
Arr[CorpseCnt]=CorpseID
UO.Ignore(CorpseID)
CorpseCnt=CorpseCnt+1
end if
wend
return CorpseCnt
end sub
### Функция лутящая все трупы вокруг
### All corpse looting function
sub auto_loot()
dim Corpses[50]
var CorpseCnt=0
var CorpseNum
var Dressed=true
uo.set('quiet',NoVerbose)
uo.set('finddistance',maxlen)
## Searching Corpses
CorpseCnt=CollectCorpses(Corpses)
## Looting corpses
if (CorpseCnt>0) then
if CutCorpse then
for CorpseNum=0 to CorpseCnt-1
UO.Print('Cutting')
Dressed=Dressed*CutCorpseID(Corpses[CorpseNum])
next
CorpseCnt=CollectCorpses(Corpses)
end if
end if
if CorpseCnt>0 then
if not Dressed then
UO.Arm('cutting_start_arm')
end if
for CorpseNum=0 to CorpseCnt-1
UO.DeleteJournal()
UO.UseObject(Corpses[CorpseNum])
wait(OpenContWait)
loot_container(Corpses[CorpseNum],BagID)
next
end if
if LootGround then
loot_container('ground',BagID) #
end if
UO.IgnoreReset()
uo.set('quiet',0)
end sub
Жду критику и багов.