ok its working but its only do 1 block and I have to re-enter the command ... turtle.dig()
Yes, because that command is just going to dig the first block in front of it. Because that is the entire idea as to what a cobblestone generator does (removes a cobblestone block).
If you want it to repeat the command, you will need to make a custom script ("exit()" in the LUA command window, then "edit startup"), and then enter something like this:
Code:
while true do
turtle.attack()
sleep(0.1)
end
Then press CTRL and then save it, then close it, and then type "startup".
You may also want to review the turtle programming walkthroughs out on the internet to give you some more data on how LUA programming of turtles works.