1. Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Melee Turtle Program?

Discussion in 'General FTB chat' started by Tyken132, May 9, 2013.

  1. Tyken132

    Tyken132 New Member

    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?
  2. Torigoma

    Torigoma New Member

    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

    4: Hit enter

    5: Select Save

    6: Hit enter

    7: Hit menu

    8: type "startup" (without the ")
  3. Tyken132

    Tyken132 New Member

    Will that drop the items into a chest? I'm no expert but that looks like just a standard attack turtle.
  4. Torigoma

    Torigoma New Member

    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.
  5. Tyken132

    Tyken132 New Member

    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.
  6. Quesenek

    Quesenek New Member

    while true do
    if turtle.getItemCount(16) > 0 then
        for i = 16,1,-1 do
    This should do ya.
  7. Tyken132

    Tyken132 New Member

    Thank you very kindly, Quesenek.
  8. SmokeLuvr1971

    SmokeLuvr1971 New Member

    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.
  9. Quesenek

    Quesenek New Member

    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.
  10. BlackFire

    BlackFire New Member

    lol way to dredge up a month old thread
  11. Saice

    Saice New Member

    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

    T A B
    B H B
    B C A
  12. namiasdf

    namiasdf New Member

    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.
  13. noobbyte

    noobbyte New Member

    i recommend you do
    while true do
    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.dropDown()/turtle.dropUp() <-- change this based on direction of chest
    turtle.select(1) <-- for appearance's sake
    RedBoss likes this.
  14. SmokeLuvr1971

    SmokeLuvr1971 New Member

    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.
  15. Can someone just make a pastebin for the code? I know Java but lua is not one of my strong points.
  16. rhn

    rhn Too Much Free Time

    Here is a melee turtle script I got on my pastebin:

Share This Page