Hello i have the direwolf pack and i'm struggling with melee turtles. I can't really program them, does anybody know what to do? I'm making a mob grinder and i want them to constantly kill the mob infront of them and dont pick up items (if thats possible) or else just put the items in a chest/pipe under the turtle.
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
I need help with melee turtles!
Best Answer Hippieshaman , 01 March 2013 - 07:36 PM
while true do turtle.attack() end
This will make the turtle attack everything in front of it (including you!) endlessly, you have to terminate it by holding ctrl+T if you want to end the program. Fill the turtles inventory with cobblestone and it wont be able to pick up items.
If you want it to pick up items and drop it into a chest directly below the turtle, use this:
while true do turtle.attack() i = turtle.getItemCount(16) if i == 64 then for j=1,16 do turtle.select(j) turtle.drop() end turtle.select(1) end end
Note that I am not 100% sure the above code will work, but I think it should.
Go to the full post »
#1
Posted 01 March 2013 - 06:41 PM
#2
Posted 01 March 2013 - 07:36 PM
while true do turtle.attack() end
This will make the turtle attack everything in front of it (including you!) endlessly, you have to terminate it by holding ctrl+T if you want to end the program. Fill the turtles inventory with cobblestone and it wont be able to pick up items.
If you want it to pick up items and drop it into a chest directly below the turtle, use this:
while true do turtle.attack() i = turtle.getItemCount(16) if i == 64 then for j=1,16 do turtle.select(j) turtle.drop() end turtle.select(1) end end
Note that I am not 100% sure the above code will work, but I think it should.
#3
Posted 01 March 2013 - 07:52 PM
#4
Posted 01 March 2013 - 08:30 PM
While True do Is a loop
~TheLaw
If you didn't like me, that your problem not mine.
Anything that advertises(on the side ads over whatever) causes malware or dissatisfaction BUT MINECRAFT DOESENT advertise at ALL
#5
Posted 01 March 2013 - 08:38 PM
#6
Posted 01 March 2013 - 08:41 PM
so you first write While true do
and can you make it so it only attacks mobs not yourself?
#7
Posted 01 March 2013 - 08:45 PM
Probably so but I don't know.
~TheLaw
If you didn't like me, that your problem not mine.
Anything that advertises(on the side ads over whatever) causes malware or dissatisfaction BUT MINECRAFT DOESENT advertise at ALL
#8
Posted 01 March 2013 - 09:37 PM
and can you make it so it only attacks mobs not yourself?
No, there is no function available that makes you able to see the difference between players and mobs.
#9
Posted 01 March 2013 - 09:39 PM
Probably so but I don't know.
while true do turtle.attack() endThis will make the turtle attack everything in front of it (including you!) endlessly, you have to terminate it by holding ctrl+T if you want to end the program. Fill the turtles inventory with cobblestone and it wont be able to pick up items.
If you want it to pick up items and drop it into a chest directly below the turtle, use this:
while true do turtle.attack() i = turtle.getItemCount(16) if i == 64 then for j=1,16 do turtle.select(j) turtle.drop() end turtle.select(1) end endNote that I am not 100% sure the above code will work, but I think it should.
The one with dropping the items in chests didnt work.
#10
Posted 01 March 2013 - 10:25 PM
Just do this:
Make a new file called 'startup'. You have to call it startup otherwise it will not automatically load up when you open the world.
Now type in this code:
while true do turtle.attack() turtle.select(1) turtle.dropDown() turtle.select(2) turtle.dropDown() turtle.attack() turtle.select(3) turtle.dropDown() turtle.select(4) turtle.dropDown() turtle.attack() turtle.select(5) turtle.dropDown() turtle.select(6) turtle.dropDown() turtle.attack() turtle.select(7) turtle.dropDown() turtle.select(8) turtle.dropDown() end
...if you have a chest under it.
You can continue this setup until turtle.select(16) if you want.
-ZL123
Hope I helped!
YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234
#11
Posted 02 March 2013 - 12:01 AM
while true do for x=0,15 do turtle.attack() turtle.select(x) turtle.dropDown() end end
Snapshot Server: snap.vipersrt3g.net
#12
Posted 02 March 2013 - 06:35 AM
You can also substitute the following for all of that.
while true do for x=0,15 do turtle.attack() turtle.select(x) turtle.dropDown() end end
I think that the first slot is 1, not 0.
-ZL123
Hope I helped!
YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234
#13
Posted 02 March 2013 - 08:48 AM
Snapshot Server: snap.vipersrt3g.net
#14
Posted 02 March 2013 - 12:15 PM
you guys are making the turtle drop items for every attack cycle, there is no need to select the whole inventory then since there will be 1-2 different items in there.
#15
Posted 02 March 2013 - 03:23 PM
you guys are making the turtle drop items for every attack cycle, there is no need to select the whole inventory then since there will be 1-2 different items in there.
I think up to a maximum of 4 should be enough, yeah.
-ZL123
Hope I helped!
YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234
#16
Posted 02 March 2013 - 04:26 PM
I think up to a maximum of 4 should be enough, yeah.
Or, the turtle could drop items after every 5 attack cycles, and clear the whole inventory.
When in Trouble or in Doubt, Run in circles, Scream and Shout!
#17
Posted 02 March 2013 - 04:29 PM
#18
Posted 02 March 2013 - 05:05 PM
This should work:
while true do turtle.attack() while turtle.getItemCount(16) > 1 do for x=0,15 do turtle.select(x) turtle.dropDown() end end end
-ZL123
Hope I helped!
YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234
#19
Posted 02 March 2013 - 05:06 PM
This should work:
while true do turtle.attack() while turtle.getItemCount(16) > 1 do for x=0,15 do turtle.select(x) turtle.dropDown() end end end
Do you need to write end three times?
#20
Posted 02 March 2013 - 05:09 PM
Do you need to write end three times?
Yes, definitely.
-ZL123
Hope I helped!
YT: http://youtube.com/ZL234
Twitter: https://twitter.com/ZL234
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users