Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- #################################
- -- auto_melee_trap
- -- version 0.2
- -- http://hevohevo.hatenablog.com/
- -- The turtle suspends the operation during the redstone ON.
- -- ################ config
- RSSide = "back"
- -- ################ functions
- -- When the inventory was filled to capacity, drop all items.
- function dropItems()
- if turtle.getItemCount(16) >0 then
- for i=1,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- end
- -- ################ main
- turtle.select(1)
- while true do
- if not rs.getInput(RSSide) then --redstone ON
- turtle.attack()
- turtle.suck()
- dropItems()
- else -- redstone ON
- -- wait for the inputted signal to change OFF
- print("suspend")
- os.pullEvent("redstone")
- print("attack")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement