Yoko

All sides of Injection
It is currently 2026-01-19 08:27:28

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 2007-11-19 12:14:59 
Offline

Joined: 2007-11-13 00:39:14
Posts: 125
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.


Top
   
 Post subject:
PostPosted: 2007-11-19 15:13:44 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
viewtopic.php?t=12382&start=0

It can helps you, if i correctly understand..

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-11-19 16:00:19 
Offline

Joined: 2007-11-13 00:39:14
Posts: 125
i hope so. i`l try that later ant write here :) thanks ;)


Top
   
 Post subject:
PostPosted: 2007-11-19 16:22:20 
Offline

Joined: 2007-11-13 00:39:14
Posts: 125
That dont works 132 line error


Top
   
 Post subject:
PostPosted: 2007-11-20 03:49:34 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
This script have only 101 lines...

Whats you have near line 132 ?

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-11-20 09:25:39 
Offline

Joined: 2007-11-13 00:39:14
Posts: 125
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:
#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 ? :)


Top
   
 Post subject:
PostPosted: 2007-11-20 09:41:05 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
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.

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-11-20 10:48:57 
Offline

Joined: 2007-11-13 00:39:14
Posts: 125
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


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited