Помогите разобратся с САВАДЖЕВ`ским скриптом

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Dron D.
Posts: 190
Joined: 2004-12-13 01:27:00

Помогите разобратся с САВАДЖЕВ`ским скриптом

Post by Dron D. »

Скрипт на мининг в вип шахте. Инже не нравится строка:
WalkN(BaseX,BaseY,"")
Эта функция имеется:

sub WalkN(x,y,Target)
VAR i
VAR dx,dy,Exit=0

While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
; UO.Print("Target locked!")
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif

Endif

If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
GoSE()
Endif

If dx>0 AND dy<0 Then
GoNE()
Endif

If dx<0 AND dy>0 Then
GoSW()
Endif

If dx<0 AND dy<0 Then
GoWN()
Endif

Endif

If dx<>0 AND dy==0 Then
If dx>0 Then
GoE()
Endif

If dx<0 Then
GoW()
Endif
Endif


If dx==0 AND dy<>0 Then
If dy>0 Then
GoS()
Endif

If dy<0 Then
GoN()
Endif
Endif
Wend
end sub
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Сдесь проблема не в скрипте а в переменных Базе Х И У ........забей их выше по скрипту
Все просто.
BETEPAH ™
Dron D.
Posts: 190
Joined: 2004-12-13 01:27:00

Post by Dron D. »

Забил по выше, тайлы на которых стою, смнели внизу (в анлоад оре) и все равно ругается :(
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Dron D. wrote:Забил по выше, тайлы на которых стою, смнели внизу (в анлоад оре) и все равно ругается :(
http://yoko.netroof.net/forum/viewtopic.php?t=2599

бери это и не парся
Все просто.
BETEPAH ™
Dron D.
Posts: 190
Joined: 2004-12-13 01:27:00

Post by Dron D. »

Да ветер я брал етот скрипт, но мне не подходит он, т.к. я теряю 1 полосу обкапывания.... на растоянии4-5 клеток не кидает он в сундук не докидывает нарно )
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Dron D. wrote:Да ветер я брал етот скрипт, но мне не подходит он, т.к. я теряю 1 полосу обкапывания.... на растоянии4-5 клеток не кидает он в сундук не докидывает нарно )


стукни в асю договоримся )
Все просто.
BETEPAH ™
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

Ты просто не указал базовую точку для копания. Вообщем встань в место где копаешь и эти координаты укажи в скрипте. Там вроде даже коментарии на этот счет имеются.
Sergant
Posts: 25
Joined: 2004-08-04 08:04:14
Contact:

Post by Sergant »

скрипт на випку, чар при достижении веса сам относит все в сундук. Указываешь тока ИД сундука, мешка и кирки.

Code: Select all

#########################
#### GooD VIPMining #####
###### Crafted by #######
#### Coal aka Brona #####
## All rights reserved ##
## Copyright by Guild of Black Sun [GoBS] - DRW##
#########################

sub Mining()
VAR MaxWeight=740 ; vash maksimal'niy ves
VAR UnloadBox='0x40127766' ; ID containera
VAR UnloadBag='0x402E0B9E' ; ID Meshka
VAR Lopata='0x4018362D' ; ID kirki&lopati
VAR Timer=0
 
VAR MyX, MyY, MyZ, i, j
 
MyX = UO.GetX()
MyY = UO.GetY()
MyZ = UO.GetZ()
 
ToHide()
Wait(1000)
While NOT UO.Dead()
For i = MyX-4 to MyX+4
For j = MyY-4 to MyY+4
 
UO.DeleteJournal()
UO.Print("Now Mining In: "+str(MyX-i)+" "+str(MyY-j))
While NOT UO.InJournal("no ore") AND NOT UO.InJournal("far away") AND NOT UO.InJournal("in rock")# AND NOT UO.InJournal("Iron") AND NOT UO.InJournal("Copper") AND NOT UO.InJournal("Bronze") AND NOT UO.InJournal("Rusty") AND NOT UO.InJournal("no line") AND NOT UO.InJournal("Elemental")
CheckLag()
ToHide()
UO.DeleteJournal()
UO.WaitTargetTile("6044", str(i), str(j), str(MyZ))
UO.UseObject(Lopata)
 
Timer=0
While NOT UO.InJournal("You put") AND NOT UO.InJournal("but fail") AND NOT UO.InJournal("no ore") AND NOT UO.InJournal("far away") AND NOT UO.InJournal("in rock") AND NOT UO.InJournal("no line") AND NOT UO.InJournal("Elemental") AND NOT Timer>=600
Wait(500)
Timer=Timer+1
Wend
 
If UO.InJournal('Elemental') then
repeat
 
While NOT UO.Hidden()
UO.DeleteJournal()
UO.Exec('warmode 0')
UO.UseSkill('Stealth')
Repeat
Wait(100)
Until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') OR UO.Dead()
Wend
 
 
wait(1000)
uo.set("finddistance","22")
 
uo.ignorereset()
uo.findtype("0x0010","-1","ground")
 
UO.DeleteJournal()
 
until NOT uo.findcount()
 
UO.DeleteJournal()
EndIf
 
If UO.Weight>MaxWeight then
WalkN(0,0,UnloadBox)
Unload(UnloadBag)
WalkN(MyX,MyY,'')
Endif
Wend
Next
Next
Wend
end sub
 
sub Unload(UnloadBox)
VAR Exit,i
DIM Ore[4]
Ore[0]='0x19B7' ; 1 ore
Ore[1]='0x19BA' ; 2 ore
Ore[2]='0x19B8' ; 3 ore
Ore[3]='0x19B9' ; 4 and more ore
UO.SetReceivingContainer(UnloadBox)
ToHide()
For i=0 to 3
Exit=0
While Exit<>1
UO.FindType(Ore[i])
If UO.GetQuantity('finditem')>0 then
UO.Grab('all','finditem')
CheckLag()
Wait(1000)
Else
Exit=1
Endif
Wend
Next
UO.UnSetReceivingContainer()
end sub
 
sub ToHide()
While NOT UO.Hidden()
UO.DeleteJournal()
UO.Exec('warmode 0')
UO.UseSkill('Stealth')
Repeat
Wait(100)
Until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') OR UO.Dead()
Wend
end sub
 
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
Wait(50)
until UO.InJournal('backpack')
end sub
 
#=================================================   =============
# WalkN(X,Y,Serial) - char is walking by dX and dY step
# sub using Home, End, PgUp, PgDown keys
# d'not rebind this key from default action!
# serial - Serial of target or "" - string
# walkwait - delay after keypress
# Example:
# WalkN(2080,2113,'') - go to coordinates
# WalkN(0,0,'0x12345678') - go to target position
#--------------------------------------------------------------
sub WalkN(x,y,Target)
VAR i,StepSucess
VAR dx,dy,Exit=0
 
While Exit<>1
ToHide()
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
UO.Print("Target locked!")
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif
 
Endif
 
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
Endif
Endif
 
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
Endif
Endif
Endif
 
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
Endif
Endif
Endif
 
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
StepSucess=Go(5,37,300) ;SW - LeftArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
Endif
Endif
Endif
 
Endif
 
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,300) ;E - PgDown
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
Endif
StepSucess=Go(2,34,300) ;E - PgDown
Endif
Endif
 
If dx<0 Then
StepSucess=Go(6,36,300) ;W - Home
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
StepSucess=Go(6,36,300) ;W - Home
Endif
Endif
Endif
 
 
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,300) ;S - End
If StepSucess==-1 Then
StepSucess=Go(3,40,300) ;SE - DownArrow
If StepSucess==-1 Then
StepSucess=Go(5,37,300) ;SW - LeftArrow
Endif
StepSucess=Go(4,35,300) ;S - End
Endif
Endif
 
If dy<0 Then
StepSucess=Go(0,33,300) ;N - PgUp
If StepSucess==-1 Then
StepSucess=Go(1,39,300) ;NE - RightArrow
If StepSucess==-1 Then
StepSucess=Go(7,38,300) ;WN - UpArrow
Endif
StepSucess=Go(0,33,300) ;N - PgUp
Endif
Endif
Endif
Wend
end sub
 
 
sub Go(dir,key,walkwait)
VAR x,y, OldDir
 
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
 
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
 
UO.Press(key)
wait(walkwait)
 
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
 
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
UO.Press(key)
wait(walkwait)
Endif
 
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
 
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Zasada!")
return -1
Else
return 1
Endif
end sub
 
 
#=================================================   =============
# Healing() - memoryzed current weapon, bandageself, armed
#--------------------------------------------------------------
sub Healing()
UO.SetArm('CWeapon')
UO.Exec("bandageself")
wait(500)
UO.Arm('CWeapon')
end sub
 
#=================================================   =============
# Recconector
#--------------------------------------------------------------
sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (UO.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(20000) # WorldSave Protection
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.Exec('terminate all')
;UO.Exec('exec autoload')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
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
EndIf
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
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub
Savage
Expert!
Posts: 1205
Joined: 2004-04-04 11:13:54
Location: Балаково, Саратовская обл.
Contact:

Post by Savage »

Интересно, на кой пихать в скрипт реконектор, если он не юзается?
Sergant
Posts: 25
Joined: 2004-08-04 08:04:14
Contact:

Post by Sergant »

если на ночь оставляешь.. то запускаешь вместе мининг и рекон.. все намана
Oleg
Posts: 1
Joined: 2005-02-01 13:14:31
Contact:

Post by Oleg »

Вот ещё кто нибудь объяснил как этим пользоваться и к какому шарду скрипт...Потому как я слышал на каждый шард свои заморочки...Помогите плиз все это в действиие привести...
Пи.Си. Играю на нове(www.nova-uo.com)на всякий случай случай сказал:-)
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Нова это АОС...а тут в основном скрипты под Сферы.
Все просто.
BETEPAH ™
Post Reply