How to use Meele Turtle from Computer Craft?

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

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
I wanted to experiment with what this Turtle could do, but I can't see any pre-written program specifically for this type of turtle.

How do I tell it to defend it's local area?
 

Fuubar

New Member
Jul 29, 2019
60
0
0
Unfortunately turtles don't have a means to see what is around them so they don't have a good way to hunt down mobs by themselves. You'll need to generally move the mobs to the turtle or into a constrained space and write a program that calls turtle.attack() to swing the sword.

If you're wondering why you would want to do that, the turtle will cause mobs to drop EXP orbs. Once you have a pack with thaumcraft and computercraft you could combine a turtle, a mob spawner, and a brain in a jar to make an automated exp farm.
 

danidas

New Member
Jul 29, 2019
499
0
0
That turtle is almost useless out side very limited use in mob grinders and the like as it has no AI or ability to even detect friend or foe let alone if a mob is near it or not. The only way to have it defend a area is to have it fly back and forth swinging its sword in a set pattern hoping that a mob ends up in its path.
 

Sara Dr In te House

New Member
Jul 29, 2019
59
0
0
If he does not move, like at the entrance to a mob trap, this is a simple mob killer;

while true do
turtle.attack()
end

This program will attack ANYTHING, even you, that is in front of it. If you name the program startup, it will always boot to this program. I had used this for a blaze spawner trap. Blaze rods were plentiful after that.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Ah. I see.

I'm interested in a mob farm, but with the kills registered to the player, so that there is the chance of extra loot drops. XP not such a big deal.

Does the attack command basically just swing the sword into the block directly in front of the turtle? Does this command have a fuel cost?
 

Sara Dr In te House

New Member
Jul 29, 2019
59
0
0
Ah. I see.

I'm interested in a mob farm, but with the kills registered to the player, so that there is the chance of extra loot drops. XP not such a big deal.

Does the attack command basically just swing the sword into the block directly in front of the turtle? Does this command have a fuel cost?
Turtles do drop XP, and since it does not move, there is no fuel cost.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Thank you. I'm going to experiment with them with a trap design, once I solve my FPS issues purely just with the FTB pack.

Will an enderman teleport if a turtle attacks it, or will it just stand there?
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,834
2,137
248
Couple of questions, how can I get the turtle to unload it's inventory into a chest? I have a chest placed behind the turtle. I've discovered if I fill all the turtles inventory slots, then anything it picks up is automatically loaded into the chest, but I don't really like the idea of filling the turtles inventory with clutter.

How can I stop the program when it's running (apart from breaking the turtle and putting it down again)?


Wish the CC wiki had a glossary of commands.

TIA
 

Choumiko

New Member
Jul 29, 2019
6
0
0
Couple of questions, how can I get the turtle to unload it's inventory into a chest?
use turtle.drop() when the turtle faces a chest, turtle.dropUp() / dropDown() when it's above/under a chest
How can I stop the program when it's running (apart from breaking the turtle and putting it down again)?
Wish the CC wiki had a glossary of commands.

Press and hold CTRL + T for a couple of seconds
Some usefull stuff is kind of hidden in the wiki.
Keyboard Shortcuts: http://computercraft.info/wiki/Computer
Also check out the Turtle-api: http://computercraft.info/wiki/index.php?title=Turtle_(API)
 

elric1976

New Member
Jul 29, 2019
3
0
0
Hello,

So I have tried to copy paste the code

while true do
turtle.attack()
end

but it only pastes

while true d

and when I try to enter the rest of it after pressing enter is says no such program.

What am I doing wrong.

Please help I really do not feel like hearing things like go play something else or random insults. If you don't have any advise please do not say anything at all. I need help with this.

Thank you
 

voidreality

New Member
Jul 29, 2019
117
0
0
Best way I found to attack and empty inventory is this. This assumes the chest is below the turtle.

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

Saice

New Member
Jul 29, 2019
4,020
0
1
SInce this necro'd let me use some magic.

If you want to defend an area TC Iron golems (with visor, armor, and bow upgrades) will do that job vary nicely.
 

elric1976

New Member
Jul 29, 2019
3
0
0
the thing is. it wont let my type multiple lines. i press enter to move down a line to type more and it says no such program. turtle.attack() doesnt even work. is there something else i need to do to type the commands in?
 

danidas

New Member
Jul 29, 2019
499
0
0
You have to tell the turtle that you want to write a program.

Use:

edit startup

Than paste in the code followed by hitting ctrl and selecting save.

This way the turtle will automatically begin attacking when the world loads.

Also note that I never used a turtle or computer craft ever and found that with a very quick and easy google search for "how to program a turtle".
 

Galbi3000

Member
Jul 29, 2019
6
0
11
Hello,

So I have tried to copy paste the code

while true do
turtle.attack()
end

but it only pastes

while true d

and when I try to enter the rest of it after pressing enter is says no such program.

What am I doing wrong.

Please help I really do not feel like hearing things like go play something else or random insults. If you don't have any advise please do not say anything at all. I need help with this.

Thank you

You can find the programs from the turtle's drive stored in a folder in the world's save folder.

If you are using a Feed The Beast mod pack then finding the save folder is easy:
  1. Click on the button above the list of packs labelled "Edit Mod Pack" and in the window click the button labelled "Open Folder" under the list of mods. This will open Windows Explorer at the location for the mods in the pack.
  2. Go up one folder level and you should see a folder called "saves". Open that and then open the folder with the same name as your world.
  3. Now you should see a folder called "computer", open that and you will find one or more folders as just a number, starting at 0. These are the disk drives for the computers and turtles you have in the world.
  4. You will have to figure out which one is for the turtle you are using but once you find it any programs you have in the turtle are stored in that folder. They are plain text files and can be edited with any text editor like Notepad. Editing this way allows full cut'n'paste and you can edit the files while Minecraft is still running, the Computer/Turtle will register the changes the next time the edited program is run.
If you are using some other mod pack loader or a custom mod pack of your own creation then you may have to search for your saves folder. The default place for vanilla Minecraft is in %APPDATA%\.minecraft\saves\ (just enter that into Windows Explorer and it will take you there, unless you manually changed the location like I do with mine!)

A tip for making sure a computer or turtle always references the same numbered folder no matter how many times you dig it up then place it is to label the computer or turtle. At the computer or turtle's prompt just type "label set [name]" (without the quotes or square brackets of course). Without this being done every time you dig up your turtle or computer then place it down again it will create a new numbered folder in that computer folder without the files you previously had.

I prefer to edit my ComputerCraft programs this way as I have a programmer's editor that can do command colouring for Lua scripts. Plus editing this way is far more responsive than the built in editor in ComputerCraft as your PC is far faster at responding to keypresses and being able to cut'n'paste blocks of code makes creating similar functions a lot quicker!
 
Last edited:

Galbi3000

Member
Jul 29, 2019
6
0
11
Best way I found to attack and empty inventory is this. This assumes the chest is below the turtle.

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

Quick tip for you, use 0.1 instead of 1 in the sleep command for a faster attack ;)

This is my mob farm turtle attack program:

Code:
while true do
  for slot = 1,16 do
    sleep(0.1)
    turtle.attack()
    turtle.select(slot)
    if turtle.getItemCount() > 0 then
      turtle.drop()
    end
  end
end

I have 4 turtles so the turtle.drop() does not need a chest as a vacuum hopper from OpenBlocks sucks up the dropped items as well as the XP orbs.
The program does an attack per inventory slot it checks. This makes the attacks on mobs stay fast and consistent for quicker kills :)
 

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
The necro thread has been necroed once more!
And not only have this years old thread been necroed, the people that it is being necroed to "help" have not been online for years :p