Advertisement
Andrakon

FIXED: nO_OnE's Treefarm w/ refueling from warfar

Feb 25th, 2013
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.44 KB | None | 0 0
  1. -- Lua script by nO_OnE
  2. -- Edited by Phyrax to add refueling capabilities.
  3. -- V2.1.3
  4. -- This script was written to harvest a treefarm using a ComputerCraft-Miningturtle in Minecraft.
  5. -- For more information visit: http://www.computercraft.info/forums2/index.php?/topic/6518-13-14-automatic-tree-farm-with-config/
  6.  
  7.  
  8. -- DEFAULT SETTINGS SECTION
  9. local slotAmount = 16           -- 9 for the old turtles, 16 for CC 1.4 or above
  10. local chestOutput = true        -- true if you want the turtle to put all items in a chest instead of dropping them
  11. local saplingOffset = 2         -- 2 recommended (amount of blocks between two saplings)
  12. local wallOffset = 2            -- 2 recommended (amount of blocks between the saplings and the wall)
  13. local fullSaplings = false      -- true: wait for 64 Saplings, false: wait for the amount the treefarm could possibly have
  14. local throwSaplings = false     -- true: throw away unnecessary saplings (only if fullSaplings = false)
  15. local saplingMethod = "compare" -- "detect" or "compare" - compare works better but if you have 1.3 you should set it to detect to avoid bugs
  16. local sleepTime = 300               -- set if you wish to make a break between farming runs
  17. local minFuel = 100
  18. -- DEFAULT SETTINGS SECTION
  19.  
  20. local serverID, x, y            -- leave blank! (serverID will be declared later when the first server answer comes)
  21.  
  22. function writeSettings ( ) --> write the current (default) settings in the file farmer.cfg
  23.     local file = fs.open ("farmer.cfg", "w")
  24.     file.writeLine (slotAmount)
  25.     file.writeLine (chestOutput)
  26.     file.writeLine (saplingOffset)
  27.     file.writeLine (wallOffset)
  28.     file.writeLine (fullSaplings)
  29.     file.writeLine (throwSaplings)
  30.     file.writeLine (saplingMethod)
  31.     file.writeLine (xTrees)
  32.     file.writeLine (yTrees)
  33.     file.writeLine (sleepTime)
  34.   file.writeLine (minFuel)
  35.     file.close ( )
  36. end
  37.  
  38. function readSettings ( ) --> replace the default values with the ones in the farmer.cfg
  39.     local file = fs.open ("farmer.cfg", "r")
  40.     slotAmount      = tonumber (file.readLine ( ))
  41.     chestOutput     = file.readLine ( ) == "true"
  42.     saplingOffset   = tonumber (file.readLine ( ))
  43.     wallOffset      = tonumber (file.readLine ( ))
  44.     fullSaplings    = file.readLine ( ) == "true"
  45.     throwSaplings   = file.readLine ( ) == "true"
  46.     saplingMethod   = file.readLine ( )
  47.     xTrees          = tonumber (file.readLine ( ))
  48.     yTrees          = tonumber (file.readLine ( ))
  49.     sleepTime       = tonumber (file.readLine ( ))
  50.     minFuel     = tonumber (file.readLine ( ))
  51.     file.close ( )
  52. end
  53.  
  54. function forward (value) --> func to move a amount of blocks forward even when a entity or block is blocking the way
  55.     for i = 1, value do
  56.         local forw = false
  57.         while not forw do
  58.             forw = turtle.forward ( )
  59.             if not forw and turtle.detect ( ) then
  60.                 turtle.dig ( )
  61.             end
  62.         end
  63.     end
  64. end
  65.  
  66. function up (value) --> func to move up (see forward)
  67.     for i = 1, value do
  68.         local upp = false
  69.         while not upp do
  70.             upp = turtle.up ( )
  71.             if not upp and turtle.detectUp ( ) then
  72.                 turtle.digUp ( )
  73.             end
  74.         end
  75.     end
  76. end
  77.  
  78. function down (value) --> func to move down (see forward)
  79.     for i = 1, value do
  80.         dow = false
  81.         while not dow do
  82.             dow = turtle.down ( )
  83.             if not dow and turtle.detectDown ( ) then
  84.                 turtle.digDown ( )
  85.             end
  86.         end
  87.     end
  88. end
  89.  
  90. function drop (value) --> func to drop evrything but slot 1 and slot 2 (value 0) or unnecessary saplings (value 1)
  91. -- Altered to allow us to keep slot 3 from dropping, as it's now a fuel slot.
  92.     if (value == 1) and (turtle.getItemCount (1) - (xTrees * yTrees) > 1) then
  93.         turtle.select (1)
  94.         if chestOutput then
  95.             turn ("back")
  96.             if turtle.detect ( ) then turtle.drop (turtle.getItemCount (1) - (xTrees * yTrees) - 1) end
  97.             turn ("back")
  98.         end
  99.         turtle.drop (turtle.getItemCount (1) - (xTrees * yTrees) - 1)
  100.     else
  101.         if chestOutput then
  102.             turn ("back")
  103.             if turtle.detect ( ) then
  104.                 for i = 4, slotAmount do
  105.                     turtle.select (i)
  106.                     if turtle.getItemCount (i) > 0 then turtle.drop ( ) end
  107.                 end
  108.             end
  109.             turn ("back")
  110.         else
  111.       for i = 4, slotAmount do
  112.         turtle.select (i)
  113.         if turtle.getItemCount (i) > 0 then turtle.drop ( ) end
  114.       end
  115.     end
  116.     end
  117. end
  118.  
  119. function turn (dir) --> easier turning func with a parameter or direction
  120.     if dir == "left" or dir == 0 then turtle.turnLeft()         -- "left" or 0 for left
  121.     elseif dir == "right" or dir == 1 then turtle.turnRight()   -- "right" or 1 for right
  122.     else turtle.turnLeft() turtle.turnLeft() end                -- everything else (I am using "back") for turning around
  123. end
  124.  
  125. function cutDown ( ) --> func to cut down a tree the turtle faces at height 2
  126.     turtle.select (3)
  127.     turtle.dig ( )
  128.     forward (1)
  129.     down (1)
  130.     turtle.select (2)
  131.     if not turtle.compareDown ( ) then
  132.         if turtle.detectDown ( ) then turtle.digDown ( ) end
  133.         turtle.placeDown ( )
  134.     end
  135.     up (1)
  136.     turtle.select (1)
  137.     turtle.placeDown ( )
  138.     turtle.select (4)
  139.     local height = 0
  140.     while turtle.compareUp ( ) do
  141.         up (1)
  142.         height = height + 1
  143.     end
  144.     down (height)
  145. end
  146.  
  147. function tree ( ) --> return true if turtle faces a tree
  148.     if turtle.getItemCount (4) > 0 then
  149.         turtle.select (4)
  150.         local re = turtle.compare ( )
  151.         return (re)
  152.     else
  153.         return (turtle.detect ( ))
  154.     end
  155. end
  156.  
  157. -- Check Fuel
  158. function checkfuel()
  159.     if turtle.getFuelLevel() > minFuel then
  160.  
  161.         term.clear()
  162.         term.setCursorPos(1, 1)
  163.   --[[
  164.     Slot 3 is now fuel.  Since we're dealing with trees
  165.     we can use ANYTHING from that slot, be it saplings
  166.     or logs.
  167.   --]]
  168.     print('=======================================')
  169.     print('              Fuel Level')
  170.     term.write('Fuel: ')
  171.     fpx, fpy = term.getCursorPos()
  172.     term.setCursorPos(fpx+4, fpy)
  173.     term.write(' / '..minFuel);
  174.     print('=======================================')
  175.     term.setCursorPos(fpx, fpy)
  176.     cFuel = tostring(math.floor( turtle.getFuelLevel() ))
  177.     term.write( cFuel )
  178.     end
  179.  
  180.   if turtle.getFuelLevel() < minFuel then
  181.  
  182.     term.clear()
  183.     term.setCursorPos(1, 1)
  184.   --[[
  185.     Slot 3 is now fuel.  Since we're dealing with trees
  186.     we can use ANYTHING from that slot, be it saplings
  187.     or logs.
  188.   --]]
  189.     print('=======================================')
  190.     print('              Fuel Level')
  191.     term.write('Fuel: ')
  192.     fpx, fpy = term.getCursorPos()
  193.     term.setCursorPos(fpx+4, fpy)
  194.     term.write(' / '..minFuel);
  195.     print('=======================================')
  196.  
  197.     for fNum = 3, slotAmount do
  198.       turtle.select(fNum)
  199.       repeat
  200.         turtle.refuel(1)
  201.         term.setCursorPos(fpx, fpy)
  202.         cFuel = tostring(math.floor( turtle.getFuelLevel() ))
  203.         term.write( cFuel )
  204.       until turtle.getFuelLevel() > minFuel or turtle.getItemCount(fNum) == 0
  205.     end
  206.     if turtle.getFuelLevel() < minFuel then
  207.       x, y = term.getCursorPos()
  208.       term.setCursorPos(1,y+2)
  209.       print('Error: Auto-Refuel Failure')
  210.       print('Place fuel in slot #3')
  211.       print('[F] Refuel')
  212.       print('[Q] Quit')
  213.       while true do
  214.         local event, param1 = os.pullEvent("key")
  215.         turtle.select(3)
  216.         if param1 == 33 then
  217.           checkfuel()        
  218.           if turtle.getFuelLevel() >= minFuel then term.clear() break end
  219.         end
  220.         if param1 == 16 then
  221.           term.clear()
  222.           term.setCursorPos(1,1)
  223.           os.queueEvent('terminate')
  224.         end
  225.        
  226.       end
  227.     end
  228.   end
  229. end
  230.  
  231. function farm ( ) --> doing a complete farming run
  232.   checkfuel()
  233.     forward (1)
  234.     up (1)
  235.     turn ("right")
  236.     forward (wallOffset)
  237.     turn ("left")
  238.     forward (wallOffset - 1)
  239.     for j = 1, xTrees do
  240.         for i = 1, yTrees do
  241.             checkfuel()
  242.             if i > 1 then
  243.                 forward (saplingOffset)
  244.             end
  245.             if tree ( ) then
  246.                 cutDown ( )
  247.             else
  248.                 forward (1)
  249.                 turtle.select (1)
  250.                 if (not turtle.detectDown ( ) and saplingMethod == "detect") or (not turtle.compareDown ( ) and saplingMethod == "compare") then
  251.                     down (1)
  252.                     turtle.select (2)
  253.                     if not turtle.compareDown ( ) then
  254.                         if turtle.detectDown ( ) then turtle.digDown ( ) end
  255.                         turtle.placeDown ( )
  256.                     end
  257.                     up (1)
  258.                     turtle.select (1)
  259.                     turtle.placeDown ( )
  260.                 end
  261.             end
  262.         end
  263.         if j < xTrees then
  264.             forward (1)
  265.             turn (j % 2)
  266.             forward (saplingOffset + 1)
  267.             turn (j % 2)
  268.         end
  269.     end
  270.     if xTrees % 2 == 1 then
  271.         turn ("right")
  272.         forward (1)
  273.         turn ("right")
  274.         forward ((yTrees - 1) * (saplingOffset + 1) + wallOffset)
  275.         turn ("right")
  276.         forward (1)
  277.     else
  278.         forward (wallOffset)
  279.         turn ("right")
  280.     end
  281.     forward (((xTrees - 1) * (saplingOffset + 1)) + wallOffset)
  282.     down (1)
  283.     turn ("left")
  284.     forward (1)
  285.     turn ("back")
  286. end
  287.  
  288. function waitForSaplings ( ) --> returning the amount of saplings that are needed to start farming
  289.     if not fullSaplings then return (xTrees * yTrees - turtle.getItemCount (1) + 1)
  290.     else return (64 - turtle.getItemCount (1)) end
  291.     sleep (1)
  292. end
  293.  
  294. function handleRednet (message) --> processing a command received from rednet
  295.     local nBegin, nBeginn, nEnd, nEndd, command, attrib, n
  296.     nBegin, nEnd = string.find (message, " ")
  297.     command = message
  298.     attrib = { }
  299.     n = 0
  300.     if nBegin ~= nil then
  301.         command = string.sub (message, 1, nBegin - 1)
  302.         repeat
  303.             if n ~= 0 then nBegin, nEnd = string.find (message, " ", nBegin + 1) end
  304.             nBeginn, nEndd = string.find (message, " ", nBegin + 1)
  305.             n = n + 1
  306.             if nBeginn == nil then attrib[n] = string.sub (message, nBegin + 1)
  307.             else attrib[n] = string.sub (message, nBegin + 1, nBeginn - 1) end
  308.         until nBeginn == nil
  309.     end
  310.     if command == "stop" then
  311.         print ("\n")
  312.         error ("got stop command")
  313.     elseif command == "shutdown" then
  314.         print ("\n\nshutting down due to 'shutdown' command...")
  315.         sleep (1)
  316.         os.shutdown ( )
  317.     elseif command == "reboot" then
  318.         print ("\n\nrebooting due to 'reboot' command...")
  319.         sleep (1)
  320.         os.reboot ( )
  321.     elseif command == "change" then
  322.         if attrib[2] ~= nil then write ("\nchanging '"..attrib[1].."' to '"..attrib[2].."'...")
  323.         else  write ("\nchanging '"..attrib[1].."' to '(empty)'...") end
  324.         readSettings ( )
  325.         if attrib[1] == "xTrees" then
  326.             xTrees = tonumber (attrib[2])
  327.         elseif attrib[1] == "yTrees" then
  328.             yTrees = tonumber (attrib[2])
  329.         elseif attrib[1] == "slotAmount" then
  330.             slotAmount = tonumber (attrib[2])
  331.         elseif attrib[1] == "saplingOffset" then
  332.             saplingOffset = tonumber (attrib[2])
  333.         elseif attrib[1] == "wallOffset" then
  334.             wallOffset = tonumber (attrib[2])
  335.         elseif attrib[1] == "saplingMethod" then
  336.             saplingMethod = attrib[2]
  337.         elseif attrib[1] == "throwSaplings" then
  338.             throwSaplings = attrib[2] == "true"
  339.         elseif attrib[1] == "fullSaplings" then
  340.             fullSaplings = attrib[2] == "true"
  341.         elseif attrib[1] == "chestOutput" then
  342.             chestOutput = attrib[2] == "true"
  343.         elseif attrib[1] == "sleepTime" then
  344.             sleepTime = tonumber (attrib[2])
  345.         else
  346.             write ("\n"..attrib[1].." is no valid parameter!")
  347.         end
  348.         writeSettings ( )
  349.     elseif command == "startup" then
  350.         if attrib[1] == nil and fs.exists ("startup") then
  351.             fs.delete ("startup")
  352.         elseif attrib[1] ~= nil then
  353.             file = fs.open ("startup", "w")
  354.             if attrib[2] == nil then
  355.                 file.write ("shell.run (\""..attrib[1].."\")")
  356.             else
  357.                 str = "shell.run (\""
  358.                 for _, i in ipairs (attrib) do
  359.                     str = str..i.."\", \""
  360.                 end
  361.                 str = string.sub (str, 1, string.len (str) - 3)..")"
  362.                 file.write (str)
  363.             end
  364.             file.close ( )
  365.         end
  366.     end
  367. end
  368.  
  369. function getRednet ( ) --> receiving all rednet commands which are in queue for this turtle if available
  370.     if serverID == nil then rednet.broadcast ("pull")
  371.     else rednet.send (serverID, "pull") end
  372.     repeat
  373.         serverID, message = rednet.receive (0.5)
  374.     until message ~= "pull" -- avoiding receiving commands from other turtles pulling
  375.                             -- NOTE: this wont happen often because the first server answer will set a turtle to use the ID from this server as its sending ID
  376.     while serverID ~= nil and message ~= "end" do
  377.         handleRednet (message)
  378.         rednet.send (serverID, "pull")
  379.         repeat
  380.             serverID, message = rednet.receive (0.5)
  381.         until message ~= "pull"
  382.     end
  383. end
  384.  
  385. function headline ( )
  386.     x, y = term.getCursorPos ( )
  387.     term.setCursorPos (1, 2)
  388.     term.clearLine ( )
  389.     term.setCursorPos (1, 1)
  390.     term.clearLine ( )
  391.     if turtle then
  392.         for i = 1, math.floor ((term.getSize ( ) - (25 + string.len (os.getComputerID ( )))) / 2) do write (" ") end -- looks more complicated than it is, only writes n times (" ") while n is the amount of empty digits after the headline devided by 2
  393.         print ("nO_OnEs Tree Farmer [ID "..os.getComputerID ( ).."]")
  394.         for i = 1, term.getSize ( ) do term.write ("-") end
  395.     else
  396.         for i = 1, math.floor ((term.getSize ( ) - 40) / 2) do write (" ") end -- looks more complicated than it is, only writes n times (" ") while n is the amount of empty digits after the headline devided by 2
  397.         print ("[Automatic Tree Farmer] Server Interface")
  398.         for i = 1, term.getSize ( ) do term.write ("-") end
  399.     end
  400.     term.setCursorPos (x, y)
  401. end
  402.  
  403. function done ( ) --> writing '- done' at the end of the current line
  404.     x, y = term.getCursorPos ( )
  405.     if x > (term.getSize ( ) - 6) then y = y + 1 end -- if the current line is full yet
  406.     term.setCursorPos (term.getSize ( ) - 5, y)
  407.     term.write ("- done")
  408.     write ("\n")
  409.     headline ( )
  410. end
  411.  
  412. function beServer ( )
  413.     rednet.open ("left")
  414.     rednet.open ("right")
  415.     rednet.open ("top")
  416.     headline ( )
  417.     write ("\n\n")
  418.     while true do
  419.         headline ( )
  420.         x, y = term.getCursorPos ( )
  421.         term.clearLine ( )
  422.         term.setCursorPos (1, y)
  423.         write ("Press any key")
  424.         event, one, two = os.pullEvent ( )
  425.         if event == "rednet_message" and two == "pull" then -- if 'pull' command received
  426.             x, y = term.getCursorPos ( )
  427.             term.clearLine ( )
  428.             term.setCursorPos (1, y)
  429.             if not fs.exists ("turtle "..one) then
  430.                 fileWrite = fs.open ("turtle "..one, "w")
  431.                 fileWrite.writeLine ("end")
  432.                 fileWrite.close ( )
  433.                 print ("new turtle registered (ID "..one..")")
  434.             end
  435.             fileRead = fs.open ("turtle "..one, "r")
  436.             i = 0
  437.             local text = { }
  438.             repeat
  439.                 i = i + 1
  440.                 line = fileRead.readLine ( )
  441.                 text[i] = line
  442.             until text[i] == nil
  443.             fileRead.close ( )
  444.             rednet.send (one, text[1])
  445.             fileWrite = fs.open ("turtle "..one, "w")
  446.             i = 2
  447.             while text[i] ~= "end" and text[i] ~= nil do
  448.                 fileWrite.writeLine (text[i])
  449.                 i = i + 1
  450.             end
  451.             fileWrite.writeLine ("end")
  452.             fileWrite.close ( )
  453.             if text[1] ~= "end" then print ("sent '"..text[1].."' to turtle "..one)
  454.             else print ("no commands in queue for turtle "..one) end
  455.         elseif event == "char" then -- if key pressed
  456.             local turtles = { }
  457.             n = 1
  458.             for _, i in ipairs (fs.list ("")) do
  459.                 if string.sub (i, 1, 7) == "turtle " and tonumber (string.sub (i, 8)) ~= nil then
  460.                     turtles[n] = i
  461.                     n = n + 1
  462.                 end
  463.             end
  464.             if turtles[1] ~= nil then
  465.                 term.clear ( )
  466.                 term.setCursorPos (1, 1)
  467.                 headline ( )
  468.                 write ("\n\n")
  469.                 print ("available turtles:")
  470.                 for _, i in ipairs (turtles) do
  471.                     print ("- "..i)
  472.                 end
  473.                 print ("")
  474.                 print ("please enter the number of the turtle you want to send a command to or 'all' if you want to message every turtle (exit to abort)")
  475.                 number = read ( )
  476.                 while not (tonumber (number) ~= nil or number == "all" and tonumber (number) == nil) and number ~= "exit" do
  477.                     print ("incorrect number")
  478.                     headline ( )
  479.                     number = read ( )
  480.                 end
  481.                 if number ~= "exit" then
  482.                     print ("command: (type help to see command-list or exit to abort)")
  483.                     headline ( )
  484.                     message = read ( )
  485.                     while message == "help" and message ~= "exit" do
  486.                         term.clear ( )
  487.                         term.setCursorPos (1, 1)
  488.                         write ("\n\n")
  489.                         headline ( )
  490.                         print ("available commands: [attribute] (optional)")
  491.                         print ("- change [xTrees | yTrees | saplingOffset | wallOffset | saplingMethod | fullSaplings | throwSaplings | sleepTime | slotAmount | chestOutput] [value]")
  492.                         print ("- stop")
  493.                         print ("- shutdown")
  494.                         print ("- reboot")
  495.                         print ("- startup (command) (atrribute1) (...)\n  *leave command blank for no startup command")
  496.                         print ("\ncommand: (type help to see command-list or exit to abort)")
  497.                         message = read ( )
  498.                     end
  499.                     if message ~= "exit" then
  500.                         if number == "all" then
  501.                             for _, i in ipairs (turtles) do
  502.                                 fileNew = fs.open (i, "r")
  503.                                 file = fileNew.readAll ( )
  504.                                 fileNew.close ( )
  505.                                 fileNew = fs.open (i, "w")
  506.                                 fileNew.writeLine (message)
  507.                                 fileNew.write (file)
  508.                                 fileNew.close ( )
  509.                             end
  510.                         else   
  511.                             fileNew = fs.open ("turtle "..number, "r")
  512.                             file = fileNew.readAll ( )
  513.                             fileNew.close ( )
  514.                             fileNew = fs.open ("turtle "..number, "w")
  515.                             fileNew.writeLine (message)
  516.                             fileNew.write (file)
  517.                             fileNew.close ( )
  518.                         end
  519.                     end
  520.                 end
  521.                 term.clear ( )
  522.                 term.setCursorPos (1, 2)
  523.             else
  524.                 x, y = term.getCursorPos ( )
  525.                 term.clearLine ( )
  526.                 term.setCursorPos (1, y)
  527.                 print ("No turtles available at the moment!")
  528.             end
  529.         end
  530.     end
  531. end
  532.  
  533. term.clear ( )
  534. term.setCursorPos (1, 1)
  535.  
  536. if not turtle then beServer ( ) end
  537.  
  538. while not fs.exists ("farmer.cfg") do --> writing default settings (while asking for the size of the Farm)
  539.     term.clear ( )
  540.     term.setCursorPos (1, 1)
  541.     textutils.slowPrint ("No configuration file found.")
  542.     sleep (0.25)
  543.     print ("")
  544.     print ("example with xTrees 4 and yTrees 3")
  545.     print ("+  +  +  + <-- sapling")
  546.     print ("+  +  +  +")
  547.     print ("+  +  +  +")
  548.     print ("o <-- logger facing up")
  549.     print ("")
  550.     print ("How many trees horizontally?\n(xTrees)")
  551.     xTrees = read ( )
  552.     print ("How many trees vertically?\n(yTrees)")
  553.     yTrees = read ( )
  554.     textutils.slowPrint ("Writing configuration-file")
  555.     print("")
  556.     writeSettings ( )
  557.     if fs.exists ("farmer.cfg") then
  558.         textutils.slowPrint ("farmer.cfg found, success!")
  559.     end
  560.     sleep (0.5)
  561.     term.clear ( )
  562.     term.setCursorPos (1, 1)
  563. end
  564.  
  565. rednet.open ("right")
  566. write ("\n\n")
  567. headline ( )
  568.  
  569. while true do
  570.     write ("getting rednet commands...")
  571.     getRednet ( )
  572.     done ( )
  573.     write ("reading config...")
  574.     readSettings ( )
  575.     done ( )
  576.     write ("dropping Items...")
  577.     if not fullSaplings and throwSaplings then drop (1) end
  578.     drop (0)
  579.     done ( )  
  580.  
  581.     repeat
  582.         x, y = term.getCursorPos ( )
  583.         x = 1
  584.         term.setCursorPos (x, y)
  585.         saplings = waitForSaplings ( )
  586.         if saplings == 1 then write ("1 sapling remaining ...")
  587.         elseif saplings < 1 then write ("0 saplings remaining ...")
  588.         else write ("refill saplings please...") end
  589.         sleep (1)
  590.     until saplings < 1  
  591.  
  592.     done ( )
  593.     for i = 0, sleepTime do
  594.         x, y = term.getCursorPos ( )
  595.         x = 1
  596.         term.setCursorPos (x, y)
  597.         write ("sleeping... ("..sleepTime-i.."sec left)")
  598.         sleep (1)
  599.     end
  600.     done ( )
  601.     write ("farming "..xTrees.." x "..yTrees.."...")
  602.     farm ( )
  603.     done ( )
  604. end
  605.  
  606. -- Note: [removed]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement