MrTrala

Farm (PRIV VERSION)

Sep 23rd, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.55 KB | None | 0 0
  1. --[[
  2.     Farming for ArchLightOnline
  3.     Version 3.0.4 - ReWorked Version
  4.     Created by Mr Trala
  5.    
  6. Instructions;
  7. Configure Seed, WaterTO, FinalT and PlantID and add the respective ID of your plants (Config to marijuana plating by default).
  8. Close your main door; just in case someone wants to troll you.
  9.  
  10. For perfect config you can see:
  11. http://i64.tinypic.com/293ktia.png
  12. Have fun!
  13. Have fun!
  14.  
  15. Change log;
  16. 3.0.1 -- Fixed ALOT of wrong things.
  17. 3.0.2 -- Added a ReOpen bps, in case you get disconected.
  18. 3.0.3 -- ReWorked it again.
  19. 3.0.4 -- And again.
  20. 3.0.5 -- AND AGAIN.
  21. ]]
  22.  
  23. config = {
  24.     Seed = 5953, -- Id of the plant you want to grow (the seed).
  25.     WaterTO = 331, -- Id of the middle plant (the one who needs water).
  26.     FinalT = 14033, -- Id of the pot to use scythe (the final plant).
  27.     PlantID = {5953}, -- Id of the final plant (the one that will be planted again)
  28.     Dirts = {950, 4822, 952, 4821, 952} -- Don't Change this.
  29. }
  30.  
  31.  
  32. pos = Self.Position()
  33.  
  34. function WaterIT()
  35. local WBP = Container.GetFirst()
  36.     for y = -7, 7 do
  37.         for x = -7, 7 do
  38.             for spot = 0, WBP:ItemCount() do
  39.                 local item = WBP:GetItemData(spot)
  40.                 if Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id == config.WaterTO and (item.id == 2901) then
  41.                     WBP:UseItemWithGround(spot, pos.x + x, pos.y + y, pos.z)
  42.                 end
  43.             end
  44.         end
  45.     end
  46. end
  47.  
  48. function Plant()
  49. local WBP = Container(0)
  50.     for y = -5, 5 do
  51.         for x = -5, 5 do
  52.             if Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id == config.Seed then
  53.                 Self.UseItemWithGround(3455, pos.x + x, pos.y + y, pos.z)
  54.                 wait(3000, 3100)
  55.            
  56.             elseif Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id == config.FinalT then      
  57.                 Self.UseItemWithGround(3453, pos.x + x, pos.y + y, pos.z)
  58.                 wait(3000, 3100)       
  59.             end
  60.            
  61.             if Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id == config.WaterTO then   
  62.                 WaterIT()          
  63.             end
  64.         end
  65.     end
  66.     sleep(math.random(1400, 1500))
  67. end
  68.  
  69. Module('BP', function(mod)
  70. local Op = Container(0)
  71.     if not Op:isOpen() then
  72.         Self.OpenMainBackpack(false)
  73.     end
  74. mod:Delay((50 * 1000), (50 * 1000) + 200)
  75. end, true)
  76.  
  77. function Drop()
  78. MainBP = Container(0)
  79.     for y = -5, 5 do
  80.         for x = -5, 5 do
  81.             for spot, item in MainBP:iItems() do
  82.                 if table.contains(config.Dirts, Map.GetTopMoveItem(pos.x + x, pos.y + y, pos.z).id) and (table.contains(config.PlantID, item.id)) then
  83.                         MainBP:MoveItemToGround(spot, pos.x + x, pos.y + y, pos.z, 1)
  84.                 end    
  85.             end
  86.         end
  87.     end
  88. end
  89.  
  90. registerEventListener(TIMER_TICK, "Plant")
  91. registerEventListener(TIMER_TICK, "Drop")
  92. Module('BP', BP, true)
Add Comment
Please, Sign In to add comment