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

12467

Comments

  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    Ok, I didn't understood at first that you could type the amount you wanted. Obviously, scrolling 100 times is a bit... annoying.
    Now the problem is that I can't use my number tab to enter the amount, since I have my Alt.Shift.NumLock on. (AltMaj.VerrNum pour les français)
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    Refresh: it works. Doesn't make any sense to me.
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • LethrblakaLethrblaka Member Posts: 1,243 ✭✭✭
    I wanted to know what Alt.Shift.NumLock does and... look what I found!

    image
  • [Deleted User][Deleted User] Posts: 4,218
    edited July 2014
    The user and all related content has been deleted.
    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
  • LethrblakaLethrblaka Member Posts: 1,243 ✭✭✭
    Zyzzyzus said:

    Don't know why my script isn't working since it works fine for me. I have a sell all button too now on mine.

    The reason I used the drop menu was because of the bad way the shop is done. I sometimes end up buying something instead of selling so buying 100 instead of selling 1 would be bad. That's why I'm sticking with my script when I play IGM games.
    Adding a separate 'onclick' to a button is baaaaaad. :P

    If I can be bothered I might try some things to make it better.

    I don't like drop down menu because I'm not enough precise with a mouse, sometimes the cursor goes all crazy for a second or two and I have to reposition it, quite annoying...
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭

    I don't like drop down menu because I'm not enough precise with a mouse, sometimes the cursor [...]

    You've got to be kidding me right ? You can't use a f*cking scroll menu ? How is that even possible ? T'a des pains au raisains à la place des main ou quoi ? Depuis quand un être humain de plus de 3 ans n'arrive pas à utiliser un menu déroulant !

    Je doit prendre mes cachets moi...
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • LethrblakaLethrblaka Member Posts: 1,243 ✭✭✭
    Gouchnox said:

    I don't like drop down menu because I'm not enough precise with a mouse, sometimes the cursor [...]

    You've got to be kidding me right ? You can't use a f*cking scroll menu ? How is that even possible ? T'a des pains au raisains à la place des main ou quoi ? Depuis quand un être humain de plus de 3 ans n'arrive pas à utiliser un menu déroulant !

    Je doit prendre mes cachets moi...
    I KNOW HOW TO USE A DROP DOWN MENU!!! But it's just that when my cursor decides to do whatever the hell it wants, I can't control it and, as a result, I'm wasting more time trying to be precise with my cursor than to just type a number and click Submit!
  • LethrblakaLethrblaka Member Posts: 1,243 ✭✭✭
    Also I prefer buying 25 buildings at a time (in WD) because I just have to multiply the price of the building by 100.
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭

    But it's just that when my cursor decides to do whatever the hell it wants, I can't control it and, as a result, I'm wasting more time trying to be precise with my cursor than to just type a number and click Submit!

    I have the same problem with my brain. He decides to do whatever the hell et wants, I can't control it and, as a result, I'm wasting more time trying to think than just having an idea!
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    Wrote something quick that will add a button to show/hide bought upgrades. Sometimes in games it can be hard to scroll through looking for the ones you haven't bought when there are a lot.

    l('saveBox').innerHTML+= "Hide bought upgrades"

    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)
    {
    for(i in document.getElementsByClassName('bought')){
    if(document.getElementsByClassName('bought')[i].style)
    {
    document.getElementsByClassName('bought')[i].style.display = arg
    }
    }
    }

    Edit:
    Also my first use of switch. :P

    Edit:
    I messed it up a bit so it goes wrong when you buy a new upgrade.

    Fixed it.

    It wont keep newly bought ones hidden. I really only did it to try stuff out. :P
    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
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    After some discussion here I wrote a new beautify function. It will return a×1000^b if the numbers are too big.


    nums = ['k','M','B','T','Qa','Qi', 'Sx', 'Sp', 'Oc', 'No', 'De', 'UnD', 'DuD', 'TrD', 'QaD', 'QiD', 'SeD', 'SpD', 'OcD', 'NoD', 'Vi', 'UnV'];
    function Beautify(num,floats)
    {
    function floor(num){
    //special floor needed to deal with floating point calculations
    if(num - Math.floor(num) >= 0.9999999999999991){
    return Math.ceil(num);
    } else{
    return Math.floor(num);
    }
    }
    if (!isFinite(num)) return 'Infinity'
    if(num < 1e3) return Math.round(num)
    var lognum = Math.log(num)/Math.log(1000)
    var pow = floor(lognum)
    var num2 = Math.round(1000*(Math.pow(1000,lognum - pow)))/1000
    if(num2 >= 1000)
    {
    num2/=1000
    pow++
    }
    num2 = num2.toFixed(3)
    if(num >= parseFloat('1e' + 3*(nums.length))) return num2 + '×1000' + pow + ''
    else return num2 + nums[pow-1]
    }

    I wrote it myself without reading the way they did it but after I added the special floor function.

    It wont format superscript here. But it will appear like that in IGM games. I had to use span since Orteil reset everything in the CSS making useless.

    I wont be adding it to my bookmarklets/greasemonkey/tampermonkey yet until I am sure it is accurate. It is far more efficient but I always thought it'd be inaccurate. This is the function I always had in my head but never got round to doing. :P
    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
  • ExplodingCamelExplodingCamel Member Posts: 7,473 ✭✭✭✭✭
    Uhh... I think we need to stop using code tags now.
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    Damn.... They look awful ! Who looked at this and said "yeah, this is totally a good idea, we should implement it" ?

    @Opti‌
    @Orteil‌
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    You know, the thing that allows you to keep your save ? There's a problem with it...
    My WD save code is 5 pages long, no problem with this. The problem is when you have to copy it into WD. The thing is too long for WD, and nothing will get copied.
    I have to copy one page after the other.
    So.. is there a way to fix this ?
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    gouchnox said:
    You know, the thing that allows you to keep your save ? There's a problem with it...
    My WD save code is 5 pages long, no problem with this. The problem is when you have to copy it into WD. The thing is too long for WD, and nothing will get copied.
    I have to copy one page after the other.
    So.. is there a way to fix this ?

    Not sure what you mean since it works for me in WD on all browsers. Do you mean when you try to import? For me it shows ... for Chrome after a few letters but it is still all there and works when I click OK.

    Only thing I can think of is if an older computer would struggle when copying large amounts of text into the browser. I don't know how to deal with this.
    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
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    It's weird because I can copy any amount of text in my save file, but it's too long wen I'm copying it in WD... oh well...
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • BurntCookieBurntCookie Member, Internet Detective, Friendly, Helpful, Flagger, Idle Game Master, Conversationalist Posts: 5,001 ✭✭✭✭✭
    edited August 2014
    I think the "show amount of achievements/upgrades" thing should be added to the OP.
    The user and all related content has been deleted.
  • dgz345dgz345 Member Posts: 115 ✭✭
    </code> <blockquote class="UserQuote"><div class="QuoteAuthor"><a href="/profile/Zyzzyzus" rel="nofollow">Zyzzyzus</a> said:</div><div class="QuoteText"><p>Wrote something quick that will add a button to show/hide bought upgrades. Sometimes in games it can be hard to scroll through looking for the ones you haven't bought when there are a lot. <code>l('saveBox').innerHTML+= "<div class='button' id='hideupg' onclick='hideupgrades();'>Hide bought upgrades</div>" 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) { for(i in document.getElementsByClassName('bought')){ if(document.getElementsByClassName('bought')[i].style) { document.getElementsByClassName('bought')[i].style.display = arg } } }

    Edit:
    Also my first use of switch. :P

    Edit:
    I messed it up a bit so it goes wrong when you buy a new upgrade.

    Fixed it.

    It wont keep newly bought ones hidden. I really only did it to try stuff out. :P

    just a thought. if you add another class to all the upgrades a check if it has *custom* and hidden then display is none

    var style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = '.mycss .bought { display: none; }';
    document.getElementsByTagName('head')[0].appendChild(style);

    so when you press the button you toogle between having the extra class or not. then the problem with hiding newly bought should be fixed.

    i have not tried any of this
  • [Deleted User][Deleted User] Posts: 4,218
    The user and all related content has been deleted.
    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
  • dgz345dgz345 Member Posts: 115 ✭✭
    Zyzzyzus said:

    I just tested that and it overrides the default css. If I click it to show them again it messes it up.

    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"); } } }
    this worked and it hides them when you buy them
  • dgz345dgz345 Member Posts: 115 ✭✭
    i also made another quick script. that shows the requirements for unlocking an achievement/upgrade

    http://pastebin.com/m1z2Dibr

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

    currently it shows all achievements and upgrades but the once that are not unlocked are grayed out. the requirement is added to the tooltip.
  • TFU_SatronTFU_Satron Member, Friendly, Cool, Flagger, Conversationalist, Funny Posts: 12,680 ✭✭✭✭✭
    dgz345 said:

    i also made another quick script. that shows the requirements for unlocking an achievement/upgrade

    http://pastebin.com/m1z2Dibr

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

    currently it shows all achievements and upgrades but the once that are not unlocked are grayed out. the requirement is added to the tooltip.

    thats awesome.
    What is life? Is it nothing more than the endless search for a cutie mark? And what is a cutie mark but a constant reminder that we're all only one bugbear attack away from oblivion? And what of the poor gator? Flank forever blank, destined to an existential swim down the river of life to... an unknowable destiny?
  • BurntCookieBurntCookie Member, Internet Detective, Friendly, Helpful, Flagger, Idle Game Master, Conversationalist Posts: 5,001 ✭✭✭✭✭
    dgz345 said:

    i also made another quick script. that shows the requirements for unlocking an achievement/upgrade

    http://pastebin.com/m1z2Dibr

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

    currently it shows all achievements and upgrades but the once that are not unlocked are grayed out. the requirement is added to the tooltip.

    You can still buy upgrades that are supposed to be locked using this though.
    The user and all related content has been deleted.
  • dgz345dgz345 Member Posts: 115 ✭✭

    dgz345 said:

    i also made another quick script. that shows the requirements for unlocking an achievement/upgrade

    http://pastebin.com/m1z2Dibr

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

    currently it shows all achievements and upgrades but the once that are not unlocked are grayed out. the requirement is added to the tooltip.

    You can still buy upgrades that are supposed to be locked using this though.
    i guess you didnt try?
    the can buy property should still be false as they still count as hidden

    and im looking for a better way to show the requirements. then having all upgrades visible. im open for ideas
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    dgz345 said:
    *code*
    this worked and it hides them when you buy them
    I was trying something different. I still have a lot to learn. :p
    dgz345 said:
    » show previous quotes i guess you didnt try?
    the can buy property should still be false as they still count as hidden

    and im looking for a better way to show the requirements. then having all upgrades visible. im open for ideas
    This is the canbuy function:
    this.CanBuy=function()
    {
    var carryOn=1;
    for (var i in this.costs){if (this.costs[i].X.amount
    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
  • dgz345dgz345 Member Posts: 115 ✭✭
    Zyzzyzus said:

    dgz345 said:

    *code*
    this worked and it hides them when you buy them

    I was trying something different. I still have a lot to learn. :p
    dgz345 said:

    dgz345 said:

    i also made another quick script. that shows the requirements for unlocking an achievement/upgrade

    http://pastebin.com/m1z2Dibr

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

    currently it shows all achievements and upgrades but the once that are not unlocked are grayed out. the requirement is added to the tooltip.

    You can still buy upgrades that are supposed to be locked using this though.
    i guess you didnt try?
    the can buy property should still be false as they still count as hidden

    and im looking for a better way to show the requirements. then having all upgrades visible. im open for ideas
    This is the canbuy function:
    this.CanBuy=function() { var carryOn=1; for (var i in this.costs){if (this.costs[i].X.amount<this.costs[i].amount) carryOn=0;} for (var i in this.requires){if (this.requires[i].X.amount<this.requires[i].amount) carryOn=0;} if (this.bought) carryOn=0; return carryOn; }

    It doesn't check the visible property (neither does the buy function) which means you'll be able to buy upgrades you shouldn't be able to.
    forgot that its just my buymany script that checks if the building is visible.

    the script is fixed now. added a visibility check in the canbuy function
  • [Deleted User][Deleted User] Posts: 4,218
    edited April 18
    I have been experimenting with a Grease/Tampermonkey script to stop the save bug. I can't guarantee yet if it will work since I need to experience the bug first.

    // ==UserScript==
    // @name Save bug fix
    // @namespace deleteduser
    // @include http://orteil.dashnet.org/experiments/idlegamemaker/*
    // @version 1
    // @grant none
    // ==/UserScript==
    if(!oldsave) var oldsave = Game.Save
    Game.Save = function(){
    if(Object.keys(Game.things).length > 0) return oldsave()
    else return
    }

    It makes the save function check if there are any buildings etc. first before saving.

    I am not certain yet about it though. It may not even stop it and it wouldn't work by using the console since it'll be too late by then.
    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
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    HELP !

    I'm trying to import my WD save but it's too big for the thing, it will not work... Even if I copy the save in separated parts, it will "be full" before the end and just add "...", without importing the save....
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • GouchnoxGouchnox Member, Friendly, Cool, Conversationalist Posts: 6,496 ✭✭✭✭✭✭
    Aaaaaaand never mind it fixed itself after a refresh. It's not supposed to make sense, remember.
    image Packs: (CC ~ MC ~ BoI ~ DNF) image
  • AuroyaNovoAuroyaNovo Member, Friendly, Cool Posts: 5,520 ✭✭✭✭✭
    Gouchnox said:

    Aaaaaaand never mind it fixed itself after a refresh. It's not supposed to make sense, remember.

    What fun would there be in making sense?
Sign In or Register to comment.