Discussions » Development

Help with a simple (or so I thought) script for https://targuinius.github.io/ExponentialClicker/

§
Posted: 2015-07-17

Help with a simple (or so I thought) script for https://targuinius.github.io/ExponentialClicker/

Hi all,
I am having trouble with the most basic of GM scripts; trying to insert some extra text into a web page. I want to add 6 extra 'text areas' onto this page: https://targuinius.github.io/ExponentialClicker/
If you follow the link, then click on 'Automatic' at the top you see in the bottom window there are 6 columns. I want to add a line above the horizontal scrolling window (so it stays static on the screen no matter which button you click at the top) to show various bits of information regarding totals of the six columns... probably best to look at the attachment to see what I mean. My effort is the box on the left that says "Test Insert" and what I want is text where each of the 6 green boxes are. No matter what I try I can only get the text to appear on the left of the screen and just above the scrolling box (see attached screenshot). I've tried appending pure HTML to the body and most recently tried using CSS to make the text appear where I want it to but no joy.
Can anyone suggest how I can get the text to appear where I want it to?
I'll post my latest effort as well so you can see what I'm trying...

// ==UserScript==
// @name        Expo-Clicker Enhancer
// @namespace   fudging
// @match       https://targuinius.github.io/ExponentialClicker/
// @version     0.0.1
// @grant       none
// @require     http://code.jquery.com/jquery-2.1.3.min.js
// ==/UserScript==

function addGlobalStyles(css) {
  var head, style;
  head = document.getElementsByTagName('head')[0];
  if (!head) {
    alert('Failed');
    return;
  }
  style = document.createElement('style');
  style.type = 'text/css';
  style.innerHTML = css;
  head.appendChild(style);
}

addGlobalStyles('head1 {width: auto; top: 500; left: 500; border: 1px solid; z-index: 10; !important');


var newHTML = document.createElement('div');
newHTML.innerHTML = 'Test insert';

document.body.appendChild(newHTML);

Thanks

§
Posted: 2015-07-17
// ==UserScript==
// @name        Expo-Clicker Enhancer
// @namespace   fudging
// @match       https://targuinius.github.io/ExponentialClicker/
// @version     0.0.1
// @grant       none
// ==/UserScript==

$(".js-scroll").css("left", "-1000px");
$(".button-tabs").off("click");
$(".buildings").clone().insertBefore(".buildings").children().text("Text insert");

Post reply

Sign in to post a reply.