When Turtles Attack

EZ2Remember

New Member
Jul 29, 2019
45
0
0
Can someone post a script to make Turtles attack, it would be much appreciated. I watched one of Direwolf20's recent episodes where he used Turtles to help him farm XP, but after following his direction I can not get the Turtles to attack.
 

eculc

New Member
Jul 29, 2019
163
0
0
are you editing the startup program? if you're not, you'll have to start the program each time you want it to begin the loop, and while it should continue indefinitely the turtle will stop if the chunk becomes unloaded.
 

EZ2Remember

New Member
Jul 29, 2019
45
0
0
Yes, I edited the startup program. I followed along with the video but I think some details were left out assuming the viewer knew the basics of Turtle programming, which I don't.
 

SaintNicster

New Member
Jul 29, 2019
36
0
0
Can someone post a script to make Turtles attack, it would be much appreciated. I watched one of Direwolf20's recent episodes where he used Turtles to help him farm XP, but after following his direction I can not get the Turtles to attack.
His entire script is right there at 13:31.
Code:
while true do
  turtle.attack()
  sleep(1) 
end

You put that code into the startup program, then restart the turtle. Run the program "reboot" from the command line, or by holding down CTRL+R until the screen refreshes.
 

jumpfight5

New Member
Jul 29, 2019
1,750
0
1
It works fine for me, no fuel or nothing. Perhaps you could put a chunk loader module on it? Place 8 stone in a circle around a redstone torch, and craft that with any chunk loader. Then, add it to a turtle with only one add-on, and you've got yourself a chunk loading turtle. It's an alternative to eculc's method, a bit easier on the coding skills you may have, but you'll have to fix it if there is a server reset.

Alternatively, you can just place a chunk loader in the chunk the turtles are in.
 

eculc

New Member
Jul 29, 2019
163
0
0
It didn't look like it to me, I have no experience with turtles but I think it should be as simple as was shown in the video.

Pre-post edit after testing: works for me, even without the sleep in the code. are you sure you're running the program? you need to make sure you save it, exit out, and you can test by just typing "startup" (without quotes) into the prompt and hitting enter (I don't remember the keyboard shortcut for restarting the turtle, I believe that's what dire does in his video)
 

EZ2Remember

New Member
Jul 29, 2019
45
0
0
Yes! Works now. Thank you all and especially SaintNicster. I didn't know I had to reboot. I did like you said (Run the program "reboot" from the command line) and now it works.
 

egor66

New Member
Jul 29, 2019
1,235
0
0
k here is what I like to do: make your pastebin account, ingame in the turtle gui, we will call the program Attack so type as follows,

label set "random name here",

this will allow the turtle to save programs & keep its fuel level on breaking next, we will make the 2 line program type,

edit Attack
i = true
while i do turtle.attack() end

press crtl & save then crtl again & exit, run by typing Attack, the turtle should just show Attack, if its shows any error just check spacing or (), if you need to you can uplaod to pastebin remember to note down the random letters after / & then you can download into other turtles as needed.

I did not detail the up/down load as really you need to learn that for your self.
 

jumpfight5

New Member
Jul 29, 2019
1,750
0
1
How do I stop them from picking up the Blaze Rods?

Well, my idea is not very good, not at all. What I do is fill up all the turtle's inventory slots, with whatever, I just put 1 piece of cobble each slot.
When it's full, it'll automatically put things into an inventory or through a filter or whatever. It's not the best way, but it works for my purposes, no coding necessary!
 

egor66

New Member
Jul 29, 2019
1,235
0
0
after label set you can fill the turtles inventory with what ever fuel you like & type "refuel all" the turtle will store all fuel in its buffer & use as needed, & when label is set it will not lose fuel level when broken.

yes its manual but if your turtle is not moving a lot you do not need much fuel at all, mining uses a lot of fuel, static attack turtle uses none..that should be fixed mho.
 

EZ2Remember

New Member
Jul 29, 2019
45
0
0
You guys are great! Thanks for taking the time to explain this. I'll try it out when I get home tonight.
 

Blastedsura

New Member
Jul 29, 2019
138
0
0
if you put a chest or another inventory like a relay or something below the turtles, you can use turtle.dropDown() so they drop what they have in the inventory.
 

egor66

New Member
Jul 29, 2019
1,235
0
0
if you put a chest or another inventory like a relay or something below the turtles, you can use turtle.dropDown() so they drop what they have in the inventory.
chest yes, relay no there are issues with relays atm try not to use them at all or limited use only.
 

Vircomore

New Member
Jul 29, 2019
61
0
0
if you're using some other system to pick up items (transposers and water flow, for example) you can just add to your attack script to make the turtles spit them out:

while true do
turtle.attack()
turtle.drop()
sleep(0.3)
end
 
  • Like
Reactions: RedBoss

RedBoss

New Member
Jul 29, 2019
3,300
0
0
if you're using some other system to pick up items (transposers and water flow, for example) you can just add to your attack script to make the turtles spit them out:

while true do
turtle.attack()
turtle.drop()
sleep(0.3)
end
in my script i have turtle.drop(64)

but just that line works either way. nice short and sweet script