Yoko

All sides of Injection
It is currently 2025-10-17 03:46:46

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Что не так ?
PostPosted: 2009-06-09 22:46:28 
Offline

Joined: 2009-06-09 22:40:24
Posts: 4
помогите что не так в скрипте ? вылетает ошыбка Line 207 Invalid number of arguments Gotoxy

var hatchet = "0x0F47"
Sub searchTree()
var i, x, y, t, max_distance = 24
for i = 1 to -1
wait(2)
for x = -i to i
wait(2)
for y = -i to i
wait(2)
if NOT uo.getGlobal( 't:' + str( uo.getX() + x ) + "," + str( uo.getY() + y ) ) == "empty" then
t = IsTreeTile( uo.getX() + x, uo.getY() + y )
if not t == false then
uo.setGlobal( "tree_x", str( uo.getX() + x ) )
uo.setGlobal( "tree_y", str( uo.getY() + y ) )
uo.setGlobal( "tree_t", str( t ) )
x = i
y = i
i = -1
endif
endif
next
next
if i == max_distance then
i = -1
endif
next
endsub

sub autoLumber()
searchTree()
doMineTree()
endsub


Sub doMineTree()
var x, y, t , ss=0
var end = "appears immune|nothing here|reach this|here to chop|You have no"
#var try = "You put|fail"
repeat
x = val( uo.getGlobal( "tree_x" ) )
y = val( uo.getGlobal( "tree_y" ) )
t = val( uo.getGlobal( "tree_t" ) )
uo.setGlobal( 't:' + str( x ) + "," + str( y ), "empty" )
uo.exec( "exec searchTree" )
gotoxy( x, y )
uo.deletejournal()


if uo.waiting() then
uo.canceltarget()
endif


uo.waittargettile( str( t ), str( x ), str( y ), str( uo.getZ() ) )
uo.usetype( hatchet )
ss=0
repeat
if uo.gethp()<uo.str then
uo.warmode(1)
wait(100)
uo.usetype(0x1B77)
wait(100)
uo.usetype(0x1440)
wait(20000)
end if
ss=ss+1
wait( 100 )
until uo.injournal( end ) or ss>300



while uo.getGlobal( "tree_x" ) == str( x ) && uo.getGlobal( "tree_y" ) == str( y )
wait( 100 )
wend
until false
endsub



Sub IsTreeTile( x, y )
var i, tree_count = 20
DIM tree[ val( str( tree_count ) ) ]
tree[0] = 3274
tree[1] = 3275
tree[2] = 3276
tree[3] = 3277
tree[4] = 3280
tree[5] = 3283
tree[6] = 3286
tree[7] = 3289
tree[8] = 3291
tree[9] = 3292
tree[10] = 3294
tree[11] = 3295
tree[12] = 3296
tree[13] = 3299
tree[14] = 3302
tree[15] = 3394
tree[16] = 3395
tree[17] = 3417
tree[18] = 3440
tree[19] = 3461
for i = 0 to tree_count -1
if uo.privategettile( x, y, -1, tree, tree ) then
return tree
endif
next
return false
endsub
########################################## OIAEEEA 3 ##########################


sub GotoXY(x,y)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.getX();
myY=uo.getY();
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
If not uo.Hidden() then
ToHide()
else
for z=0 to 8
uo.Press(40)
end if
next
end if
if uo.GetDir()==3 then
If not uo.Hidden() then
ToHide()
else
for z=0 to 8
uo.Press(37)
end if
next
end if
if uo.GetDir()==5 then
If not uo.Hidden() then
ToHide()
else
for z=0 to 8
uo.Press(38)
end if
next
end if
if uo.GetDir()==7 then
If not uo.Hidden() then
ToHide()
else
for z=0 to 8
uo.Press(39)
end if
next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
end if
if x<=myX then
if y<=myY then
If not uo.Hidden() then
ToHide()
else
for z=0 to 3
uo.Press(38)
end if
next
else
If not uo.Hidden() then
ToHide()
else
for z=0 to 3
uo.Press(37)
end if
next
end if
else
if y<=myY then
If not uo.Hidden() then
ToHide()
else
for z=0 to 3
uo.Press(39)
end if
next
else
If not uo.Hidden() then
ToHide()
else
for z=0 to 3
uo.Press(40)
end if
next
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub


Top
   
 Post subject:
PostPosted: 2009-06-10 08:39:23 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
как я уже написал у тебя ошибки в sub GotoXY(x,y) . Возьми с какогонибудь другово скрипта. А хайд вставляй в теле скрипта а не в ходилке.


Top
   
 Post subject:
PostPosted: 2009-06-10 09:51:42 
Offline

Joined: 2009-06-09 22:40:24
Posts: 4
спасибо я уже во всём сам разобрался всё прекрасно работает ! проста поменял ходилку :)


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Limited