I haven't made a mining script so i don't know the actual names but you can just get the int via the entity hover debug option on osbot then use that int instead of a string.
so just say the id is 1111
int bronzerocki = 1111;
Entity bronzerock = objects.closest(bronzerocki);