Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local last=4
- shell.run("clear")
- print([["Welcome to Crafty..
- Use qwe,asd,xcv for crafting grid.
- 1..6 for inventory slots.
- Space to craft, k to abort."]])
- turtle.select(4)
- turtle.suck()
- turtle.select(8)
- turtle.suck()
- turtle.select(12)
- turtle.suck()
- for i=16,13,-1 do
- turtle.select(i)
- turtle.suck()
- end
- while true do
- function slot(a)
- turtle.select(a)
- last=a
- end
- function cg(a)
- turtle.select(a)
- turtle.drop()
- turtle.select(13)
- turtle.suck()
- turtle.select(last)
- turtle.drop()
- turtle.select(a)
- turtle.suck()
- c=turtle.getItemCount(a)
- turtle.drop(c-1)
- turtle.select(last)
- turtle.suck()
- end
- event, key=os.pullEvent()
- if key=="1" then
- slot(4)
- elseif key=="2" then
- slot(8)
- elseif key=="3" then
- slot(12)
- elseif key=="4" then
- slot(16)
- elseif key=="5" then
- slot(15)
- elseif key=="6" then
- slot(14)
- elseif key=="q" then
- cg(1)
- elseif key=="w" then
- cg(2)
- elseif key=="e" then
- cg(3)
- elseif key=="a" then
- cg(5)
- elseif key=="s" then
- cg(6)
- elseif key=="d" then
- cg(7)
- elseif key=="x" then
- cg(9)
- elseif key=="c" then
- cg(10)
- elseif key=="v" then
- cg(11)
- elseif key==" " then
- turtle.select(4)
- turtle.drop()
- turtle.select(8)
- turtle.drop()
- turtle.select(12)
- turtle.drop()
- for i=16,13,-1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(16)
- turtle.craft()
- return
- elseif key=="k" then
- return
- end end
Add Comment
Please, Sign In to add comment