How do I transfer XP from one XP turtle to another

  • 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

dlrdlrdlr

New Member
Jul 29, 2019
7
0
0
I have a group of attack turtles collecting xp from a mob grinder and another turtle that comes around and is supposed to take the xp they have collected and use it to enchant. however the get() getUp() and getDown() commands don't seem to transfer xp at all.
This if the code for the attack turtles.
Code:
m = peripheral.wrap("right")
m.setAutoCollect(true)
while true do
  if turtle.attack() then
    for i = 1,16 do
      turtle.select(i)
      turtle.dropDown()
    end
  end
end
and the code for the other turtle is this.
Code:
m = peripheral.wrap("left")
while true do
for i=1,8 do
    turtle.forward()
    m.getDown()
end
turtle.turnRight()
turtle.turnRight()
for i = 1,8 do
turtle.forward()
end
sleep(60)
end
 

KyoNeko66

New Member
Jul 29, 2019
96
0
0
As far as i am aware, transfering exp betwene turtles isn't possible. You could however have the attack turtles as.. Just attack turtles, without the enchanting part. Which makes them leave the exp on the ground. Then have the enchanting turtle come by to collect the exp and enchant with it. I dont know yoursetup so i cant say that i can perfectly edit your programs. But the result with my suggestion would become.

Code:
while true do
  if turtle.attack() then
    for i = 1,16 do
      turtle.select(i)
      turtle.dropDown()
    end
  end
end


Code:
m = peripheral.wrap("left")
m.setAutoCollect(true)
while true do
for i=1,8 do
    turtle.forward()
end
turtle.turnRight()
turtle.turnRight()
for i = 1,8 do
turtle.forward()
end
sleep(60)
end

I am not sure if the movement is acually needed with this setup, as the XP turtle will collect the exp automaticly now, but a XP turtle's range is (if i remember correctly of the top of my head) only 5x5. So it might not get all the exp as you seem to use 9 melee turtles.

Some other thigns which i seem to notice in your code is that your exp turtle:
1. Does infact, not enchant anything.
2. Does not turn around before/after collecting the exp, which means that after each round it will need to get replaced/turned manually.

A other minor thing is that the melee turtle seems to empty its whole inventory each hit it makes, horribly ineffecient i would say.

I cant recall the codes for picking out one book and enchanting part. But im sure someone else does, and if all fails Dire used it somewhere in his video's. Eiter way my suggestion for these turtles, to keep there same basic uses would be:

Code:
X = 0
while true do
  if turtle.attack() then
    X = X + 1
  end
  if X = 100 then
    for i = 1,16 do
      turtle.select(i)
      turtle.dropDown()
      X = 0
    end
  end
end

Code:
m = peripheral.wrap("left")
m.setAutoCollect(true)
while true do
turtle.turnRight()
turtle.turnRight()
for i=1,8 do
    turtle.forward()
end
turtle.turnRight()
turtle.turnRight()
for i = 1,8 do
turtle.forward()
end
sleep(60)
--[[enter turtle level check and whole enchanting progress here and after]]--
end
 

dlrdlrdlr

New Member
Jul 29, 2019
7
0
0
I agree with your statements and thanks, the forum post includes commands for getting xp from other XP turtles but perhaps that isn't actually implemented yet that was my main issue, the code I put together to test my idea and isn't complete yet, so I'll definitely check out your recommendations
 

KyoNeko66

New Member
Jul 29, 2019
96
0
0
Then that would be a new/upcoming feature prehaps. I dont keep track of all mod updates so if that got added i surely wouldn't notice untill someone tells me to.. At least i know now. But good luck with it, the code i wrote down is still lacking and just something quickly written down. I would need to see your acuall setup and do a tiny bit of googling to make it fully operational.. Beside that im sure there will be many people who are much more capable at it then me eiter way.