Skip to content

Instantly share code, notes, and snippets.

@BenMQ
Last active August 29, 2015 14:04
Show Gist options
  • Save BenMQ/c480b9040d75538a3f82 to your computer and use it in GitHub Desktop.
Save BenMQ/c480b9040d75538a3f82 to your computer and use it in GitHub Desktop.
(!function($){
var data;
if ((typeof user != 'undefined') && user.quests && (data = user.quests.QuestSunkenCity) && data.is_diving) {
var output = '';
for (var i = 0; i < data.zones.length; i++) {
var zone = data.zones[i];
if (zone.num === data.active_zone) {
output += (zone.length + 'm ' + zone.name + ' (' + (zone.width-80+zone.left)/0.6 + 'm left)\n');
} else if (zone.num > data.active_zone) {
output += (zone.length + 'm ' + zone.name + '\n');
}
}
alert(output);
} else {
alert('Not diving!');
}
}(jQuery))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment