Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

IGM bookmarklets/scripts

123457»

Comments

  • LeviC53LeviC53 Member Posts: 40 ✭✭
    Zyzzyzus said:

    Added a confirm dialog to the reset button on my multibuy mod. I clicked it by mistake once while buying. :P

    The code that does it is:

    with(l('saveBox')){ if(innerHTML.indexOf("confirm('Are you sure you want to reset?')") == -1) innerHTML = innerHTML.replace("Game.Reset()","if(confirm('Are you sure you want to reset?')){Game.Reset()}")}

    Why Orteil ever thought it a good idea not to have a confirm I'll never know. :P


    Hey Zyzzyzus, is there a way that I can add this to my game pastebin or stylesheet pastebin so that it works without endlessly copying and pasting it every time I start my game? I would love to know how I can add some of your scripts to my game, if that's okay!
  • erdbeereerdbeere Member, Helpful Posts: 3,400 ✭✭✭✭✭
    Sadly Zyzzyzus doesn't visit the forum anymore.
    I can tell you that there is (currently) no functioning way to add it to the pastebin of the game or the stylesheet. But you could install an add-on like Greasemonkey that lets you automatically add Javascript code to specific websites.
  • LeviC53LeviC53 Member Posts: 40 ✭✭
    erdbeere said:

    Sadly Zyzzyzus doesn't visit the forum anymore.
    I can tell you that there is (currently) no functioning way to add it to the pastebin of the game or the stylesheet. But you could install an add-on like Greasemonkey that lets you automatically add Javascript code to specific websites.


    Would Tampermonkey work?
  • erdbeereerdbeere Member, Helpful Posts: 3,400 ✭✭✭✭✭
    LeviC53 said:

    erdbeere said:

    Sadly Zyzzyzus doesn't visit the forum anymore.
    I can tell you that there is (currently) no functioning way to add it to the pastebin of the game or the stylesheet. But you could install an add-on like Greasemonkey that lets you automatically add Javascript code to specific websites.


    Would Tampermonkey work?
    I haven't tried it, but it should work.
  • jorgito24jorgito24 Member Posts: 73
    where do i insert code in my css
  • Korrupt86Korrupt86 Member Posts: 61 ✭✭
    edited December 2015
    Zyzzyzus said:

    Tellurium said:

    If you're taking suggestions, I recommend a number shortener like in Cookie Clicker to avoid 1+e21ing.

    That can be done by using the same functions that do it in CC. I am a bit reluctant to rehost code but this is the code needed:
    function formatEveryThirdPower(notations) { return function (value) { var base = 0, notationValue = ''; if (value >= 1000000 && isFinite(value)) { value /= 1000; while(Math.round(value) >= 1000) { value /= 1000; base++; } if (base > notations.length) {return 'Infinity';} else {notationValue = notations[base];} } return ( Math.round(value * 1000) / 1000 ) + notationValue; }; } function rawFormatter(value) {return Math.round(value * 1000) / 1000;} var numberFormatters = [ rawFormatter, formatEveryThirdPower(['',' million',' billion',' trillion',' quadrillion',' quintillion',' sextillion',' septillion',' octillion',' nonillion',' decillion']),formatEveryThirdPower(['',' M',' B',' T',' Qa',' Qi',' Sx',' Sp',' Oc',' No',' Dc'])]; function Beautify(value,floats) { var negative=(value<0); var decimal=''; if (value<1000000 && floats>0) decimal='.'+(value.toFixed(floats).toString()).split('.')[1]; value=Math.floor(Math.abs(value)); var formatter=numberFormatters[1]; var output=formatter(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g,','); return negative?'-'+output:output+decimal; }
    I Cannot get it to work for my game.

    I want my currency to convert at 1,000,000 to 1M then 1,000,000M converts to 1B etc.

    If I give someone my CSS for my IGM can you please place it in so that it works correctly?
    Try my latest game

    Mine Deep - Underworld
  • PurgePurge Member, Friendly, Helpful Posts: 2,014 ✭✭✭✭✭
    edited January 2016
    Korrupt86 said:

    Zyzzyzus said:

    Tellurium said:

    If you're taking suggestions, I recommend a number shortener like in Cookie Clicker to avoid 1+e21ing.

    That can be done by using the same functions that do it in CC. I am a bit reluctant to rehost code but this is the code needed:
    function formatEveryThirdPower(notations) { return function (value) { var base = 0, notationValue = ''; if (value >= 1000000 && isFinite(value)) { value /= 1000; while(Math.round(value) >= 1000) { value /= 1000; base++; } if (base > notations.length) {return 'Infinity';} else {notationValue = notations[base];} } return ( Math.round(value * 1000) / 1000 ) + notationValue; }; } function rawFormatter(value) {return Math.round(value * 1000) / 1000;} var numberFormatters = [ rawFormatter, formatEveryThirdPower(['',' million',' billion',' trillion',' quadrillion',' quintillion',' sextillion',' septillion',' octillion',' nonillion',' decillion']),formatEveryThirdPower(['',' M',' B',' T',' Qa',' Qi',' Sx',' Sp',' Oc',' No',' Dc'])]; function Beautify(value,floats) { var negative=(value<0); var decimal=''; if (value<1000000 && floats>0) decimal='.'+(value.toFixed(floats).toString()).split('.')[1]; value=Math.floor(Math.abs(value)); var formatter=numberFormatters[1]; var output=formatter(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g,','); return negative?'-'+output:output+decimal; }
    I Cannot get it to work for my game.

    I want my currency to convert at 1,000,000 to 1M then 1,000,000M converts to 1B etc.

    If I give someone my CSS for my IGM can you please place it in so that it works correctly?
    Wait, so you want one million million to convert to one billion? Im not sure thats how numbers work
    Post edited by Purge on
    ""My game will be playable on all Samsung Microwaves with firmware update 5.3.2 and up." - Audiot" - RunningInReverse
  • TrevinMacielTrevinMaciel Member Posts: 1,017
    edited June 2016
    Wait, so you want one million million to convert to one billion? I'm not sure thats how numbers work.
    I'm pretty sure the currency 1,000M means 1 milliard.

    Anyways, here's a short scale.
    nums = ['K','M','G', 'T', 'P', 'E', 'Z', 'Y', 'KY', 'MY', 'GY', 'TY', 'EY', 'PY', 'ZY', '2Y', 'K2Y', 'M2Y', 'G2Y', 'T2Y', 'P2Y', 'E2Y', 'Z2Y', '3Y', 'K3Y', 'M3Y', 'G3Y', 'T3Y', 'P3Y', 'E3Y', 'Z3Y', '4Y', 'K4Y', 'M4Y', 'G4Y', 'T4Y', 'P4Y', 'E4Y', 'Z4Y', '5Y', 'K5Y', 'M5Y', 'G5Y', 'T5Y', 'P5Y', 'E5Y', 'Z5Y', '6Y', 'K6Y', 'M6Y', 'G6Y', 'T6Y', 'P6Y', 'E6Y', 'Z6Y', '7Y', 'K7Y', 'M7Y', 'G7Y', 'T7Y', 'P7Y', 'E7Y', 'Z7Y', '8Y', 'K8Y', 'M8Y', 'G8Y', 'T8Y', 'P8Y', 'E8Y', 'Z8Y', '9Y', 'K9Y', 'M9Y', 'G9Y', 'T9Y', 'P9Y', 'E9Y', 'Z9Y', '10Y','K10Y','M10Y','G10Y','T10Y','P10Y','E10Y','Z10Y','11Y','K11Y',];
     
     
    function Beautify(num,floats)
    {
    if (!isFinite(num)) return 'Infinity'
    if(num < 1e3 || num >= parseFloat('1e' + 3*(nums.length))) return Math.round(num)
    var i = 0;
    while(num >= 1000)
    {
    num/=1000;
    i++;
    }
    num = Math.round(num*1000)/1000;
    if(num>=1000)
    {
    num/=1000;
    i++;
    num = Math.round(num*1000)/1000;
    } //deals with rounding errors
    num = num.toString();
    if(num.indexOf('.') == -1) num += '.000'
    else
    {
    dec = num.indexOf('.');
    while(num.slice(dec,num.length).length < 4) num += '0' //adds trailing 0s (if needed) to stop the numbers jumping around.
    }
    return num + nums[i - 1]
    }
    (Sorry for the huge bump.)
    Post edited by TrevinMaciel on
    "Dude, I'm pretty sure you can't just quote yourself." "After this game is finished we will celebrate... by starting a "Count to 25,000 starting from 10,000" thread!" -Brainstorm
    "You're gonna have a bad time." -Running In Reverse "http://i.imgur.com/2jStH32.png" -Cookie
  • medsal15medsal15 Member Posts: 102 ✭✭
    Well, depending on how you count, 1,000 million can be 1 billion and 1 milliard.
    https://en.wikipedia.org/wiki/Names_of_large_numbers
    I always give people what they want. Unless I can't.
    I'm still learning english so I probably make some mistakes. I will correct myself if I find it.
  • TrevinMacielTrevinMaciel Member Posts: 1,017
    medsal15 said:

    Well, depending on how you count, 1,000 million can be 1 billion and 1 milliard.
    https://en.wikipedia.org/wiki/Names_of_large_numbers

    I know.

    Can anyone make a script that makes IGM use decimal.js? (Decimal.js makes numbers become larger than 1e308 without it going to Infinity.)
    "Dude, I'm pretty sure you can't just quote yourself." "After this game is finished we will celebrate... by starting a "Count to 25,000 starting from 10,000" thread!" -Brainstorm
    "You're gonna have a bad time." -Running In Reverse "http://i.imgur.com/2jStH32.png" -Cookie
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    trevinmaciel said:
    Can anyone make a script that makes IGM use decimal.js? (Decimal.js makes numbers become larger than 1e308 without it going to Infinity.)

    I just saw this now so I guess I'll answer.
    It is technically possible but it would be a HUGE amount of work and may end up making the game perform even worse. IGM is terribly optimised as it is.
    It'd require a complete rewrite of the game code and then possibly optimisation so it doesn't perform like crap.

    The only hope of this happening is if Orteil ever updates IGM and adds it in because it is just too much work to ask of anyone to do for free.
    Post edited by Chisako on
    I had a dream my life would be
    So different from this hell I'm living
    So different now, from what it seemed
    Now life has killed the dream I dreamed
  • BrainstormBrainstorm Member Posts: 10,390 ✭✭✭✭
    Is there a way to make the number convertion script available for every person playing the game and not just using the script?

    No?
    "Calm your caps, bro." -Brainstorm

    the following link is the best thing that could happen to you: http://forum.dashnet.org/discussions/tagged/brainstormgame

    Currently managing a large-based forum game.. DashNet RPG! Play it now: http://forum.dashnet.org/discussion/15882/dashnet-rpg-dashnets-greatest-forum-game-of-all-time
    Dashnet RPG Pastebin: https://pastebin.com/6301gzzx
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    brainstorm said:
    Is there a way to make the number convertion script available for every person playing the game and not just using the script?

    No?
    Not one I know of. The game purposely tries to prevent any scripts in the game/css code from running. If it were possible it'd have to be some browser exploit and if such an exploit existed, it'd probably get fixed anyway since it is dangerous.
    Post edited by Chisako on
    I had a dream my life would be
    So different from this hell I'm living
    So different now, from what it seemed
    Now life has killed the dream I dreamed
  • TrevinMacielTrevinMaciel Member Posts: 1,017
    Zyzzyzus said:

    Is there a way to make the number convertion script available for every person playing the game and not just using the script?

    No?

    Not one I know of. The game purposely tries to prevent any scripts in the game/css code from running. If it were possible it'd have to be some browser exploit and if such an exploit existed, it'd probably get fixed anyway since it is dangerous.
    The reason why this happens is because it can work on any website. Somebody can delete every YouTube video or something like that. That's why it isn't permanent.
    "Dude, I'm pretty sure you can't just quote yourself." "After this game is finished we will celebrate... by starting a "Count to 25,000 starting from 10,000" thread!" -Brainstorm
    "You're gonna have a bad time." -Running In Reverse "http://i.imgur.com/2jStH32.png" -Cookie
  • TrevinMacielTrevinMaciel Member Posts: 1,017
    edited August 2016
    If anybody wants to use this, here's a custom number script:

    nums = ['k','m','b', 't', 'q', 'Q', 's', 'S', 'O', 'N', 'D', 'UD', 'DD', 'TD', 'qD', 'QD', 'sD', 'SD', 'OD', 'ND', 'V', 'UV', 'DV', 'TV', 'qV', 'QV', 'sV', 'SV', 'OV', 'NV', 'T', 'UT', 'DT', 'TT', 'qT', 'QT', 'sT', 'ST', 'OT', 'NT', '~q', 'Uq', 'Dq', 'Tq', 'c', 'C', 'n', 'd', 'aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg', 'hh', 'ii', 'jj', 'kk', 'll', 'mm', 'nn', 'oo', 'pp', 'qq', 'rr', 'ss', 'tt', 'uu', 'vv', 'ww', 'xx', 'yy', 'zz', 'AA', 'BB', 'CC', 'DD', 'EE','FF', 'GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','QQ','RR','SS','TT','UU','VV','WW','XX','YY','ZZ','aaa',]; function Beautify(num,floats) { if (!isFinite(num)) return 'Infinity' if(num < 1e3 || num >= parseFloat('1e' + 3*(nums.length))) return Math.round(num) var i = 0; while(num >= 1000) { num/=1000; i++; } num = Math.round(num*1000)/1000; if(num>=1000) { num/=1000; i++; num = Math.round(num*1000)/1000; } //deals with rounding errors num = num.toString(); if(num.indexOf('.') == -1) num += '.000' else { dec = num.indexOf('.'); while(num.slice(dec,num.length).length < 4) num += '0' //Now its updated! } return num + nums[i - 1] }
    Post edited by TrevinMaciel on
    "Dude, I'm pretty sure you can't just quote yourself." "After this game is finished we will celebrate... by starting a "Count to 25,000 starting from 10,000" thread!" -Brainstorm
    "You're gonna have a bad time." -Running In Reverse "http://i.imgur.com/2jStH32.png" -Cookie
  • Bigdbigd03Bigdbigd03 Member Posts: 32 ✭✭
    Is their a way to put links at the bottom of the page, YT, FB, Twitter?
    Siggy-nature

    You can find me under the same name everywhere./div>
  • MyloMylo Member Posts: 50 ✭✭
    l('saveBox').innerHTML += "<div class='button' id='hideupg' onclick='hideupgrades();'>Hide bought upgrades</div>";
    
    var style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = '.mycss.bought { display: none; }';
    document.getElementsByTagName('head')[0].appendChild(style);
    
    function hideupgrades() {
        switch (l('hideupg').innerHTML) {
            case 'Hide bought upgrades':
                upgsty('none');
                l('hideupg').innerHTML = 'Show bought upgrades';
                break;
            case 'Show bought upgrades':
                upgsty('');
                l('hideupg').innerHTML = 'Hide bought upgrades';
                break;
            default:
                upgsty('none');
                l('hideupg').innerHTML = 'Show bought upgrades';
        }
    }
    
    
    function upgsty(arg) {
        if (arg == 'none') {
            for (var i in Game.upgrades) {
                AddClass(Game.upgrades[i].l, "mycss");
            }
        } else {
            for (var i in Game.upgrades) {
                RemoveClass(Game.upgrades[i].l, "mycss");
            }
        }
    }
    ^ Script for show/hiding updates

    javascript:(function(){with(document)(head.appendChild(createElement('script')).src='http://pastebin.com/raw.php?i=hCTuvzBf')._})();

    ^ Script for buy 10/100
  • idcidc Member Posts: 128 ✭✭✭
    edited November 2
    I can't add it to the OP (obviously) but I decide to throw something together that changes the bulk buy keys a bit since I was bored. (for the new igm version of course)


    // ==UserScript== // @name Bulk Buy // @version 1 // @description change the bulk buy keys // @author Zyzzyzus // @match http://orteil.dashnet.org/igm/player.html // @grant none // ==/UserScript== (function() { 'use strict'; var shift = 10; var z = 100; var x = 1000; var a = window.setInterval(function(){ if(G.Logic){ eval("G.Logic=" +G.Logic.toString().replace("if (G.keys[16]) G.bulk=50;//shift", "if (G.keys[16]) G.bulk=shift;//shift\n\t\tif (G.keys[90]) G.bulk=z;//z\n\t\tif (G.keys[88]) G.bulk=x;//x")); clearInterval(a); } },500); })();

    I left ctrl to sell and the amounts are easy to change here. It'd be easy to use different keys but those are nearest to ctrl and ctrl+z or x will sell that amount instead.

    Note:
    Tamper/greasemonkey might say using eval can be dangerous. But that is when you don't have control over the part being eval'd (eg if you accept user input on a site and eval it)
    Not gonna host it somewhere due to laziness.
    Post edited by idc on
    BEETLE there is! While the ROOMS here not!
123457»
Sign In or Register to comment.