SHARE
TWEET

sort.lua

a guest Aug 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local dirtFull = false;
  2. local dirtCount = 0;
  3. local cobblestoneFull = false;
  4. local cobblestoneCount = 0;
  5.  
  6. for i=1,16,1 do
  7.     local t = turtle.getItemDetail(i);
  8.     if (t and t.name == 'minecraft:dirt') then
  9.         turtle.select(i);
  10.         local r = turtle.drop();
  11.         if r then
  12.             dirtCount = dirtCount + t.count;
  13.         else
  14.             dirtFull = true;
  15.         end
  16.     end
  17. end
  18. print('Stored ',dirtCount,' of dirt');
  19. turtle.turnRight();
  20. for i=1,16,1 do
  21.     local t = turtle.getItemDetail(i);
  22.     if (t and t.name == 'minecraft:cobblestone') then
  23.         turtle.select(i);
  24.         local r = turtle.drop();
  25.         if r then
  26.             cobblestoneCount = cobblestoneCount + t.count;
  27.         else
  28.             cobblestoneFull = true;
  29.         end
  30.     end
  31. end
  32. print('Stored ',cobblestoneCount,' of cobblestone');
  33. turtle.turnLeft();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top