This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Uzra's profile picture

Mob grinder turtle

Started by Uzra, 07 April 2013 - 11:04 AM
Uzra #1
Posted 07 April 2013 - 01:04 PM
So I wanted to just make a simple line of melee turtles that mobs from a spawner get pushed into by water. I watched DW20's Blaze grinder video and so I just edited startup with this code:

while true do
turtle.attack()
turtle.sleep(1)
end
However for some reason, when I stand in front of the turtle after rebooting it, it doesn't hit me. I tried this with a RP2 Sapphire Sword Melee Turtle and also with a regular Diamond Sword Melee Turtle and both of them produced the same results. For the record I'm playing on a public server so I'm not sure whether that'd affect anything. Anyone know why this is happening?
Also side note, what does "000x7fff" mean? I just watched Guude's Interactive Sorter video and someone commented saying to swap a small part of code for that. I have absolutely no clue what it does though O.o
Thank you guys c:
The_Awe35 #2
Posted 07 April 2013 - 05:24 PM
hmm….I'm not sure why it wouldn't be working. make sure that your syntax and spelling is correct. Maybe try it in creative mode, and place some spawned mobs infront of it.
Brandhout #3
Posted 07 April 2013 - 05:43 PM
You might wanne try sleep() instead of turtle.sleep() ;-)

Edit: 000x7fff is hexadecimal representation of a number, so this is just a number. Just google hexadecimal :-) altough i believe it should be 0x7fff
gronkdamage #4
Posted 08 April 2013 - 12:29 AM
My grinder program.


local bEnd = false;

print( "press <SPACE> to stop attacking." )

parallel.waitForAny(
function()
  while not bEnd do
   local event, key = os.pullEvent("key");
   if key ~= 1 then
        bEnd = true;
        print("Aborting...");
   end
  end
end,
function()
  while not bEnd do
   turtle.attack()
   turtle.suck()
   sleep(0.25)
   if turtle.getItemCount(16) > 0 then
    turtle.turnLeft()
	turtle.turnLeft()
	for i = 1,16 do
	 turtle.select(i)
	 if turtle.getItemCount(i) > 0 then
	  turtle.drop()
	 end
	end
	turtle.turnLeft()
	turtle.turnLeft()
   end
   turtle.select(1)
  end
end
)