Yoko http://forum.yoko.com.ua/ |
|
Что не так ? http://forum.yoko.com.ua/viewtopic.php?f=17&t=14845 |
Page 1 of 1 |
Author: | xartok [ 2009-06-09 22:46:28 ] |
Post subject: | Что не так ? |
помогите что не так в скрипте ? вылетает ошыбка 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 |
Author: | Mirage [ 2009-06-10 08:39:23 ] |
Post subject: | |
как я уже написал у тебя ошибки в sub GotoXY(x,y) . Возьми с какогонибудь другово скрипта. А хайд вставляй в теле скрипта а не в ходилке. |
Author: | xartok [ 2009-06-10 09:51:42 ] |
Post subject: | |
спасибо я уже во всём сам разобрался всё прекрасно работает ! проста поменял ходилку ![]() |
Page 1 of 1 | All times are UTC+02:00 |
Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |