-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtapi.lua
More file actions
39 lines (34 loc) · 733 Bytes
/
tapi.lua
File metadata and controls
39 lines (34 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function t(code)
local t=trackedTurtle or turtle
d={
["f"]=t.forward,
["u"]=t.up,
["d"]=t.down,
["b"]=t.back,
["l"]=t.turnLeft,
["r"]=t.turnRight,
["F"]=t.dig,
["U"]=t.digUp,
["D"]=t.digDown,
["P"]=t.place,
["_"]=function()end
}
(code or ""):gsub(".",
function(c)
if c:find("%d")
then
t.select(c)
else
d[c]()
end
end)
end
function stairsUp(k)
return ("uUFfUFD"):rep(k)
end
function tunnel2(k)
return string.rep("FfU",k)
end
function tunnel2square(k)
return (tunnel2(k).."r"):rep(4)
end