Помогите вставить.
Posted: 2005-04-29 00:10:20
Помогите пожалуйста вставить в скрипт раскладку карт по уровням.
Можно отсюда?
Заранее благодарен.[/code]
Code: Select all
#################################################################################################
# "Расшифровка карт" #
#################################################################################################
# http://www.drw.ru #
#################################################################################################
# Последнее изменение 14.03.2004 #
#################################################################################################
# (c) AGRS, 2004 #
#################################################################################################
#################################################################################################
# >>> Константы #
#################################################################################################
Var SrcCont = 0x40072864 # SERIAL Контейнер-источник
Var DstCont = 0x401C96C9 # SERIAL Контейнер-приемник
Var PackCont = 0x400B9D61 # SERIAL Пак
Var MapType = 0x14EB # TYPE Карта
Var MapColor = 0x0000 # COLOR Карта
Var HideSkill = "Stealth"
Var Lagaet = "Ohuenno" # STR Если = "Ohuenno", то дополнительная проверка на лаги
#################################################################################################
# >>> Запуск #
#################################################################################################
Sub Main()
While true
LoadItems(1, MapType, MapColor, SrcCont, PackCont)
CheckLag()
UO.FindType(STR(MapType), STR(MapColor), STR(PackCont))
If UO.FindCount()>0 Then
UO.UseType(STR(MapType))
Wait(300)
EndIf
MoveAllItems(MapType, MapColor, PackCont, DstCont)
Wend
End Sub
Sub Main2()
var L1 = 0
var L2 = 0
var L3 = 0
var L4 = 0
var L5 = 0
var TOUT
Repeat
UO.FindType(STR(MapType), STR(MapColor), STR(SrcCont))
If UO.FindCount()>0 Then
UO.SetReceivingContainer("backpack")
UO.Grab("1", "finditem")
CheckLag()
UO.UseObject("finditem")
TOUT=0
Repeat
Wait(250)
TOUT=TOUT+250
Until UO.InJournal("map is level") or TOUT>500
Wait(800)
UO.Click("finditem")
Wait(800)
If UO.InJournal("1 level") Then
UO.MoveItem("finditem", "1", STR(DstCont), "20", "30", "0")
L1=L1+1
EndIf
If UO.InJournal("2 level") Then
UO.MoveItem("finditem", "1", STR(DstCont), "40", "45", "0")
L2=L2+1
EndIf
If UO.InJournal("3 level") Then
UO.MoveItem("finditem", "1", STR(DstCont), "60", "60", "0")
L3=L3+1
EndIf
If UO.InJournal("4 level") Then
UO.MoveItem("finditem", "1", STR(DstCont), "80", "75", "0")
L4=L4+1
EndIf
If UO.InJournal("5 level") Then
UO.MoveItem("finditem", "1", STR(DstCont), "100", "90", "0")
L5=L5+1
EndIf
CheckLag()
UO.FindType(STR(MapType), STR(MapColor), STR(SrcCont))
EndIf
UO.TextClear()
UO.TextPrint("Level1="+STR(L1))
UO.TextPrint("Level2="+STR(L2))
UO.TextPrint("Level3="+STR(L3))
UO.TextPrint("Level4="+STR(L4))
UO.TextPrint("Level5="+STR(L5))
Until UO.FindCount()<1
End Sub
#################################################################################################
# >>> Сервисные функции #
#################################################################################################
#=>
Sub LoadItems(fmiItemCount, fmiItemType, fmiItemColor, fmiSrcContainerSerial, fmiDstContainerSerial)
Var fmiToGrab
If CountOf(fmiItemType, fmiItemColor, fmiDstContainerSerial)<fmiItemCount Then
UO.SetReceivingContainer(STR(fmiDstContainerSerial))
Repeat
CheckLag()
fmiToGrab=fmiItemCount-CountOf(fmiItemType, fmiItemColor, fmiDstContainerSerial)
UO.FindType(STR(fmiItemType), STR(fmiItemColor), STR(fmiSrcContainerSerial))
If UO.FindCount()>0 Then
UO.Grab(STR(fmiToGrab), 'finditem')
Wait(300)
EndIf
If Lagaet=="Ohuenno" Then
CheckLag()
EndIf
Until CountOf(fmiItemType, fmiItemColor, fmiSrcContainerSerial)==0 or CountOf(fmiItemType, fmiItemColor, fmiDstContainerSerial)>=fmiItemCount
UO.UnsetReceivingContainer()
End If
Return CountOf(fmiItemType, fmiItemColor, fmiDstContainerSerial)
End Sub
Sub MoveAllItems(fmiItemType, fmiItemColor, fmiSrcContainerSerial, fmiDstContainerSerial)
UO.SetReceivingContainer(STR(fmiDstContainerSerial))
Repeat
CheckLag()
UO.FindType(STR(fmiItemType), STR(fmiItemColor), STR(fmiSrcContainerSerial))
If UO.FindCount()>0 Then
UO.Grab(0, 'finditem')
Wait(300)
EndIf
If Lagaet=="Ohuenno" Then
CheckLag()
EndIf
Until UO.FindCount()<1
UO.UnsetReceivingContainer()
End Sub
Sub CountOf(fcoItemType, fcoItemColor, fcoContainerSerial)
Var fcoFindCount = 0
Var fcoResult = 0
UO.FindType(STR(fcoItemType), STR(fcoItemColor), STR(fcoContainerSerial))
fcoFindCount=UO.FindCount()
If fcoFindCount==1 Then
fcoResult=UO.GetQuantity('finditem')
EndIf
If fcoFindCount>1 Then
While fcoFindCount>0
UO.FindType(STR(fcoItemType), STR(fcoItemColor), STR(fcoContainerSerial))
fcoResult=fcoResult+UO.GetQuantity('finditem')
UO.Ignore('finditem', 'on')
fcoFindCount=fcoFindCount-1
Wend
UO.IgnoreReset()
EndIf
Return fcoResult
End Sub
Sub Hide()
While Not UO.Hidden()
UO.DeleteJournal()
UO.UseSkill(HideSkill)
Repeat
Wait(100)
Until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide')
Wend
End Sub
Sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
Repeat
Wait(100)
Until UO.InJournal('backpack')
CheckSave()
End Sub
Sub CheckSave()
UO.DeleteJournal()
If UO.InJournal('save has been') then
Wait(10000)
EndIf
UO.DeleteJournal()
End Sub
#=>
Можно отсюда?
Code: Select all
sub Decode()
var count
UO.DeleteJournal()
UO.AddObject('Bag for 1st level maps')
while uo.Targeting()
wait(1000)
wend
UO.DeleteJournal()
UO.AddObject('Bag for 2nd level maps')
while uo.Targeting()
wait(1000)
wend
UO.DeleteJournal()
UO.AddObject('Bag for 3rd level maps')
while uo.Targeting()
wait(1000)
wend
UO.DeleteJournal()
UO.AddObject('Bag for 4th level maps')
while uo.Targeting()
wait(1000)
wend
UO.DeleteJournal()
UO.AddObject('Bag for 5th level maps')
while uo.Targeting()
wait(1000)
wend
UO.DeleteJournal()
UO.AddObject('Bag for Treasure Map')
while uo.Targeting()
wait(1000)
wend
repeat
uo.deletejournal()
uo.findtype(0x14EB)
uo.useobject('finditem')
count=0
while not uo.injournal("map") and count<20
count=count+1
wait(100)
wend
if uo.injournal("level 1") then
uo.moveitem('finditem',0,'Bag for 1st level maps')
CheckLag()
endif
if uo.injournal("level 2") then
uo.moveitem('finditem',0,'Bag for 2nd level maps')
CheckLag()
endif
if uo.injournal("level 3") then
uo.moveitem('finditem',0,'Bag for 3rd level maps')
CheckLag()
endif
if uo.injournal("level 4") then
uo.moveitem('finditem',0,'Bag for 4th level maps')
CheckLag()
endif
if uo.injournal("level 5") then
uo.moveitem('finditem',0,'Bag for 5th level maps')
CheckLag()
endif
if uo.injournal("no chance") then
uo.moveitem('finditem',0,'Bag for Treasure Map')
CheckLag()
endif
until UO.FindCount()==0
UO.Print("Done")
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
Wait(500)
Until uo.InJournal('backpack')
end sub
Заранее благодарен.[/code]