Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- function suckdropDirection()
- if input == "top" then
- turtle.dropUp()
- elseif input == "bottom" then
- turtle.dropDown()
- else
- turtle.drop()
- end
- end
- function suckDirection()
- if input == "top" then
- turtle.suckUp()
- elseif input == "bottom" then
- turtle.suckDown()
- else
- turtle.suck()
- end
- end
- function dropDirection()
- if output == "top" then
- turtle.dropUp()
- elseif output == "bottom" then
- turtle.dropDown()
- else
- turtle.drop()
- end
- end
- function drop()
- for i=5,12 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- for e=2,4 do
- if turtle.compareTo(e) then
- turtle.select(e)
- suckdropDirection()
- turtle.select(i)
- end
- end
- suckdropDirection()
- end
- end
- for i=2,4 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- dropDirection()
- end
- end
- end
- function dropNotSelected()
- if input == "top" then
- if output == "bottom" then
- turtle.drop()
- elseif output == "front" then
- turtle.dropDown()
- else
- turtle.dropUp()
- end
- elseif input == "bottom" then
- if output == "top" then
- turtle.drop()
- elseif output == "front" then
- turtle.dropUp()
- else
- turtle.dropDown()
- end
- elseif input == "front" then
- if output == "top" then
- turtle.dropDown()
- elseif output == "bottom" then
- turtle.dropUp()
- else
- turtle.drop()
- end
- end
- end
- function pattern()
- if tArgs[2] == "4" then
- while turtle.getItemCount(2) < 64 do
- turtle.select(2)
- suckDirection()
- end
- while turtle.getItemCount(5) < 64 do
- turtle.select(5)
- suckDirection()
- end
- while turtle.getItemCount(6) < 64 do
- turtle.select(6)
- suckDirection()
- end
- while turtle.getItemCount(9) < 64 do
- turtle.select(9)
- suckDirection()
- end
- for k1=3,4 do
- if turtle.getItemCount(k1) > 0 then
- turtle.select(k1)
- dropNotSelected()
- end
- end
- for k2=7,8 do
- if turtle.getItemCount(k2) > 0 then
- turtle.select(k2)
- dropNotSelected()
- end
- end
- for k3=10,12 do
- if turtle.getItemCount(k3) > 0 then
- turtle.select(k3)
- dropNotSelected()
- end
- end
- for k4=13,16 do
- if turtle.getItemCount(k4) > 0 then
- turtle.select(k4)
- dropNotSelected()
- end
- end
- elseif tArgs[2] == "8" then
- while turtle.getItemCount(2) < 64 do
- turtle.select(2)
- suckDirection()
- end
- while turtle.getItemCount(3) < 64 do
- turtle.select(3)
- suckDirection()
- end
- while turtle.getItemCount(5) < 64 do
- turtle.select(5)
- suckDirection()
- end
- while turtle.getItemCount(6) < 64 do
- turtle.select(6)
- suckDirection()
- end
- while turtle.getItemCount(7) < 64 do
- turtle.select(7)
- suckDirection()
- end
- while turtle.getItemCount(9) < 64 do
- turtle.select(9)
- suckDirection()
- end
- while turtle.getItemCount(10) < 64 do
- turtle.select(10)
- suckDirection()
- end
- while turtle.getItemCount(11) < 64 do
- turtle.select(11)
- suckDirection()
- end
- if turtle.getItemCount(4) > 0 then
- turtle.select(4)
- dropNotSelected()
- end
- if turtle.getItemCount(8) > 0 then
- turtle.select(8)
- dropNotSelected()
- end
- if turtle.getItemCount(12) > 0 then
- turtle.select(12)
- dropNotSelected()
- end
- for k4=13,16 do
- if turtle.getItemCount(k4) > 0 then
- turtle.select(k4)
- dropNotSelected()
- end
- end
- end
- end
- if tArgs[1] == "ee3" then
- if not fs.exists("ee3") then
- shell.run("clear")
- print("You ran this Program the first")
- print("Time on this Turtle. By default")
- print("this Turtle will Suck the Materials")
- print("from the Top and Drop it down.")
- print("")
- write("Press ENTER to Continue")
- read()
- print("")
- print("You can Change this after first")
- print("start by editing the ee3 file.")
- print("The first Line defines where it")
- print("comes from and the second Line")
- print("decides where it goes.")
- print("")
- print("Attention: the only accepted")
- print("Directions are top, front & bottom")
- print("Every other Entry will reset the File!")
- print("")
- write("Press ENTER to Accept and Start")
- read()
- file=fs.open("ee3","w")
- file.writeLine("top")
- file.writeLine("bottom")
- file.close()
- input="top"
- ouput="bottom"
- else
- file=fs.open("ee3","r")
- input=file.readLine()
- output=file.readLine()
- file.close()
- if not input then
- fs.delete("ee3")
- shell.run("craftify ee3 "..tArgs[2])
- end
- if not output then
- fs.delete("ee3")
- shell.run("craftify ee3 "..tArgs[2])
- end
- if not input == "top" then
- if not input == "bottom" then
- if not input == "front" then
- fs.delete("ee3")
- shell.run("craftify ee3 "..tArgs[2])
- end
- end
- end
- if not output == "top" then
- if not output == "bottom" then
- if not output == "front" then
- fs.delete("ee3")
- shell.run("craftify ee3 "..tArgs[2])
- end
- end
- end
- end
- shell.run("clear")
- print("crafting with "..tArgs[2].." Items.")
- print("input: "..input)
- print("output: "..output)
- drop()
- pattern()
- if tArgs[2] == "4" then
- q1="2"
- q2="6"
- q3="9"
- else
- q1="3"
- q2="7"
- q3="11"
- end
- for f=1,64 do
- turtle.select(4)
- turtle.craft()
- dropDirection()
- if f < 64 then
- for q = 2,q1 do
- while turtle.getItemCount(q) < 1 do
- drop()
- pattern()
- end
- end
- for q = 5,q2 do
- while turtle.getItemCount(q) < 1 do
- drop()
- pattern()
- end
- end
- for q = 9,q3 do
- while turtle.getItemCount(q) < 1 do
- drop()
- pattern()
- end
- end
- end
- end
- drop()
- shell.run("craftify ee3 "..tArgs[2])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement