Мааааленькая да удаленькая проблема

Anything and all.

Moderators: Murderator+, Murderator

Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Мааааленькая да удаленькая проблема

Post by Demos »

Вот скрипт

sub main()
######################################
# Antares / auo.ru
######################################
# в банке должны быть руны в пещеры, помеченные в инжекте как обьекты
# (Закладка Objects !!!! не путать c Object type)
# Mine , Mine1, Mine2, Mine3, Mine4, а в бекпаке обьект Bank - руна к банку
# промаркировать каждую пещеру надо зарание, запустив процедуру MultyMark()
# Для марка, обходя последовательно все точки копания набирать "set"
# (точка копания - центр квадрата 5х5 тайлов, который выкапывается подчистую)
# При окончании марка в текущей пещере набрать "stop" перереколиться в следующюю пещеру и продолжить
# После марка 5 пещер появятся файлы C:\mine4.dat, C:\mine3.dat, C:\mine2.dat, C:\mine1.dat, C:\mine.dat
# После этого можно начинать копку запустив процедуру main() стоя у банка.
# И если в банке будут лежать жаренные фишстеки, чар не применет возможностью ими полакомиться.
# при вероятности дисконнектов перед копкой запускать процедуру Reconnect

################################
var Cont = '0x4081D54D' ;ID контейнера в который будет складываться накопанное.
var RC = '0x4081D54C' ;ID контейнера с регами
var food= '0x097B' ;еда(type) по умолчанию жаренные фишстейки
var q, w, p
var f=file("C:\mine.dat")
;var f , mine
var mine

############################### процедура запуска для 5 пещер

# количество пещер может быть уменьшено или увеличено
# удалением или внесением троестрочий вида:
# f=file("C:\mine1.dat")
# mine='Mine1'
# one()

sub main()
repeat

f=file("C:\mine.dat")
mine='Mine'
one()

f=file("C:\mine1.dat")
mine='Mine1'
one()

f=file("C:\mine2.dat")
mine='Mine2'
one()

f=file("C:\mine3.dat")
mine='Mine3'
one()

f=file("C:\mine4.dat")
mine='Mine4'
one()

until UO.Dead()
end sub
################################
sub one()
dim PX[50], PY[50]
var Minepoints=0
var i

uo.Print('Loading from file...')
f.open()
Minepoints=safe call f.ReadNumber()
for i=1 to Minepoints
PX[i]=safe call f.ReadNumber()
PY[i]=safe call f.ReadNumber()
next
f.close()
uo.Print('Loaded')
uo.say("Bank")
wait(100)
med()
takereg()
Recall(mine) !!!!!!!!!!!!!!!!!!!!!!!!!!ВОТ ОШИБКА!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
for p=1 to Minepoints
uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))
WalkN(PX[p],PY[p],'')
q=PX[p]
w=PY[p]
uo.Print('Mining...')
UO.Warmode("0")
mine(PX,PY)
next
recall('Bank')
Razg()
end sub
##########################
sub vozvrat(PX,PY)
var i
uo.Print('Move...')
for i=1 to p
uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))
WalkN(PX[i],PY[i],'')
next
end sub
########################
sub Mark()
dim PX[50], PY[50]
var Minepoints=0
var i
uo.Print('Start marking...')
for i=1 to 50
UO.DeleteJournal()
uo.Print('Set point '+ str(i))
repeat
wait(500)
if UO.InJournal('stop')then
SaveToFile(i-1,PX,PY)
return
endif
until UO.InJournal('set')
PX[i] = UO.GetX("self")
PY[i] = UO.GetY("self")
uo.Print('Point '+str(i)+' X: '+str(PX[i])+' Y: '+str(PY[i])+'taken')
next
end sub
########################
sub MultyMark()
uo.Print('Cove............ 1')
f=file("C:\mine.dat")
Mark()
uo.Print('Cove............ 2')
f=file("C:\mine1.dat")
Mark()
uo.Print('Cove............ 3')
f=file("C:\mine2.dat")
Mark()
uo.Print('Cove............ 4')
f=file("C:\mine3.dat")
Mark()
uo.Print('Cove............ 5')
f=file("C:\mine4.dat")
Mark()
uo.Print('Marking finished. Ready for mine')
end sub
#############################
sub SaveToFile(mp,PX,PY)
var s=0,k=0
f.open()
f.create()
uo.Print('points = '+ str(mp))
s=safe call f.writeln(mp)
for k=1 to mp
s=safe call f.writeln(str(PX[k])+' '+str(PY[k]))
next
f.close()
end sub
##################################
sub mine(PX,PY)
var x,y,z
VAR LastTimer
UO.Set('finddistance','2')
z=UO.GetZ("self")
for x=-2 to 2
for y=-2 to 2
Hid()
UO.Print(str(x)+" "+str(y))
Repeat
if UO.InJournal('TORMOZ') then
pause()
endif
UO.DeleteJournal()
UO.Warmode("0")
UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),str(z))
UO.UseType('0x0E85')
LastTimer=UO.Timer()
Repeat
wait(500)
;check()
Until UO.InJournal("You put") or UO.InJournal("can't see") or UO.InJournal("heavy") or UO.InJournal("location") or UO.InJournal("no ore") or UO.InJournal("but fail") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("must wait") or UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("where it") OR UO.Timer()>LastTimer+200
lookout()
Until UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("no ore here") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("where it")
if UO.Weight>720 then
unload(PX,PY)
endif
;wait(2000) ; раскоментировать при копке лопатой
next
next
end sub
#########################################
sub lookout()
if UO.InJournal("Earth elemental") then
killelem()
endif
end sub
#######################################
sub check()
var noto, ser, jor
for jor = 0 to 9
ser = uo.journalserial(jor)
UO.Print(ser)
uo.Print(str(uo.IsNPC("ser")))
if not UO.IsNPC('ser') and not uo.injournal("elemental") and ser <> '0x00000000' then
if uo.waiting() then
uo.canceltarget()
endif
UO.DeleteJournal()
UO.Print('PK')
UO.Print(ser)
recall('Bank')
Razg()
wait(180000)
return
endif

next
end sub
#######################################
sub Pause()
UO.DeleteJournal()
REPEAT
WAIT(3000)
UO.Print("Paused")
UNTIL UO.InJournal('GO')
UO.Print("Continue")
endif
end sub
############################################
sub heal()
UO.SetArm('arm')
UO.Exec('bandageself')
wait(500)
UO.Arm('arm')
wait(2000)
end sub
######################################
sub Razg()
VAR a
VAR LastTimer
DIM Ore[9]
Ore[1]=0x19B9 ; 4 and more ore
Ore[2]=0x19B7 ; 1 ore
Ore[3]=0x19BA ; 2 ore
Ore[4]=0x19B8 ; 3 ore
Ore[5]=0x0EED # деньги
Ore[6]=0x09AA # пандоры
Ore[7]=0x19B9 # руда
Ore[8]=0x0F26 # диаманты
Ore[9]=0x0F8A # pig iron

uo.say("Bank")
wait(100)
For a=1 to 9
While UO.Count(ore[a])>0
UO.FindType(ore[a],-1,-1)
UO.MoveItem('finditem',0,Cont)
wait(1000)
Wend
next
eat()
takereg()
if UO.Mana < 30 then
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
endif
end sub
#######################################
sub eat()
UO.DeleteJournal()
repeat
if UO.Count(food)>0 then
UO.UseType(food)
wait(500)
else
return
end if
Until UO.InJournal("stuffed!") OR UO.InJournal("think")
end sub
################################
sub unload(PX,PY)
Recall('Bank')
Razg()
wait(100)
takereg()
wait(100)
Recall(mine)
uo.DeleteJournal()
vozvrat(PX,PY)
end sub
########################################
sub med()
VAR LastTimer
UO.DeleteJournal()
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
end sub
#########################################
sub takereg()
DIM reg[3]
var i,n
reg[1]='0x0F86' ; MR
reg[2]='0x0F7A' ; BP
reg[3]='0x0F7B' ; BM

UO.UseObject(RC)
for i=1 to 3
while UO.Count(reg[i])<5
UO.FindType(reg[i],-1,RC)
n=UO.Count(reg[i])
UO.Grab(str(5-n),'finditem')
wait(1000)
wend
next
end sub
#########################################
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('Backpack')
end sub
######################################
sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime='0'
rFlag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rFlag then
ReconnectTime=MakeTime()
rFlag=0
end if
wait(20000)
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.TextOpen()
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
rFlag=1
ReconnectTime='0'
end if
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
####################################
sub Hid()
while not uo.Hidden()
uo.exec('warmode 0')
uo.Print('Hiding...')
uo.UseSkill('Hiding')
wait(4000)
wend
wait(100)
end sub
#################################
sub Recall(dest)
var b
uo.print('Recoll')
for b=1 to 10
uo.deletejournal()
uo.waittargetobject(dest)
uo.cast('Recall',dest)
if WaitForRecall()==1 then
return 1
end if
next
return 0
end sub
###################################
sub WaitForRecall()
var Text1=uo.getname()+": The spell fizzles."
var mess='',lastX=uo.getX(),lastY=uo.getY()
for var v=0 to 200
mess=uo.journal(0)
if uo.Journal(0)==Text1 then
return 0
end if
if uo.getX()<>lastX OR uo.getY()<>LastY then
return 1
end if
wait(50)
next
return 0
end sub
################################
sub killelem()
VAR LastTimer, Elem ,i
LastTimer=UO.Timer()
UO.DeleteJournal()
UO.FindType('0x000E',-1,'ground')
Elem=UO.GetSerial('finditem')
UO.Exec('warmode 1')
UO.Attack(Elem)
WalkN(0,0,Elem)
UO.Say('Dye, mother fucker!')
repeat
wait(2000)
until UO.InJournal('Body') OR LastTimer+500<UO.Timer()
UO.Exec('warmode 0')
wait(100)
LastTimer=UO.Timer()
if UO.Life<170 and UO.Count('0x0E21') then
repeat
UO.BandageSelf()
wait(4000)
until UO.Life>170 OR LastTimer+300<UO.Timer()
endif
loot()
WalkN(q,w,'')
end sub
##################################
sub loot()
DIM R[4]
var a
R[1] = 0x0EED # деньги
R[2] = 0x09AA # пандоры
R[3] = 0x19B9 # руда
R[4] = 0x0F8A # pig iron

UO.UseObject('lastcorpse')
wait(100)
uo.exec("warmode '0'")
uo.waittargetobject('lastcorpse')
uo.usetype(0x0F51)
wait(500)

for a=1 to 4
uo.findtype(R[a],"-1","lastcorpse")
if UO.FindCount()>0 and Uo.GetDistance("lastcorpse")<=2 then
UO.Grab("0","finditem")
wait(1000)
end if
wait(10)
next
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
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()
hid()
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
###########################################
end sub

###########################################
###########################################
###########################################
###########################################

А проблема собственно вот какая :
когда все выставил в обжект ( кароче все настроил как надо )
нажимаю запуститть у меня выдает ошибку ! Я её пометил

Line 78 Variable undefined -MINE

как избавиться от этой проблемы ?

версия ддлки 4DZ
joker_psix
Posts: 53
Joined: 2004-10-09 18:48:36

Post by joker_psix »

ты читать умееш ? =)


Code: Select all

###################################### 
# Antares / auo.ru
######################################
# в банке должны быть руны в пещеры, помеченные в инжекте как обьекты
# (Закладка Objects !!!! не путать c Object type)
# Mine , Mine1, Mine2, Mine3, Mine4, а в бекпаке обьект Bank - руна к банку
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

у меня выставлены они все в обжектах!


Люди помогитеее :(
joker_psix
Posts: 53
Joined: 2004-10-09 18:48:36

Post by joker_psix »

попробуй вот так

Code: Select all

###################################### 
# Antares / auo.ru
######################################
# в банке должны быть руны в пещеры, помеченные в инжекте как обьекты
# (Закладка Objects !!!! не путать c Object type)
# Mine , Mine1, Mine2, Mine3, Mine4, а в бекпаке обьект Bank - руна к банку
# промаркировать каждую пещеру надо зарание, запустив процедуру MultyMark()
# Для марка, обходя последовательно все точки копания набирать "set"
# (точка копания - центр квадрата 5х5 тайлов, который выкапывается подчистую)
# При окончании марка в текущей пещере набрать "stop" перереколиться в следующюю пещеру и продолжить
# После марка 5 пещер появятся файлы C:\mine4.dat, C:\mine3.dat, C:\mine2.dat, C:\mine1.dat, C:\mine.dat
# После этого можно начинать копку запустив процедуру main() стоя у банка.
# И если в банке будут лежать жаренные фишстеки, чар не применет возможностью ими полакомиться.
# при вероятности дисконнектов перед копкой запускать процедуру Reconnect

################################
var Cont = '0x4081D54D' ;ID контейнера в который будет складываться накопанное.
var RC = '0x4081D54C' ;ID контейнера с регами
var food= '0x097B' ;еда(type) по умолчанию жаренные фишстейки
var q, w, p
var f=file("C:\mine.dat")
var mine

############################### процедура запуска для 5 пещер

# количество пещер может быть уменьшено или увеличено
# удалением или внесением троестрочий вида:
# f=file("C:\mine1.dat")
# mine='Mine1'
# one()

sub main()
repeat

f=file("C:\mine.dat")
mine="Mine"
one()

f=file("C:\mine1.dat")
mine="Mine1"
one()

f=file("C:\mine2.dat")
mine='Mine2'
one()

f=file("C:\mine3.dat")
mine='Mine3'
one()

f=file("C:\mine4.dat")
mine='Mine4'
one()

until UO.Dead()
end sub
################################
sub one()
dim PX[50], PY[50]
var Minepoints=0
var i

uo.Print('Loading from file...')
f.open()
Minepoints=safe call f.ReadNumber()
for i=1 to Minepoints
PX[i]=safe call f.ReadNumber()
PY[i]=safe call f.ReadNumber()
next
f.close()
uo.Print('Loaded')
uo.say("Bank")
wait(100)
med()
takereg()
Recall('mine')
for p=1 to Minepoints
uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))
WalkN(PX[p],PY[p],'')
q=PX[p]
w=PY[p]
uo.Print('Mining...')
UO.Warmode("0")
mine(PX,PY)
next
recall('Bank')
Razg()
end sub
##########################
sub vozvrat(PX,PY)
var i
uo.Print('Move...')
for i=1 to p
uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))
WalkN(PX[i],PY[i],'')
next
end sub
########################
sub Mark()
dim PX[50], PY[50]
var Minepoints=0
var i
uo.Print('Start marking...')
for i=1 to 50
UO.DeleteJournal()
uo.Print('Set point '+ str(i))
repeat
wait(500)
if UO.InJournal('stop')then
SaveToFile(i-1,PX,PY)
return
endif
until UO.InJournal('set')
PX[i] = UO.GetX("self")
PY[i] = UO.GetY("self")
uo.Print('Point '+str(i)+' X: '+str(PX[i])+' Y: '+str(PY[i])+'taken')
next
end sub
########################
sub MultyMark()
uo.Print('Cove............ 1')
f=file("C:\mine.dat")
Mark()
uo.Print('Cove............ 2')
f=file("C:\mine1.dat")
Mark()
uo.Print('Cove............ 3')
f=file("C:\mine2.dat")
Mark()
uo.Print('Cove............ 4')
f=file("C:\mine3.dat")
Mark()
uo.Print('Cove............ 5')
f=file("C:\mine4.dat")
Mark()
uo.Print('Marking finished. Ready for mine')
end sub
#############################
sub SaveToFile(mp,PX,PY)
var s=0,k=0
f.open()
f.create()
uo.Print('points = '+ str(mp))
s=safe call f.writeln(mp)
for k=1 to mp
s=safe call f.writeln(str(PX[k])+' '+str(PY[k]))
next
f.close()
end sub
##################################
sub mine(PX,PY)
var x,y,z
VAR LastTimer
UO.Set('finddistance','2')
z=UO.GetZ("self")
for x=-2 to 2
for y=-2 to 2
Hid()
UO.Print(str(x)+" "+str(y))
Repeat
if UO.InJournal('TORMOZ') then
pause()
endif
UO.DeleteJournal()
UO.Warmode("0")
UO.WaitTargetTile("1341",STR(UO.GetX()+x),STR(UO.GetY()+Y),str(z))
UO.UseType('0x0E85')
LastTimer=UO.Timer()
Repeat
wait(500)
;check()
Until UO.InJournal("You put") or UO.InJournal("can't see") or UO.InJournal("heavy") or UO.InJournal("location") or UO.InJournal("no ore") or UO.InJournal("but fail") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("must wait") or UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("where it") OR UO.Timer()>LastTimer+200
lookout()
Until UO.InJournal("nothing") or UO.InJournal("elsewhere") or UO.InJournal("no ore here") or UO.InJournal("location") or UO.InJournal("far away") or UO.InJournal("in rock") or UO.InJournal("where it")
if UO.Weight>720 then
unload(PX,PY)
endif
;wait(2000) ; раскоментировать при копке лопатой
next
next
end sub
#########################################
sub lookout()
if UO.InJournal("Earth elemental") then
killelem()
endif
end sub
#######################################
sub check()
var noto, ser, jor
for jor = 0 to 9
ser = uo.journalserial(jor)
UO.Print(ser)
uo.Print(str(uo.IsNPC("ser")))
if not UO.IsNPC('ser') and not uo.injournal("elemental") and ser <> '0x00000000' then
if uo.waiting() then
uo.canceltarget()
endif
UO.DeleteJournal()
UO.Print('PK')
UO.Print(ser)
recall('Bank')
Razg()
wait(180000)
return
endif

next
end sub
#######################################
sub Pause()
UO.DeleteJournal()
REPEAT
WAIT(3000)
UO.Print("Paused")
UNTIL UO.InJournal('GO')
UO.Print("Continue")
endif
end sub
############################################
sub heal()
UO.SetArm('arm')
UO.Exec('bandageself')
wait(500)
UO.Arm('arm')
wait(2000)
end sub
######################################
sub Razg()
VAR a
VAR LastTimer
DIM Ore[9]
Ore[1]=0x19B9 ; 4 and more ore
Ore[2]=0x19B7 ; 1 ore
Ore[3]=0x19BA ; 2 ore
Ore[4]=0x19B8 ; 3 ore
Ore[5]=0x0EED # деньги
Ore[6]=0x09AA # пандоры
Ore[7]=0x19B9 # руда
Ore[8]=0x0F26 # диаманты
Ore[9]=0x0F8A # pig iron

uo.say("Bank")
wait(100)
For a=1 to 9
While UO.Count(ore[a])>0
UO.FindType(ore[a],-1,-1)
UO.MoveItem('finditem',0,Cont)
wait(1000)
Wend
next
eat()
takereg()
if UO.Mana < 30 then
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
endif
end sub
#######################################
sub eat()
UO.DeleteJournal()
repeat
if UO.Count(food)>0 then
UO.UseType(food)
wait(500)
else
return
end if
Until UO.InJournal("stuffed!") OR UO.InJournal("think")
end sub
################################
sub unload(PX,PY)
Recall('Bank')
Razg()
wait(100)
takereg()
wait(100)
Recall('mine')
uo.DeleteJournal()
vozvrat(PX,PY)
end sub
########################################
sub med()
VAR LastTimer
UO.DeleteJournal()
while UO.Mana<UO.Int
LastTimer=UO.Timer()
UO.UseSkill('Meditation')
repeat
wait(100)
until UO.InJournal("You are") OR UO.InJournal("You lose") OR UO.Timer()>LastTimer+200
UO.DeleteJournal()
wait(200)
wend
end sub
#########################################
sub takereg()
DIM reg[3]
var i,n
reg[1]='0x0F86' ; MR
reg[2]='0x0F7A' ; BP
reg[3]='0x0F7B' ; BM

UO.UseObject(RC)
for i=1 to 3
while UO.Count(reg[i])<5
UO.FindType(reg[i],-1,RC)
n=UO.Count(reg[i])
UO.Grab(str(5-n),'finditem')
wait(1000)
wend
next
end sub
#########################################
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('Backpack')
end sub
######################################
sub Reconnect()
var ReconnectTime,rFlag
ReconnectTime='0'
rFlag=1
repeat
while (uo.ObjAtLayer('Bpack')=='')
if rFlag then
ReconnectTime=MakeTime()
rFlag=0
end if
wait(20000)
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.TextOpen()
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
rFlag=1
ReconnectTime='0'
end if
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
####################################
sub Hid()
while not uo.Hidden()
uo.exec('warmode 0')
uo.Print('Hiding...')
uo.UseSkill('Hiding')
wait(4000)
wend
wait(100)
end sub
#################################
sub Recall(dest)
var b
uo.print('Recoll')
for b=1 to 10
uo.deletejournal()
uo.waittargetobject(dest)
uo.cast('Recall',dest)
if WaitForRecall()==1 then
return 1
end if
next
return 0
end sub
###################################
sub WaitForRecall()
var Text1=uo.getname()+": The spell fizzles."
var mess='',lastX=uo.getX(),lastY=uo.getY()
for var v=0 to 200
mess=uo.journal(0)
if uo.Journal(0)==Text1 then
return 0
end if
if uo.getX()<>lastX OR uo.getY()<>LastY then
return 1
end if
wait(50)
next
return 0
end sub
################################
sub killelem()
VAR LastTimer, Elem ,i
LastTimer=UO.Timer()
UO.DeleteJournal()
UO.FindType('0x000E',-1,'ground')
Elem=UO.GetSerial('finditem')
UO.Exec('warmode 1')
UO.Attack(Elem)
WalkN(0,0,Elem)
UO.Say('Dye, mother fucker!')
repeat
wait(2000)
until UO.InJournal('Body') OR LastTimer+500<UO.Timer()
UO.Exec('warmode 0')
wait(100)
LastTimer=UO.Timer()
if UO.Life<170 and UO.Count('0x0E21') then
repeat
UO.BandageSelf()
wait(4000)
until UO.Life>170 OR LastTimer+300<UO.Timer()
endif
loot()
WalkN(q,w,'')
end sub
##################################
sub loot()
DIM R[4]
var a
R[1] = 0x0EED # деньги
R[2] = 0x09AA # пандоры
R[3] = 0x19B9 # руда
R[4] = 0x0F8A # pig iron

UO.UseObject('lastcorpse')
wait(100)
uo.exec("warmode '0'")
uo.waittargetobject('lastcorpse')
uo.usetype(0x0F51)
wait(500)

for a=1 to 4
uo.findtype(R[a],"-1","lastcorpse")
if UO.FindCount()>0 and Uo.GetDistance("lastcorpse")<=2 then
UO.Grab("0","finditem")
wait(1000)
end if
wait(10)
next
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
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()
hid()
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
###########################################
end sub
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

Line 79 Variable undefined -P

блин чтоже это токое...
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

а которая из них 79? или мне пальцем по монитору водить?
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))

79 строка
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

ты об этом месте второго скрипта?

Code: Select all

Recall('mine') 
for p=1 to Minepoints
uo.Print('X: '+str(PX[p])+' Y: '+str(PY[p]))
WalkN(PX[p],PY[p],'')

если да то проверь значение Minepoints (первоая цифирка в файлике)
допустимые значения:
0 > Minepoints < 50
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

Все проверил в файле меньше записано меньше 50 тайлов все равно ошибка на этом же месте :(
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

Demos wrote:Все проверил в файле меньше записано меньше 50 тайлов все равно ошибка на этом же месте :(
я тебе сказал про 1ую цифру в файле. т.е. у тебя должна быть на 1ой строчке одна цифра которая ровна кол-ву последующих строчек.
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

да я так и сделал
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

Demos wrote:да я так и сделал
копирни сюда содержимое файла.
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

45
1340 1482 2838
1340 1482 2839
1340 1482 2840
1346 1482 2841
1361 1483 2841
1363 1483 2840
1346 1483 2839
1343 1483 2838
1361 1484 2839
1343 1484 2838
1343 1484 2837
1353 1484 2836
1343 1485 2836
1343 1485 2837
1344 1485 2838
1341 1486 2837
1341 1486 2836
1341 1486 2835
1355 1486 2834
1353 1486 2833
1359 1487 2833
1341 1487 2834
1341 1487 2835
1343 1487 2836
1341 1487 2837
1343 1488 2837
1343 1488 2836
1346 1489 2837
1343 1489 2836
1343 1489 2835
1343 1489 2834
1357 1489 2833
1359 1490 2833
1343 1490 2834
1343 1490 2835
1343 1490 2836
1344 1490 2837
1342 1491 2833
1341 1491 2834
1341 1491 2835
1347 1491 2836
1386 1491 2837
1356 1491 2838
1351 1491 2839
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

хех... проверь там у тебя Пэ ангийское или эР русское?
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

Ангийское....
BETEPAH
Expert!
Posts: 838
Joined: 2004-05-31 09:31:51
Contact:

Post by BETEPAH »

Line 79 Variable undefined -P

Я все понимаю но почему переменка Р с минусом ....)))
и вы уверены что она была обьявлена
Все просто.
BETEPAH ™
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

BETEPAH wrote:Line 79 Variable undefined -P

Я все понимаю но почему переменка Р с минусом ....)))
и вы уверены что она была обьявлена
да есть она в ,т.с., General.
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

а где поменять что сделать ?
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

BETEPAH wrote:Я все понимаю но почему переменка Р с минусом ....)))
это тире ;)
Demos
Posts: 28
Joined: 2004-11-29 12:11:02
Contact:

Post by Demos »

Люди неужели ни у кого не осталось в закромах скрипта ВЕТЕРАНа на ламбер под антарес ХНЫК-ХНЫК
Post Reply