MrTrala

FarmingAFK (Outdated- but should work)V2.5.1

Aug 30th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. --[[
  2.     Farming AFK for ArchLightOnline
  3.     Version 2.5.1 - PRIV VERSION (Ownership; Mr Trilo)
  4.     Created by Mr Trala
  5.    
  6. Instructions;
  7. Due to a unknown problem in xeno you can't water the plant the same way you "plant" and "collect" it;
  8. So, you need to have the "waterskin of water" ALWAYS at the first slot of your backpack;
  9. Easy to do if you just keep the waterskin in your "WaterBP" alone.
  10. Configure PlantID, FarF and WaterTO and add the respective ID of your plants (you can put all of them; ex: PlantID = {5953, 1111, 2222}).
  11. If you want to AFK 24/7 you should use an auto opener backpack at login (which is not included here).
  12. Close your main door; just in case someone wants to troll you.
  13. For perfect config you can see:
  14. http://i64.tinypic.com/293ktia.png
  15. Have fun!
  16.  
  17. Credits to;
  18. Saul Pallavicino -- Idea
  19. Mr Trala -- Programmer
  20. ]]
  21.  
  22. config = {
  23.     PlantID = {5953}, -- Id of the plant you want to grow (the seed).
  24.     FarmF = {14033}, -- Id of the pot to use scythe (the final plant).
  25.     WaterTO = {331}, -- Id of the middle plant (the one who needs water).
  26.     WaterBP = "Blue Backpack", -- Name of your waterbp (where you keep the waterskin of water)
  27.     itemsID = {5953}, -- Ids of your final plants to be moved (and planted again).
  28.     Dirts = {950, 4822, 952, 4821} -- Don't Change this.
  29. }
  30.  
  31. -- Script Configs - Don't touch this ones.
  32. pos = Self.Position()
  33. WBP = Container.New(config.WaterBP)
  34. MainBP = Container(0)
  35. function Plant()
  36.     for y = -5, 5 do
  37.         for x = -5, 5 do
  38.             if table.contains(config.PlantID, Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id) then   
  39.                 Self.UseItemWithGround(3455, pos.x + x, pos.y + y, pos.z)
  40.                 wait(3000, 3100)
  41.            
  42.             elseif table.contains(config.FarmF, Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id) then         
  43.                 Self.UseItemWithGround(3453, pos.x + x, pos.y + y, pos.z)
  44.                 wait(3000, 3100)       
  45.             end
  46.            
  47.             if table.contains(config.WaterTO, Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id) then 
  48.                 WBP:UseItemWithGround(slot, pos.x + x, pos.y + y, pos.z)
  49.                 wait(3000, 3100)   
  50.             end
  51.            
  52.             for spot, item in MainBP:iItems() do
  53.                 if table.contains(config.Dirts, Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id) and (table.contains(config.itemsID, item.id)) then
  54.                         MainBP:MoveItemToGround(spot, pos.x + x, pos.y + y, pos.z, 1)
  55.                 end    
  56.             end
  57.                
  58.         end
  59.     end
  60.     sleep(math.random(1400, 1500))
  61. end
  62.  
  63.  
  64. registerEventListener(TIMER_TICK, "Plant")
Add Comment
Please, Sign In to add comment