Enchanting Turtle

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

MonthOLDpickle

New Member
Jul 29, 2019
219
0
0
How about the back? the back would work awesomely! Pulls in and puts back in it. Or maybe take out the anvil like you said (and make a second program for anvil cause I'd still use it)
 

menzok

New Member
Jul 29, 2019
7
0
0
Turtles can only interact with the bottom, front, or top.

you want a auto book crafter, Ok heres a quick and dirty code... I make no garrentees it works, its untested.
place a turtle (with xp table on right), a Chest with Books above it, and a chest to drop the enchanted books in front.

sorry no pastebin, im at work, cant access website.
Code:
xp = peripheral.wrap("right")
xp.setAutoCollect(true)
 
while true do
    if xp.getLevels() > 30 then
          if turtle.getItemCount(1) > 0 then
              turtle.select(1)
              xp.enchant(30)
              turtle.drop()
          else
              turtle.select(2)
              if turtle.getItemCount(2) > 0 then
                    while not turtle.suckUp() do
                        sleep (1)
                    end
              end
              turtle.transferTo(1, 1)
              turtle.select(1)
              xp.enchant(30)
              turtle.drop()
          end
    end
    sleep (60)
end
 

MonthOLDpickle

New Member
Jul 29, 2019
219
0
0
Than..I guess I will keep original one you made. It was nice in the one I found it would be able to store a bunch (no auto book making or grabbing from chests) and spit it out bottom into a chest.

Is there any way to keep what you have done...but instead it can just store books..enchant one and spit it out from front onto the ground where my transposer will pick it up and it gets sucked into a chest?
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
You could look to see what DW20 did when he setup his auto-enchanter. It interacts with an enderchest.
 

MonthOLDpickle

New Member
Jul 29, 2019
219
0
0
I just put two books in slots 1 & 2 and did anvil..book is gone - but according to monitor it did use XP..I waited 4 minutes but its missing....


**Second attempt..according to wiki I did efficiency IVx2 in hopes to make Efficiency V..book is gone.
 

menzok

New Member
Jul 29, 2019
7
0
0
Than..I guess I will keep original one you made. It was nice in the one I found it would be able to store a bunch (no auto book making or grabbing from chests) and spit it out bottom into a chest.

Is there any way to keep what you have done...but instead it can just store books..enchant one and spit it out from front onto the ground where my transposer will pick it up and it gets sucked into a chest?

Yes, ill leave it to you to figure out the changes, it might help you with coding, however this is my last time doing this for you. (fill slot 1-15 with books) slot 16 is empty
I highly suggest looking at the computercraft API wiki to see how these all work.
Code:
xp = peripheral.wrap("right")
xp.setAutoCollect(true)
 
while true do
    if xp.getLevels() > 30 then
          if turtle.getItemCount(16) == 1 then
              turtle.select(16)
              xp.enchant(30)
              turtle.drop()
          elseif turtle.getItemCount (16) > 1 then
                turtle.select(16)
                turtle.drop()
          else
                for i = 1, 15 do
                    if turtle.getItemCount (i) > 0 then
                        turtle.select(i)
                        turtle.transferTo(16, 1)
                        turtle.select(16)
                        xp.enchant(30)
                        turtle.drop()
                        break
                    end
                end
          end
    end
    sleep (60)
end

I just put two books in slots 1 & 2 and did anvil..book is gone - but according to monitor it did use XP..I waited 4 minutes but its missing....


**Second attempt..according to wiki I did efficiency IVx2 in hopes to make Efficiency V..book is gone.
Then this is a bug with richardG's Misc Peripherals then, not my code.
 

MonthOLDpickle

New Member
Jul 29, 2019
219
0
0
I will test the anvil thing in single player and see if it works there. If not oh well it's fine. Thank you...I have been reading the code while looking it up on the wiki. Learning something over here.