var repair = 4; var damageGet = 1; var itemID = 274; var maxDamage = 120;
var power = 5+Math.sqrt(mining_lvl*2); var breakSpeech = "I will have to mine some other time";
var tool = [12, 12, 12, 22, 4, 82, 6]; itemUsed = true; mainSkill = mining_lvl;

if (pinv.getCurrentItem() != null)
{if (pinv.getCurrentItem().itemID == itemID) {var ent = pinv.getCurrentItem(); player.swingMainHand();}}
if (pinv.getOffhandItem() != null) 
{if (pinv.getOffhandItem().itemID == itemID) {var ent = pinv.getOffhandItem(); player.swingOffHand();}}

if (hitBlock != null) {time.sleep(0.05);
script.runScript("destructable blocks.js");}