↓ Содержание ↓
↑ Свернуть ↑
|
local Sp={...}
if #Sp<1 then
print("Programm MicroCommander 1.3")
print("For easy use Turtle CC 1.33")
print("Designed by DaemonLOG")
print("Usage: mc string of microcommand")
print("l[]-Left,r[]-Right, f[]-Forward")
print("u[]-Up, d[]-Down, b[]-Back")
print("o[]-Dig, p[]-Place, s[]-Select")
print("i-IfinityDig,c-Pause,v-DigDown")
print("Example: mc fullfbr2b")
print("version 3.7 (DiggerDraw) is available")
return end
local function Exec(B,A)
if B=="b" then for B=1,A do turtle.back() end end
if B=="c" then sleep(A) end
if B=="d" then for B=1,A do turtle.digDown() turtle.down() end end
if B=="f" then for B=1,A do turtle.dig() turtle.forward() end end
if B=="i" then while not rs.getInput("back") do turtle.dig() end end
if B=="l" then for B=1,A do turtle.turnLeft() end end
if B=="o" then if A>3 then A=A%4 turtle.digUp() end
if A>1 then A=A%2 turtle.dig() end
if A==1 then turtle.digDown() end end
if B=="p" then if A>3 then A=A%4 turtle.placeUp() end
if A>1 then A=A%2 turtle.place() end
if A==1 then turtle.placeDown() end end
if B=="r" then for B=1,A do turtle.turnRight() end end
if B=="s" then turtle.select(A) end
if B=="u" then for B=1,A do turtle.digUp() turtle.up() end end
if B=="v" then local B,C=1,0
while B==1 do turtle.dig() turtle.digDown()
if turtle.down() then C=C+1 else B=0 end end
turtle.select(9)
while C>0 do C=C-1 turtle.up()
if C%2==1 then turtle.place() turtle.placeDown() end end
for B=1,2 do turtle.placeDown() turtle.dig() turtle.forward()
end end end
local function Chr(S,B) return string.char(string.byte(S,B)) end
local function Com(S,B)
local C=Chr(S,B) local A,D=C,"" B=B+1 C=Chr(S,B)
while (C>="0") and (C<="9") do
D=D..C B=B+1 C=Chr(S,B) end
return A,tonumber(D) or 1,B end
local A,B,C,D=string.lower(Sp[1]),0,0,0
while B<=#A do C,D,B=Com(A,B) Exec(C,D) end
↓ Содержание ↓
↑ Свернуть ↑
|