Advertisement
Guest User

LumberJack Omega EasyUO

a guest
May 4th, 2019
1,955
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set %currentTree 0
  2. set %treeCount 0
  3. set %currentX 0
  4. set %currentY 0
  5. set %autoloop 8
  6. set %waitTime 77s
  7.  
  8. msg .autoloop %autoloop $
  9.  
  10. sub scanTiles
  11.     set #LPC 1000
  12.     set %range 15
  13.     tile init noOverrides
  14.     set %minX #charPosX - %range
  15.     set %maxX #charPosX + %range
  16.     set %minY #charPosY - %range
  17.     set %maxY #charPosY + %range
  18.     set %usedTree #false
  19.     for %x %minX %maxX
  20.     {
  21.         for %y %minY %maxY
  22.         {
  23.             tile cnt %x %y
  24.             for %i 1 #tileCnt
  25.             {
  26.                 tile get %x %y %i
  27.                 if TREE in #tileName
  28.                 {
  29.                     set % , tx , %spot %x
  30.                     set % , ty , %spot %y
  31.                     set % , tz , %spot #tileZ
  32.                     set % , tt , %spot #tileType
  33.                     set %spot %spot + 1
  34.                     set %treeX . %treeCount %x
  35.                     set %treeY . %treeCount %y
  36.                     set %treeCount ( %treeCount + 1 )
  37.                 }
  38.             }
  39.         }
  40.   }
  41.   msg Found %treeCount trees! $
  42.   gosub walkToTree
  43. return
  44.  
  45. sub walkToTree
  46.     set #LPC 10
  47.     msg Walk! $
  48.     msg Tree %currentTree of %treeCount $
  49.     set %currentX ( %treeX . %currentTree )
  50.     set %currentY ( %treeY . %currentTree )
  51.     msg %currentX : %currentY $
  52.     if %currentTree = ( %treeCount - 1 ) {
  53.        set %currentTree 0
  54.     }
  55.     if %currentTree = 0
  56.     {
  57.         move %currentX %currentY 0 10s
  58.     }
  59.     else
  60.     {
  61.         move %currentX %currentY 0 5s
  62.     }
  63.     gosub lumber
  64. return
  65.  
  66. sub lumber
  67.     msg Timber! $
  68.     finditem WUDMURD
  69.     set %SHOVEL #FINDID
  70.     set #LOBJECTID %SHOVEL
  71.     event macro 17
  72.     wait 15
  73.     Tile Get %currentX %currentY 2
  74.     set #lTargetTile #tileType
  75.     set #lTargetX %currentX
  76.     set #lTargetY %currentY
  77.     set #lTargetKind 3
  78.     wait 10
  79.     event macro 22
  80.     wait %waitTime
  81.     set %currentTree ( %currentTree + 1 )
  82.     gosub walkToTree
  83. return
  84.  
  85. gosub scanTiles
Advertisement
RAW Paste Data Copied
Advertisement