Page 1 of 1

Forgotten World lumberjacking

Posted: 2007-11-19 12:14:59
by Mazer
Everything i want its only script to find tree wich is near and chop it untill end.. the + is if the character run to other tree but its not so important :)
thanks you if some one have it.

Posted: 2007-11-19 15:13:44
by Destruction
viewtopic.php?t=12382&start=0

It can helps you, if i correctly understand..

Posted: 2007-11-19 16:00:19
by Mazer
i hope so. i`l try that later ant write here :) thanks ;)

Posted: 2007-11-19 16:22:20
by Mazer
That dont works 132 line error

Posted: 2007-11-20 03:49:34
by Destruction
This script have only 101 lines...

Whats you have near line 132 ?

Posted: 2007-11-20 09:25:39
by Mazer
Lol im sorry :) you know i posted my Autoload line :D not script ;) so
the problem is in Line 10 : Function not found - ABS

this script :

Code: Select all

#Lumbjacking ? ??????????? ??????? (c) Destruction, v1.0
var hatchet = "0x0F43"
Sub searchTree()
   var i, x, y, t, stp, max_search = 24 ; ???????????? ????????? ??? ????????? ?????????.
   var cx = uo.getX()
   var cy = uo.getY()
   for i = 1 to max_search
      for x =-i to i
         stp = 1
         if not i == abs( x ) then
            stp = abs( i ) * 2
         endif
         for y = -i to i step stp
            if NOT uo.getGlobal( 't:' + str( x + cx ) + "," + str( y + cy ) ) == "empty" then
               t = IsTreeTile( x + cx, y + cy )
               if not t == false then
                  uo.setGlobal( "tree_x", str( x + cx ) )
                  uo.setGlobal( "tree_y", str( x + cy ) )
                  uo.setGlobal( "tree_t", str( t ) )
                  return false
               else
                  uo.setGlobal( 't:' + str( x + cx ) + "," + str( y + cy ), 'empty' )
               endif
            endif
         next
      next
   next
   uo.print( "Found no tree, exit." )
   uo.exec( "terminate autoLumber" )
   return false
endsub

sub autoLumber()
   searchTree()
   doMineTree()
endsub

Sub doMineTree()
   var x, y, t
   var end = "appears immune|nothing here|reach this"
   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" )
      Walker( x, y, 1 )
      uo.exec( "exec searchTree" )
      repeat
         if uo.waiting() then
            uo.canceltarget()
         endif
         deljournal( try + "|" + end )
         uo.waittargettile( str( t ), str( x ), str( y ), str( uo.getZ() ) )
         uo.usetype( hatchet )
         repeat
            wait( 100 )
         until uo.injournal( try + "|" + end )
      until uo.injournal( end )
      while uo.getGlobal( "tree_x" ) == str( x ) && uo.getGlobal( "tree_y" ) == str( y )
         wait( 100 )
      wend
   until false
endsub

Sub deljournal( msg )
   while uo.injournal( msg )
      uo.setjournalline( uo.injournal( msg ) -1, '' )
   wend
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[i], tree[i] ) then
         return tree[i]
      endif
   next
   return false
endsub



you help me ? :)

Posted: 2007-11-20 09:41:05
by Destruction
Oh my god...

U need walker script, as minimum..

viewtopic.php?p=66813#66813 - try to copy this script too and all will be good.

Posted: 2007-11-20 10:48:57
by Mazer
Destruction im so thankfull for you :) thats the best scrip :) ant the only one thing i need :) is Antimacro systen :) i hope Grin will help me :D