Advertisement
Guest User

PainCraft0.001

a guest
Mar 3rd, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --           Variables
  2.  
  3. -- slots
  4.  
  5. local slot = 0
  6. local slotActuel = 0
  7.  
  8. -- bucket
  9.  
  10. local bucketSlot = 0
  11. local bucketEmpty = "minecraft:bucket"
  12. local bucketFull = "minecraft:water_bucket"
  13. local bucketPlein = false;
  14.  
  15. --          Fonctions
  16.  
  17. -- Main
  18.  
  19. function main()
  20.  
  21.  
  22.  
  23.  
  24.  
  25. end
  26.  
  27.  
  28. -- Slot
  29.  
  30. function selectSlot(a)
  31.  
  32. turtle.select(a)
  33. majSlot()
  34.  
  35. end
  36.  
  37. function majSlot()  -- A LANCER APRES CHAQUE DEPLACEMENT
  38.  
  39. slotActuel = turtle.getSelectedSlot()
  40. slot = turtle.getDetailItem()
  41.  
  42. end
  43.  
  44. function firstSlot()
  45.  
  46.     turtle.select(1)
  47.     majSlot()
  48.  
  49. end
  50.  
  51. function upSlot()
  52.    
  53.     turtle.select(slotActuel + 1)
  54.     majSlot()
  55.  
  56. end
  57.  
  58. -- Bucket
  59.  
  60. function findBucketSlot()
  61.  
  62.  
  63.  
  64. end
  65.  
  66.  
  67. function bEtat()
  68.  
  69.     selectSlot(bucketSlot)
  70.  
  71.     if bIsEmpty() then
  72.     bucketPlein = false;
  73.    
  74.     elseif bIsFull() then
  75.     bucketPlein = true;
  76.  
  77.     end
  78.    
  79.  
  80. end
  81.  
  82. function bIsEmpty()
  83.  
  84.     if slot.name == bucketEmpty then
  85.    
  86.     return true
  87.     else
  88.     return false
  89.     end
  90.  
  91. end
  92.  
  93.  
  94. function bIsFull()
  95.  
  96.     if slot.name == bucketFull then
  97.  
  98.     return true
  99.     else
  100.     return false
  101.     end
  102.  
  103. end
  104.  
  105.  
  106.  
  107. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement