Yoko

All sides of Injection
It is currently 2025-12-27 20:26:22

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2005-06-15 01:47:22 
Offline
User avatar

Joined: 2004-04-28 03:38:17
Posts: 23
Господа срочно нужна ваша помощь аборигенам с Zulu , у нас катастрофа - не рубятся пальмы :)

Чар находится в пространстве в 2ве клетки которые со всех сторон окружены банановыми деревьями и там рубит , при запуске скрипта с любым значением радиуса чар просто куда то хочет убежать , но уж точно не рубить.

Буду безгранично признателен за любую помощь или совет .

Code:
sub main()
lumberjack(5) # В склбках указать радиус деревьев
end sub
sub lumberjack(distance)
var this_tree, treenum=0, tree_num,x,y, hatchet
dim tree[4]
tree[0]="0x0DA6" # - pear tree
tree[1]="0x0D9E" # - peach tree
tree[2]="0x0CAA" # - banana tree
tree[3]="0x0D9A" # - apple tree
hatchet="0x0f49" # Тип топора
uo.disarm()
uo.ignorereset()
uo.set("finddistance",str(distance))
repeat
tree_num=0
repeat
uo.findtype(tree[tree_num],"-1","ground")
this_tree=uo.getserial("finditem")
tree_num=tree_num+1
until tree_num>3 or this_tree<>"0x00000000"
if this_tree<>"0x00000000" then
treenum=treenum+1
uo.waittargetobject(this_tree)
uo.addobject("tree"+str(treenum))
uo.ignore(this_tree)
endif
until this_tree=="0x00000000"
uo.ignorereset()
while not uo.dead()
for tree_num=1 to treenum
if uo.dead() then
return
endif
this_tree=uo.getserial("tree"+str(tree_num))
go_to(this_tree)
uo.deletejournal()
uo.waittargetobject(this_tree)
uo.usetype(hatchet)
repeat
wait(100)
until uo.injournal("away") or uo.injournal("stop lumberjacking.")
next
wend
end sub
sub go_to(what)
var x,y,dist_x,dist_y,dx,dy
repeat
dist_x=uo.getx()-uo.getx(what)
dist_y=uo.gety()-uo.gety(what)
dx=35+sign(dist_x)
dy=34-sign(dist_y)
x=uo.getx()
y=uo.gety()
if abs(dist_x)>2 then
uo.press(dx)
uo.press(dx)
endif
if abs(dist_y)>2 then
uo.press(dy)
uo.press(dy)
endif
if abs(dist_x)==abs(dist_y) and abs(dist_y)>2 then
if dx==36 and dy==33 then
uo.press(38)
uo.press(38)
endif
if dx==36 and dy==35 then
uo.press(37)
uo.press(37)
endif
if dx==34 and dy==33 then
uo.press(39)
uo.press(39)
endif
if dx==34 and dy==35 then
uo.press(40)
uo.press(40)
endif
endif
until abs(dist_x)<=2 and abs(dist_y)<=2
end sub
sub abs(x)
var y
if x<0 then
y=-x
else
y=x
endif
return y
end sub
sub sign(what)
var ret
if what<0 then
ret=-1
else
ret=1
endif
return ret
end sub
sub grabs()
var what
repeat
uo.findtype("0x0E76","-1","ground")
what=uo.getserial("finditem")
if what<>"0x00000000" then
uo.waittargetobject(what)
uo.grab()
uo.ignore(what)
endif
until what=='0x00000000'
end sub

_________________
noob must die.


Last edited by PAIN^j18.9 on 2005-06-15 04:13:58, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2005-06-15 01:56:56 
Offline
User avatar

Joined: 2004-04-28 03:38:17
Posts: 23
Забыл сказать что в клиенте стоит функция автолуп - один раз указав на дерево он будет рубить его пока там не кончатся логи.

_________________
noob must die.


Top
   
 Post subject:
PostPosted: 2005-06-15 07:03:14 
Offline
User avatar

Joined: 2005-05-21 07:12:12
Posts: 163
Location: DRW
А ошибку скрипт не выдает? А то не мешало бы в начале присвоить tree_num значение 0.


Top
   
PostPosted: 2005-06-18 20:36:13 
Offline

Joined: 2004-09-08 13:09:13
Posts: 127
PAIN^j18.9 wrote:
Господа срочно нужна ваша помощь аборигенам с Zulu , у нас катастрофа - не рубятся пальмы :)

Чар находится в пространстве в 2ве клетки которые со всех сторон окружены банановыми деревьями и там рубит , при запуске скрипта с любым значением радиуса чар просто куда то хочет убежать , но уж точно не рубить.

Буду безгранично признателен за любую помощь или совет .

Code:
sub main()
lumberjack(5) # В склбках указать радиус деревьев
end sub
sub lumberjack(distance)
var this_tree, treenum=0, tree_num,x,y, hatchet
dim tree[4]
tree[0]="0x0DA6" # - pear tree
tree[1]="0x0D9E" # - peach tree
tree[2]="0x0CAA" # - banana tree
tree[3]="0x0D9A" # - apple tree
hatchet="0x0f49" # Тип топора
uo.disarm()
uo.ignorereset()
uo.set("finddistance",str(distance))
repeat
tree_num=0
repeat
uo.findtype(tree[tree_num],"-1","ground")
this_tree=uo.getserial("finditem")
tree_num=tree_num+1
until tree_num>3 or this_tree<>"0x00000000"
if this_tree<>"0x00000000" then
treenum=treenum+1
uo.waittargetobject(this_tree)
uo.addobject("tree"+str(treenum))
uo.ignore(this_tree)
endif
until this_tree=="0x00000000"
uo.ignorereset()
while not uo.dead()
for tree_num=1 to treenum
if uo.dead() then
return
endif
this_tree=uo.getserial("tree"+str(tree_num))
go_to(this_tree)
uo.deletejournal()
uo.waittargetobject(this_tree)
uo.usetype(hatchet)
repeat
wait(100)
until uo.injournal("away") or uo.injournal("stop lumberjacking.")
next
wend
end sub
sub go_to(what)
var x,y,dist_x,dist_y,dx,dy
repeat
dist_x=uo.getx()-uo.getx(what)
dist_y=uo.gety()-uo.gety(what)
dx=35+sign(dist_x)
dy=34-sign(dist_y)
x=uo.getx()
y=uo.gety()
if abs(dist_x)>2 then
uo.press(dx)
uo.press(dx)
endif
if abs(dist_y)>2 then
uo.press(dy)
uo.press(dy)
endif
if abs(dist_x)==abs(dist_y) and abs(dist_y)>2 then
if dx==36 and dy==33 then
uo.press(38)
uo.press(38)
endif
if dx==36 and dy==35 then
uo.press(37)
uo.press(37)
endif
if dx==34 and dy==33 then
uo.press(39)
uo.press(39)
endif
if dx==34 and dy==35 then
uo.press(40)
uo.press(40)
endif
endif
until abs(dist_x)<=2 and abs(dist_y)<=2
end sub
sub abs(x)
var y
if x<0 then
y=-x
else
y=x
endif
return y
end sub
sub sign(what)
var ret
if what<0 then
ret=-1
else
ret=1
endif
return ret
end sub
sub grabs()
var what
repeat
uo.findtype("0x0E76","-1","ground")
what=uo.getserial("finditem")
if what<>"0x00000000" then
uo.waittargetobject(what)
uo.grab()
uo.ignore(what)
endif
until what=='0x00000000'
end sub


Скриптик конечно левенький :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited