Something went wrong. Try again.
A bunch of computer craft scripts
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159---- CLOMA-- CUTE LITTLE OBSOLETE MINING ASSISTANT--
-- ERRORSlocal ERR_MOVE_OOB = 2local ERR_NO_FUEL = 3local ERR_MOVE_BLOCKED = 4local ERR_MOVE_UNKNOWN = 5
-- IMPORTANT VARSlocal x, y, z = 0, 0, 0
local last_row = false
local max_x = 15local max_z = 15
print("[-] CLOMA is booting up..")
function exit() while (y > 0) do turtle.up() y = y - 1 endend
function isFull() for i = 1, 16 do if turtle.getItemCount(i) == 0 then return false; end end
for i = 1, 16 do local name = turtle.getItemDetail(i).name
print(name) if name == "minecraft:cobblestone" or name == "minecraft:dirt" or name == "minecraft:diorite" or name == "minecraft:gravel" then turtle.select(i) turtle.drop(turtle.getItemCount()) turtle.select(1)
return false; end end
return true;end
function rotate() if z % 2 == 0 then turtle.turnRight() else turtle.turnLeft() endend
-- pls fix function names, stop late night codingfunction trueDig() while (true) do if turtle.detect() then turtle.dig() sleep(0.1) else break; end endend
function dig() if isFull() then exit() return false end
if turtle.getFuelLevel() == 0 then turtle.refuel() end
trueDig() if turtle.forward() then x = x + 1
if x == max_x and last_row then last_row = false z = 0 rotate() for i = 1, max_z do turtle.forward() end rotate() turtle.digDown() if turtle.down() then y = y + 1 x = 0 else return false end elseif x == max_x then rotate() x = 0 trueDig() if turtle.forward() then rotate() z = z + 1 if z == max_z then last_row = true end end end end
return trueend
while (true)do if dig() == false then print("exited"); break; endend
-- function moveX(goForward)-- local newX = x---- if goForward then-- newX = x + 1-- else-- newX = x - 1-- end------ if newX > 16 then-- return ERR_MOVE_OOB-- end------ if ()---- local forward = turtle.forward()---- if forward then-- x = newX-- return true-- end---- if forward == "Movement obstructed" then-- return ERR_MOVE_BLOCKED-- end---- return ERR_MOVE_UNKNOWN-- end