Skip to content

Instantly share code, notes, and snippets.

@somebody1234
Last active September 6, 2019 00:16
Show Gist options
  • Save somebody1234/29165416e931a03c61340a708cd86799 to your computer and use it in GitHub Desktop.
Save somebody1234/29165416e931a03c61340a708cd86799 to your computer and use it in GitHub Desktop.
Diamond Hunt Mobile Wiki helpful scripts. Use in browser console on https://diamondhunt.app
// Script to get the loot table for an area, to be placed in https://diamondhuntmobile.fandom.com/wiki/Module:Area_DB
area='hauntedMansion'; // replace with the area you're looking for, capitalized the same way.
showExploringDropRates(area+'Loot');c=s=>s[0].toUpperCase()+s.slice(1).replace(/([a-z])([A-Z])/g,'$1 $2');setTimeout(_=>console.log('{'+[...$('#dialogue-confirm-text .table-stats')[0].children[0].children].slice(1).map(e=>'{\''+c(e.children[0].children[0].src.match(/\w+(?=\.png)/)[0])+'\','+((t=e.children[1].innerText).includes('-')?t.split(' - ')[0]:t).replace(/,/g,'')+','+(t.includes('-')?t.split(' - ')[1]:t).replace(/,/g,'')+','+e.children[2].innerText.slice(2).replace('*','')+','+(!!e.children[3])+','+e.children[2].innerText.includes('*')+'}').join(',').replace(/(,false)?,false}/g,'}')+'}'),1000)
enemy='bloodChicken'; // replace with the enemy you're looking for, capitalized the same way.
sendBytes('EXAMINE_MONSTER_LOOT='+enemy);c=s=>s[0].toUpperCase()+s.slice(1).replace(/([a-z])([A-Z])/g,'$1 $2');setTimeout(_=>console.log('{'+[...$('#dialogue-confirm-text .table-stats')[0].children[0].children].slice(1).map(e=>'{\''+c(e.children[0].children[0].src.match(/\w+(?=\.png)/)[0])+'\','+((t=e.children[1].innerText).includes('-')?t.split(' - ')[0]:t).replace(/,/g,'')+','+(t.includes('-')?t.split(' - ')[1]:t).replace(/,/g,'')+','+e.children[2].innerText.slice(2).replace('*','')+','+(!!e.children[3])+','+e.children[2].innerText.includes('*')+'}').join(',').replace(/(,false)?,false}/g,'}')+'}'),1000)
// before opening crafter page
craftingResearchLevel=6
// open crafter recipes page and paste
c=s=>s[0].toUpperCase()+s.slice(1).replace(/([a-z])([A-Z\d])/g,'$1 $2');'return {\n'+[...$('#item-section-crafting-3 .main-button-table-tr-td2')].map(i=>`{'${i.children[0].innerText}','${i.parentElement.children[0].children[0].src.match(/\w+(?=\.png)/)[0]}',${(r=i.children[2]).children[2].innerText.match(/\d+/)[0]},{${[...r.children].map((e,i)=>i>=4&&i%3===1?`{'${c(r.children[i].src.match(/\w+(?=\.png)/)[0])}',${r.children[i+1].innerText.match(/[\d,]+/)[0].replace(/,/g,'')}}`:'').filter(_=>_).join(',')}},'${r.childNodes[0].textContent.replace(/'/g,'\\\'')}'}`).join(',\n')+'\n}\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment