Melee Turtle Program?

  • 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

Tyken132

New Member
Jul 29, 2019
70
0
0
I'm looking for a very simple turtle problem that will kill monsters and drop their items below it into a chest.

Anyone got one?
 

Torigoma

New Member
Jul 29, 2019
103
0
0
1: Right click the turtle.

2: type "edit startup" (without the ")

3: type as you see below, with the second line 2 spaces forward, and the first and third line without spaces.
while true do
turtle.attack()
end

4: Hit enter

5: Select Save

6: Hit enter

7: Hit menu

8: type "startup" (without the ")
 

Tyken132

New Member
Jul 29, 2019
70
0
0
Will that drop the items into a chest? I'm no expert but that looks like just a standard attack turtle.
 

Torigoma

New Member
Jul 29, 2019
103
0
0
Turtles automatically pick up anything that drops from what they kill. If you want to put them somewhere else, just pump it into chests with Transport Pipes.
 

Tyken132

New Member
Jul 29, 2019
70
0
0
Well, I tend to try to stay away from BC for a number of reasons, plus It just seems simpler to have the turtles drop the items into a relay. I just have no idea how to code a turtle to output items on its own.
 

Quesenek

New Member
Jul 29, 2019
396
0
0
Code:
while true do
turtle.attack()
if turtle.getItemCount(16) > 0 then
    for i = 16,1,-1 do
        turtle.select(i)
        turtle.dropDown()
    end
end
This should do ya.
 

SmokeLuvr1971

New Member
Jul 29, 2019
753
0
0
Code:
while true do
turtle.attack()
if turtle.getItemCount(16) > 0 then
    for i = 16,1,-1 do
        turtle.select(i)
        turtle.dropDown()
    end
end
This should do ya.

This is good, but flawed in that the turtle inventories fill up almost to max before dumping anything. I'd prefer the turtle drop anything as soon as it's sucked in, but then I'm not sure parsing through/dropping all inventory slots are really necessary. It would ensure everything gets dropped though.

I had code where the turtle would drop everything at the start, and then go into attack mode for a bit. Then loop back to clear inventory. HDD crashed and no backup so I'm in the process of recreating my scripts. Only one I managed to save was my Wrath Furnace - single turtle script.
 

Quesenek

New Member
Jul 29, 2019
396
0
0
The reasoning behind dumping the inventory all at once is keep the attacking to a maximum. With a tier 5 spawner even with a drop the mobs can back up on you.
Each iteration of the inventory dump takes time away from attacking.
If you want to keep the inventory empty then I think all you need is a pipe hooked up to the turtle. No need for any code.
 

Saice

New Member
Jul 29, 2019
4,020
0
1
fill the turtle with unwanted items

All drops will shot out back on him. Make a small box behind him so stuff collects there.

Then all you need is hoppers to collect the drops if you dont like BC this is all vanilla

Code:
T A B
B H B
B C A

T=Turtle
A=Air
B=Block
C=Chest
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
Obsidian pipes with an engine works as well. I'm not sure about the range, or how much MJ it'll require to extend it to your needs, but it shouldn't be too much.
 

noobbyte

Active Member
Jul 29, 2019
37
0
26
i recommend you do
while true do
turtle.attack()
sleep(0.5) <-- this should be included otherwise a server admin may yell at you :p
if turtle.getItemCount(1) > 0 then
for i = 1, 16 do
turtle.select(i)
turtle.dropDown()/turtle.dropUp() <-- change this based on direction of chest
end
turtle.select(1) <-- for appearance's sake
end
end
 
  • Like
Reactions: RedBoss

SmokeLuvr1971

New Member
Jul 29, 2019
753
0
0
So far I'm using them in my mystworld mob farms/grinders. Didn't know about the pipes but my turtles sit at head height, with transposers in the floor beneath them, so I'm not sure I'd be able to get all the drops if I replace the transposers with pipes. Pipes might stop the XP flow too [in my design]. I had the turtles on the ground and they were stopping the XP orbs.

Also, my design isn't optimized for spawning rates. My cages have T5 solely because I can redstone them off, which allows multiple spawners per enclosure/spawn area. And my turtles can't keep up as it is. The only design I utilize that's optimized for spawning rates is a Blaze room [11x11x10 ID] where they fall into water and the rods get fed to my generators via a router.

When I parsed your code, I envisioned the turtles holding onto the drops for a little while before dropping inventory. When the grinder is running, this isn't an issue. But when it's shutoff, the turtles will hold their inventories until it's turned on again. Which could be an issue, depending on how badly you need those drops [worst case - each turtle retaining 15 stacks of the desired item]. In particular for the pigmen, I have 2 turtles that craft swords/nuggets into ingots and it's best that they don't get too much all at once or that system gets clogged.

And I seem to have an uncanny ability to necro-rez just about any topic.

Another thought that's beyond my capabilities for the moment, would be to keep your code as-is but have the turtles be wireless. And with a wireless computer nearby, have the computer issue a dump-all to the turtles when the grinder is shutoff. This way you'd max attack time and get all the drops too. I plan to work this idea into my farms as sometimes the turtles don't load properly and it's kind of a pain to check each one to see if it's running or not. My original idea was to have a computer at each farm rebooting the turtles, with possible confirmations from the turtles, prior to starting up the spawner. Once I get that working, shouldn't be too hard to throw in a dump-all too.
 
C

ctrl.alt.elite

Guest
Can someone just make a pastebin for the code? I know Java but lua is not one of my strong points.