Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getnumbersfromtext(txt)
- local str = ""
- string.gsub(txt, "%d+", function(e) str = str .. e end)
- return str;
- end
- function main()
- while true do
- text = target.getLine(1)
- amount = tonumber(getnumbersfromtext(text))
- if amount ~= oldAmount then
- print(amount)
- oldAmount = amount
- end
- if amount == 147456 then
- redstone.setOutput(clutchSide, false)
- redstone.setOutput("front", false)
- else
- redstone.setOutput(clutchSide, true)
- redstone.setOutput("front", true)
- end
- sleep(0.2)
- end
- end
- oldAmount = -1
- target = peripheral.wrap("back")
- clutchSide = arg[1]
- main()
Advertisement
Add Comment
Please, Sign In to add comment