Skip to content

Instantly share code, notes, and snippets.

@rooftopchicken
Last active January 21, 2021 01:45
Show Gist options
  • Select an option

  • Save rooftopchicken/b24df8383073ebbc60fb0609dc87d8e7 to your computer and use it in GitHub Desktop.

Select an option

Save rooftopchicken/b24df8383073ebbc60fb0609dc87d8e7 to your computer and use it in GitHub Desktop.
Add exploration consumables to the explore page.
// ==UserScript==
// @name FV - Exploration consumables
// @version 0.1
// @description Add exploration consumables to the explore page.
// @author msjanny
// @match https://www.furvilla.com/career/explore*
// ==/UserScript==
(function() {
'use strict';
/* globals $:false */
let id = window.location.href.match(/\d+/)[0];
let active = $(".right-column .villager-avatar a").eq(0).attr("href").match(/\d+/)[0];
$(document).ready(function(){
let eyeBtn = $('<a href="#"><img src="http://www.furvilla.com/img/items/3/3828-eye-spy-jawbreaker.png"></a>').click(function() {
//set current explorer as active
$.get("http://www.furvilla.com/villager/activate/" + id, function() {
//open modal
$('#modal').modal('show');
$.get("http://www.furvilla.com/use/candy/jawbreaker", function(data) {
$('#modal .modal-content').html(data.content);
$('.btn').click(function() {
$.get("http://www.furvilla.com/villager/activate/" + active);
});
});
});
});
let leafBtn = $('<a href="#"><img src="http://www.furvilla.com/img/items/1/1422-snow-festival-frozen-leaf-fairy.png"></a>').click(function() {
//open modal
$('#modal').modal('show');
$.get("http://www.furvilla.com/use/fairy/frozen-leaf", function(data) {
$('#modal .modal-content').html(data.content);
});
});
// add to page
$(".registration-well").eq(0).after($('<div class="registration-well text-center">').append(eyeBtn).append(leafBtn));
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment