Advertisement
Walhfort

Essentia farm

Apr 17th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. --os.loadAPI("button")
  2. local essentia = {}
  3. local jars = peripheral.getNames()
  4. --local m = peripheral.wrap("right")
  5. local ess = {}
  6. local a = peripheral.find("tt_aspectanalyser")
  7. local c = peripheral.wrap("back")
  8.  
  9. function findEss()
  10.   local tempess = {}
  11.   for i = 1,54 do
  12.     if c.getStackInSlot(i) then
  13.       c.puchItem("WEST", i, 1, 1)
  14.       tempess = a.getAspects()
  15.       --print(tempess[1])
  16.       if tempess[2] then
  17.         if tempess[2] == "auram" then
  18.           ess[tempess[1]] = i
  19.         else
  20.           ess[tempess[2]] = i
  21.         end
  22.       else
  23.         ess[tempess[1]] = i
  24.       end
  25.       c.pullItem("WEST", 1, 1, i)
  26.      
  27.     end
  28.   end
  29.   print(ess["terra"])
  30.   print(ess["fames"])
  31.   print(ess["ignis"])
  32. end
  33.  
  34. function scanEssentia()
  35.     for i, j in ipairs(jars) do
  36.         if peripheral.getType(j) == "tt_aspectContainer"
  37.             asp = peripheral.call(j, "getAspect)
  38.             countasp = peripheral.call(j, "getAspectCount", ****************)
  39.             if countasp > 0 then
  40.                 essentia[asp] = math.floor(countasp)
  41.                 print(asp[1]..":"..countasp)
  42.             end
  43.         end
  44.     end
  45. end
  46. end
  47.  
  48. --findEss()
  49. scanEssentia()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement