Skip to content

Instantly share code, notes, and snippets.

@somebody1234
Created September 25, 2020 18:09
Show Gist options
  • Save somebody1234/342fcc12d4e33fb4cd18dbe77940bbff to your computer and use it in GitHub Desktop.
Save somebody1234/342fcc12d4e33fb4cd18dbe77940bbff to your computer and use it in GitHub Desktop.
Diamond Hunt 3 Wiki helper scripts. Use in browser console on https://dh3.diamondhunt.co/
console.log([...document.getElementById('combat-combatLog-section').children].map(child=>{const c=child.children[0].children[0].children[0],s=c.children[1].children,l=[...child.children[0].children[0].children].slice(3);return`{'${c.children[0].children[1].childNodes[0].textContent.trim().replace(/\S+/g,m=>m[0]+m.slice(1).toLowerCase())}',${s[0].children[1].textContent},${s[2].textContent},${s[4].textContent},${s[6].textContent},${s[8].textContent},{${l.map(r=>`{'${(s=>s[0].toUpperCase()+s.slice(1))(r.children[0].children[0].src.match(/\w+(?=\.png)/)[0])}',${r.children[1].innerText.includes('-')?r.children[1].innerText.split(' - ')[0]:r.children[1].innerText},${r.children[1].innerText.includes('-')?r.children[1].innerText.split(' - ')[1]:r.children[1].innerText},${r.children[2].innerText.slice(2)}}`).join(',')}}},`}).join('\n'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment