Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- load apis
- os.loadAPI("apis/lama")
- -- stuff
- local baseX, baseZ, baseY = 11800, 210, 8013
- -- initialise code
- function init()
- while true do
- local x, y, z = lama.get()
- if x == 0 and z == 0 then
- lama.turn(lama.side.north)
- elseif x == 0 and z == -2 then
- lama.turn(lama.side.east)
- elseif x == 2 and z == -2 then
- lama.turn(lama.side.south)
- elseif x == 2 and z == 0 then
- lama.turn(lama.side.west)
- end
- lama.forward(math.huge) -- Keep trying.
- end
- end
- -- intialise classes
- miner = {}
- miner.items = {}
- miner.__index = miner
- function miner:create(id, x, z, y)
- local minerAttr = {}
- setmetatable(minerAttr,miner)
- minerAttr.id = id
- minerAttr.x = x
- minerAttr.z = z
- minerAttr.y = y
- minerAttr.side = side
- miner.items[id] = minerAttr
- return minerAttr
- end
- function miner:get(id)
- return miner.items[id]
- end
- function miner:goTo()
- lama.moveto(self.x, baseZ, self.y)
- end
- function miner:changeFocus()
- end
- function createMinerArray(layout, amount, startX, startZ, startY)
- -- Basic Maths for a diagonal array
- if ( layout == 'diagonal' ) then
- end
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment