в данном скрипте чар делает шаг наискосокк\вниз\лево,окапывается,затем топает вниз примерно 10 тайлов и при этом после шага окапывается,все ето он повторяет пока не упрется в ниж стену,а хотелось бы,чтоб он бродил хаотично и при натыкании на что-либо или кого-либо поворачивал куди нить и топал дальше пока не упрется....
как то был у меня такой скрипт,но после чистки компа(all) немогу его найти,или что либо на подобие....
вот скрипт что есть :
sub main()
go_mining()
end sub
sub go_mining()
var cycle=1
var path="6ik7ls9i2ik9l4lk9iik9l2lk9i7ik9l8lk9i9ik6lk7lk9i4ik9l3lk9i3ik9l3lk9i4ik7lk7ik6lk6ik4lk4ik3lk5ik2l7e2o9e6o"
var test=0
var i=0
var j
UO.DeleteJournal()
While i<LEN(path)
if VAL(path[i]) then
j=VAL(path[i])
i=i+1
else
j=1
endif
Repeat
if test<>1 then
UO.DeleteJournal()
mine_spot()
end if
UO.Print("New Location!")
if uo.stamina < 10 Then
uo.usetype('stamina')
end if
if not make_step(path[i]) then
endif
j=j-1
Until j==0
i = i + 1
if cycle && i==LEN(path) then
i=0
endif
Wend
end sub
sub mine_spot()
var maxMineTime=30000
var times=0
var timeout=0
While UO.InJournal("You stop")==0
UO.DeleteJournal()
UO.WaitTargetTile("1339",STR(UO.GetX()),STR(UO.GetY()),"0")
UO.UseType("0x0E85")
timeout=0
times = times +1
if times>20 then
wait(maxMineTime)
times = 0
endif
Repeat
timeout=timeout+200
Wait(200)
#UO.Print("Waiting...")
Until UO.InJournal("You put") OR UO.InJournal("You stop") OR timeout>maxMineTime
Wend
return 0
end sub
sub send_step(keycode,dir)
var x = UO.GetX()
var y = UO.GetY()
var timeout = 0
if UO.GetDir()<>dir then
UO.Press(keycode)
Repeat
wait(50)
Until UO.GetDir()==dir
endif
UO.Press(keycode)
Repeat
timeout=timeout+50
wait(50)
Until x<>UO.GetX() || y<>UO.GetY() || timeout>2000
if timeout>2000 then
return 0
endif
return 1
end sub
sub waitNewPos(x,y)
while x==UO.GetX() && y==UO.GetY()
if UO.InJournal("stop") then
return 0
endif
wend
return 1
end sub
sub compressPath(path)
Var i=0
Var j=0
Var newPath=""
while i<LEN(path)
j=1
while path[i]==path[i+1] AND j<9
i=i+1
j=j+1
wend
if j==1 then
newPath=newPath+path[i]
else
newPath=newPath+STR(j)+path[i]
endif
i=i+1
wend
return newPath
end sub
sub extract_dir(x,y,a,b)
if x>a then
if y==b then
return "i"
else
if y>b then
return "n"
else
return "w"
endif
endif
else
if x<a then
if y==b then
return "l"
else
if y>b then
return "e"
else
return "s"
endif
endif
else
if y>b then
return "o"
else
return "k"
endif
endif
endif
end sub
sub make_step(dir)
if dir=="e" then
send_step(39,1)
return 1
endif
if dir=="l" then
send_step(34,2)
return 1
endif
if dir=="s" then
send_step(40,3)
return 1
endif
if dir=="k" then
send_step(35,4)
return 1
endif
if dir=="w" then
send_step(37,5)
return 1
endif