Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[**************************************************************************************
- ** **
- ** Kekimurus automation v0.1 **
- ** Automaticaly place cake blocks **
- ** **
- ** Author **
- ** discord: om_r#3567 **
- ** email: max.kvy@gmail.com **
- ** **
- ** --------------------------------------------------------------------------- **
- ** If you want to report a bug, suggest any ideas or just to support - use **
- ** credentials above. I appreciate any feedback! **
- ** --------------------------------------------------------------------------- **
- ** **
- ** Download **
- ** "pastebin get BbZ3BVL4 kekimurus" and "kekimurus" to execute **
- ** or "pastebin get BbZ3BVL4 startup" - to autorun **
- ** **
- ** Usage **
- ** Place storage with cakes above turtle **
- ** **
- **************************************************************************************--]]
- local settings = {
- refreshDelay = 5,
- isLogEnabled = true,
- placeAround = true,
- placeAmount = 2
- }
- -- Support methods
- local utils = {}
- utils.log = function (message)
- if settings.isLogEnabled == true then
- print(message)
- end
- end
- -- Main methods
- local app = {}
- app.checkInventory = function ()
- if turtle.getItemDetail(1) == nil then
- local i = 1
- while i <= settings.placeAmount do
- utils.log('Inventory is empty, taking from storage above...')
- turtle.select(i)
- turtle.suckUp(1)
- i = i + 1
- end
- turtle.select(1)
- end
- end
- app.placeForward = function ()
- if turtle.detect() == false then
- local i = 1
- while i <= settings.placeAmount do
- utils.log('Placing item down')
- turtle.place()
- i = i + 1
- end
- end
- if settings.placeAround == true then
- turtle.turnLeft()
- end
- end
- app.run = function ()
- while true do
- app.checkInventory()
- app.placeForward()
- --os.sleep(settings.refreshDelay)
- end
- end
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement