Advertisement
TheKingElessar

Untitled

Jul 6th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. x = 1667
  2. y = 41
  3. z = -4143
  4. suckNowForward = true
  5. suckNowUp = true
  6. currentBrickCount = 0
  7. previousBrickCount = 0
  8. painCount = 0
  9.  
  10. function Scream()
  11. local speaker = peripheral.find("speaker")
  12. speaker.playSound("quark:entity.stoneling.die", math.random(0, 3), math.random(0, 2))
  13. print("Pain: ", currentBrickCount)
  14. end
  15.  
  16. function Reset()
  17. suckNowForward = true
  18. suckNowUp = true
  19. previousBrickCount = currentBrickCount
  20. end
  21.  
  22. function CheckForBricks()
  23. local inspectSuccess, inspectData = turtle.inspect()
  24. if(inspectSuccess) then
  25. if(string.match(inspectData.name, "chest")) then
  26. suckNowForward = false
  27. end
  28. end
  29.  
  30. inspectSuccess, inspectData = turtle.inspectUp()
  31. if(inspectSuccess) then
  32. if(string.match(inspectData.name, "chest")) then
  33. suckNowUp = false
  34. end
  35. end
  36.  
  37. if(suckNowForward) then
  38. local suckForward = turtle.suck()
  39.  
  40. if(suckForward) then
  41. print("Suck forward")
  42. currentBrickCount = 0
  43. for i = 1, 16 do
  44. local name = turtle.getItemDetail(i).name
  45. local count = turtle.getItemDetail(i).count
  46. print("Not null")
  47. if((not name == not nil) or (not count == not nil)) then
  48. print(name)
  49. if(string.match(name, "brick")) then
  50. currentBrickCount = currentBrickCount + count
  51. end
  52. end
  53. end
  54. end
  55. end
  56. if(currentBrickCount > previousBrickCount) then
  57. Scream()
  58. end
  59. end
  60.  
  61. function Tick()
  62. CheckForBricks()
  63.  
  64. Reset()
  65. end
  66.  
  67. while true do
  68. Tick()
  69. end
  70.  
  71. function FeelPain()
  72.  
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement