Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- lua function testing for cc 1.75
- -------------------------------------
- function digCheck()
- turtle.dig();
- local icheck = turtle.getItemDetail();
- if icheck.name == "minecraft:cobblestone" or icheck.name == "minecraft:dirt" then
- turtle.drop();
- end
- end
- function switchToEmpty()
- while not(turtle.getItemCount() == 0) do
- if (turtle.getSelectedSlot() == 16) then
- return false;
- else
- turtle.select(turtle.getSelectedSlot()+1);
- end
- end
- end
- function split(x, y)
- local itr = 1;
- local t = {};
- for i in string.gmatch(x,"[^"..y.."]+") do
- t[itr] = i;
- itr = itr+1
- end
- return t;
- end
- function tableLength(t)
- local itr = 0;
- for i in pairs(t) do
- itr = itr+1;
- end
- return itr;
- end
- function kvSplit(x,y)
- local t = {};
- s = split(x,y);
- for i=1,tableLength(s),2 do
- t[s[i]] = s[i+1];
- end
- return t;
- end
- function minerCompare(path)
- local h = fs.open(path,"r");
- local l = kvSplit(h.readAll(),">\n");
- h.close();
- a,scn = turtle.inspect();
- local item = turtle.getItemDetail();
- if scn["name"]==l[item.name] then
- return true;
- else
- return turtle.compare();
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment