Advertisement
melzneni

Drill Query

Sep 14th, 2023 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #import: NK0bGHwZ; // Importieren der GPS-Bibliothek
  2. #import: AAMw1hB3; // Math
  3. #import: mWBVHmn0; // Item Switch
  4.  
  5. digDown: {
  6. moved = 0;
  7. while (true) {
  8. name = inspectNameDown();
  9. if (name != nil && (findText(name, '_ore') || name == 'minecraft:bedrock')){
  10. break;
  11. };
  12. mvDown();
  13. moved = moved + 1;
  14. };
  15. mvUp(moved);
  16. };
  17.  
  18. clearInventory:{
  19. # {
  20. for (i=0; i < 16; i++){
  21. name = getItemName(i);
  22. if (name!=null && findText(name, 'coal') == null) {
  23. drop(i, 64);
  24. }
  25. }
  26. }
  27. };
  28.  
  29. checkFuel():{
  30. if (getFuelLevel() < 500){
  31. clearInventory();
  32. pos = locate();
  33. direction = getDirection();
  34. faceToward($posFuel$);
  35. for(i=0;i<5;i++) {
  36. suck(15, 64);
  37. };
  38. refuel();
  39. while (getFuelLevel()<700) {
  40. input("Bitte Treibstoff-Kiste auffüllen ("+getFuelLevel()+")");
  41. for(i=0;i<5;i++) {
  42. suck(15, 64);
  43. };
  44. refuel();
  45. };
  46. moveTo(pos, direction);
  47. };
  48. };
  49.  
  50. main: {
  51. print("Pickaxe links");
  52. print("Kohle Kiste hinten");
  53. configureItemSwitch(15, "left");
  54.  
  55. w, d = splitText(input("w,d"), ",");
  56. w = tonumber(w);
  57. d = tonumber(d);
  58.  
  59. pos = locate();
  60. direction = getDirection();
  61.  
  62. $posFuel$ = getPosInDirection(pos, (direction + 2) % 4);
  63.  
  64. pos1 = getPosInDirection(pos, direction, w - 1);
  65. pos2 = getPosInDirection(pos, (direction + 1) % 4, d - 1);
  66.  
  67. xMin = min(pos[0], pos1[0], pos2[0]);
  68. xMax = max(pos[0], pos1[0], pos2[0]);
  69. y = pos[1];
  70. zMin = min(pos[2], pos1[2], pos2[2]);
  71. zMax = max(pos[2], pos1[2], pos2[2]);
  72.  
  73. for (x = xMin; x <= xMax; x++){
  74. for (z = zMin; z <= zMax; z++){
  75. moveToRuthless([x, y, z], 0);
  76. digDown();
  77. checkFuel();
  78. };
  79. };
  80. moveTo(pos);
  81. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement