Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 1667
- y = 41
- z = -4143
- suckNowForward = true
- suckNowUp = true
- currentBrickCount = 0
- previousBrickCount = 0
- painCount = 0
- function Scream()
- local speaker = peripheral.find("speaker")
- speaker.playSound("quark:entity.stoneling.die", math.random(0, 3), math.random(0, 2))
- print("Pain: ", currentBrickCount)
- end
- function Reset()
- suckNowForward = true
- suckNowUp = true
- previousBrickCount = currentBrickCount
- end
- function CheckForBricks()
- local inspectSuccess, inspectData = turtle.inspect()
- if(inspectSuccess) then
- if(string.match(inspectData, "chest")) then
- suckNowForward = false
- end
- end
- inspectSuccess, inspectData = turtle.inspectUp()
- if(inspectSuccess) then
- if(string.match(inspectData, "chest")) then
- suckNowUp = false
- end
- end
- if(suckNowForward) then
- local suckForward = turtle.suck()
- if(suckForward) then
- print("Suck forward")
- currentBrickCount = 0
- for i = 1, 16 do
- if(turtle.getItemDetail(i) == not nil) then
- local name = turtle.getItemDetail(i).name
- local count = turtle.getItemDetail(i).count
- if((not name == not nil) or (not count == not nil)) then
- if(string.match(name, "brick")) then
- currentBrickCount = currentBrickCount + count
- end
- end
- end
- end
- end
- end
- if(currentBrickCount > previousBrickCount) then
- Scream()
- end
- end
- function Tick()
- CheckForBricks()
- Reset()
- end
- while true do
- Tick()
- end
- function FeelPain()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement