Расшифровка карт
Posted: 2004-12-30 17:19:00
Нужен скрипт на расшифровку карт сокровищ, под ДРВ, надо чтобы он расшифровывал, затем складывал карты в разные мешочки по уровням кладов!
Code: Select all
###############################################################
#===---====---===---= Sort Treasure Map =---=---=---=---=---==#
# Scripted by Savage (c) 2004 ICQ:33336141 #
#"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#
sub CartSort()
; VAR f=file("maps.txt")
VAR Exit, Exit2, Buffer, Buffer2, i, Line, MapX, MapY
VAR Index=1, MapSerial, BagSerial, MatchFound
VAR StepRound=40 ; razbros koordinat
VAR WaitTime=500 ; pauza
DIM X[255],Y[255],Bag[255]
uo.exec('set injectecho 1')
; f.Create()
; f.Open()
UO.Print('Vibery meshok s kartamy!')
UO.AddObject('SourceBag')
While UO.Targeting()==2
wait(500)
Wend
UO.UseObject('SourceBag')
UO.Print('Vibery portfel dlya kart!')
UO.AddObject('ReceiveBag')
While UO.Targeting()==2
wait(500)
Wend
UO.UseObject('ReceiveBag')
UO.Print('Vibery portfel s pustimi meshkami i runami!')
UO.AddObject('SkladBag')
While UO.Targeting()==2
wait(500)
Wend
UO.UseObject('SkladBag')
UO.IgnoreReset()
Exit=0
While Exit<>1
UO.FindType('0x0E76',-1,'ReceiveBag') ; meshok
IF UO.GetQuantity('finditem')>0 Then
Bag[Index]=UO.GetSerial('finditem')
UO.UseObject(Bag[Index])
wait(WaitTime)
UO.FindType('0x1F14',-1,Bag[Index]); runa
IF UO.GetQuantity('finditem')>0 Then
UO.DeleteJournal()
UO.Click('finditem')
Repeat
Wait(500)
Until UO.InJournal("Rune to")
Line=UO.InJournal("Rune to")-1
Buffer=UO.Journal(Line)
Buffer2=""
Exit2=0
i=8
While Exit2<>1
If Buffer[i]<>":" Then
Buffer2=Buffer2+Buffer[i]
Else
Exit2=1
Endif
i=i+1
Wend
MapX=VAl(Buffer2)
Buffer2=""
Exit2=0
While Exit2<>1
If Buffer[i]<>"" Then
Buffer2=Buffer2+Buffer[i]
Else
Exit2=1
Endif
i=i+1
Wend
MapY=VAl(Buffer2)
X[Index]=MapX
Y[Index]=MapY
UO.Ignore(Bag[Index])
Else
UO.MoveItem(Bag[Index],'1','SkladBag')
wait(WaitTime)
Index=Index-1
Endif
Index=Index+1
Else
Exit=1
Endif
Wend
Exit=0
While Exit<>1
UO.FindType('0x14EB',-1,'SourceBag')
If UO.GetQuantity('finditem')>0 Then
UO.DeleteJournal()
UO.MoveItem('finditem','1','backpack')
wait(WaitTime)
UO.UseObject('finditem')
MapSerial=UO.GetSerial('finditem')
Repeat
wait(500)
Until UO.InJournal("Map opened")
Line=UO.InJournal("Map opened")-1
Buffer=UO.Journal(Line)
Buffer2=""
Exit2=0
i=15
While Exit2<>1
If Buffer[i]<>":" Then
Buffer2=Buffer2+Buffer[i]
Else
Exit2=1
Endif
i=i+1
Wend
MapX=VAl(Buffer2)
Buffer2=""
Exit2=0
While Exit2<>1
If Buffer[i]<>"" Then
Buffer2=Buffer2+Buffer[i]
Else
Exit2=1
Endif
i=i+1
Wend
MapY=VAl(Buffer2)
i=1
Exit2=0
MatchFound=0
While i<Index AND Exit2<>1
If X[i]-StepRound<MapX AND X[i]+StepRound>MapX Then
If Y[i]-StepRound<MapY AND Y[i]+StepRound>MapY Then
BagSerial=Bag[i]
MatchFound=1
Exit2=1
Endif
EndIf
i=i+1
Wend
If MatchFound Then
UO.MoveItem(MapSerial,'1',BagSerial)
wait(WaitTime)
Else
UO.FindType('0x0E76',-1,'SkladBag') ; meshok
IF UO.GetQuantity('finditem')>0 Then
UO.MoveItem('finditem','1','ReceiveBag')
Bag[Index]=UO.GetSerial('finditem')
X[Index]=MapX
Y[Index]=MapY
wait(WaitTime)
UO.FindType('0x1F14',-1,'SkladBag'); runa
IF UO.GetQuantity('finditem')>0 Then
UO.MoveItem('finditem','1','backpack') ; runa to pack
wait(WaitTime)
UO.UseObject('finditem')
Repeat
Wait(500)
Until UO.InJournal("What is the new name")
UO.Say(STR(MapX)+":"+STR(MapY))
wait(WaitTime)
UO.MoveItem('finditem','1',Bag[Index]) ; runa to meshok
wait(WaitTime)
UO.MoveItem(MapSerial,'1',Bag[Index])
wait(WaitTime)
Else
Exit=1
UO.Print("Error! Kon4ilis pustie runy!")
Endif
Index=Index+1
Else
Exit=1
UO.Print("Error! Kon4ilis pustie sumki!")
Endif
Endif
; UO.Print(STR(MapX)+" "+STR(MapY))
; f.WriteLn(STR(MapX)+" "+STR(MapY))
wait(WaitTime)
Else
Exit=1
Endif
Wend
; f.Close()
UO.Print("Done!!!")
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: 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
#=>
Brigadir wrote:У моих друхей так же. открывает карту . дальше ничего не происходит и скрипт не отключаеться. может в инже какие нибудь настройки не те.
Brigadir wrote:У моих друхей так же. открывает карту . дальше ничего не происходит и скрипт не отключаеться. может в инже какие нибудь настройки не те.
HellFire wrote:Brigadir wrote:У моих друхей так же. открывает карту . дальше ничего не происходит и скрипт не отключаеться. может в инже какие нибудь настройки не те.
u mnu takajaze problemma
Goggy wrote:А это демо версия
Brigadir wrote:Помогие разобраться с скриптом Savage пожалуйста. он берет карту открывает её и дальше ничего не делает. и скрипт ошибку не выдаёт. не пойму в чем дело
мб injectecho надо установить в 1Savage wrote:Хм. Счас попробовал на работе - все работает замечательно. Мистика.
Sfagnum wrote:мб injectecho надо установить в 1Savage wrote:Хм. Счас попробовал на работе - все работает замечательно. Мистика.или эт в скрипте прописано? сорь не смотрел...
и почему же?Askaneli wrote:Твой кста тоже у меня не запахал.
Правдо до меня дошло потом почему , но я уже плюнул тада и сам раскидал карты как надо !!!