Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pulse()
- rs.setOutput("top", true)
- sleep(0,5)
- rs.setOutput("top", false)
- sleep(0.5)
- end
- c = peripheral.wrap("left")
- local meta = 0
- local count = 0
- while(true) do
- local tab = c.getStackInSlot(2)
- if tab ~= nil then
- for key, value in pairs(tab) do
- if key == "dmg" then
- print(key .. " = " .. tostring(value))
- if(value<=meta) then
- count = count + 1
- else
- count = 0
- end
- -- print("meta: " .. meta)
- -- print("value: " .. value)
- meta = value
- end
- end
- end
- sleep(1)
- print("count: " .. count)
- if count == 7 then
- print("Moving...")
- pulse()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment