Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dig="dig";
- dug="dug";
- nodes={};
- nodes.x0y0z0=dug;
- nodes.x1y0z0=dig;
- nodes.x1y1z0=dig;
- nodes.x1y1z1=dig;
- godig={};
- index={};
- xyz={};
- for key, value in pairs(nodes) do
- if ( value == dig ) then
- index.z = string.find(key, "z");
- index.y = string.find(key, "y");
- index.x = string.find(key, "x");
- xyz.z = tonumber(string.sub(key, (index.z +1)));
- xyz.y = tonumber(string.sub(key, (index.y +1), (index.z -1)));
- xyz.x = tonumber(string.sub(key, (index.x +1), (index.y -1)));
- local str = tostring("x" .. (xyz.x +1) .. "y" .. (xyz.y +0).. "z" .. (xyz.z +0));
- print(str);
- if (nodes.[str] = dug) then godig.[str] = "x+"; end
- local str = tostring("x" .. (xyz.x +0) .. "y" .. (xyz.y +1).. "z" .. (xyz.z +0));
- if (nodes.[str] == dug) then godig.[str] = "y+"; end
- local str = tostring("x" .. (xyz.x +0) .. "y" .. (xyz.y +0).. "z" .. (xyz.z +1));
- if (nodes.[str] == dug) then godig.[str] = "z+"; end
- local str = tostring("x" .. (xyz.x -1) .. "y" .. (xyz.y +0).. "z" .. (xyz.z +0));
- if (nodes.[str] == dug) then godig.[str] = "x-"; end
- local str = tostring("x" .. (xyz.x +0) .. "y" .. (xyz.y -1).. "z" .. (xyz.z +0));
- if (nodes.[str] == dug) then godig.[str] = "y-"; end
- local str = tostring("x" .. (xyz.x +0) .. "y" .. (xyz.y +0).. "z" .. (xyz.z -1));
- if (nodes.[str] == dug) then godig.[str] = "z-"; end
- print("digdug");
- end
- print("test");
- end
- print(tostring(godig));
- for key, value in pairs(godig) do
- print(tostring(key));
- print(tostring(value));
- print("test2");
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement