Skip to content

Instantly share code, notes, and snippets.

@chrisinajar
Created June 6, 2018 01:32
Show Gist options
  • Save chrisinajar/0a927035a825adc90d932af73d293f90 to your computer and use it in GitHub Desktop.
Save chrisinajar/0a927035a825adc90d932af73d293f90 to your computer and use it in GitHub Desktop.
Quick function to detect if an RWK item is ash or not
function isAsh (itemNumber) {
var itype = parseInt(itemNumber / 1000, 10) % 100;
var inum = parseInt(itemNumber, 10) % 1000;
var iench = parseInt(itemNumber / 100000, 10) % 100 - 1;
if (iench > 34) {
return false;
}
if (iench < 0) {
return false;
}
if (itype === 27) {
return false;
}
if (inum > 70) {
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment