Rainbow Gravitation made easy

Bale

Minion
In hardcore it can be a pain in the bottom to use Rainbow Gravitation (unless you actually have 1 of every wad) because kolMafia does not support wad transmutation.

There I was with several extra Sleaze Wads, but no Spooky Wads. In order to create a Prismatic Wad, I'd need to transmute the extra Sleaze Wad -> Hot Wad -> Cold Wad -> Spooky Wad. That's three cooking operations that have to be done through the relay browser. Not to mention the trouble of figuring out which wads needed to be transformed.

Sure, I could have just spent 2 minutes and cooked up my wads, but if I spent 2-3 hours I could have it done automatically for me and never have to worry about the problem ever again. I figure that after using this script about 90 times I'll have made up the lost time. Then (being me), I ended up spending even more time to make it a little nicer. Okay, that seems like a bad use of time, but I did it anyway and I'll pass this script on to others so that they can help me with my time deficit.

This script will figure out exactly how many wads need to be transformed, it will tell you how many Twinkly Wads will be used up in the transformation and ask if you are willing to spend that many twinklies. If you agree, it will start cooking up new wads for you and cast Rainbow Gravitation.

If you don't need to transmute wads, then it will just cast Rainbow Gravitation, but it did save you the trouble of checking for yourself.

v1.1 Now if you have mall access and your preference is to automatically purchase from the mall, it will purchase any wads that you lack.
v1.2 Now it will tell you which elemental wads you lack.
v1.3 Fixed a bug with mall usage.
v1.4 In mallcore it will now cast Rainbow Gravitation as many times as possible.
v1.5 Takes advantage of the new craft() command for greater integration with mafia's cooking decisions.
v1.6 Improved return value checking necessitates a fix.
 

Attachments

Last edited:
Nice script, thanks.

May I suggest a tiny little enhancement. When asking if you are willing to spend the twinklies, also report what type you are missing. This would also make it somewhat useful for aftercore, since I don't know of a good way to find what I am missing from the CLI.
 
In aftercore, how about I just have it automatically purchase the required wads if you have the preference of purchasing automatically from the mall?

Would that be good?
 
That's what my rainbow gravitation.ash script does.

Code:
void cast_rainbow_gravitation()
{
    print("Attempting to cast Rainbow Gravitation", "blue");
    if (have_skill($skill[Rainbow Gravitation]))
    {
        if (can_interact())
        {
            if ( !in_hardcore() )
            {
                boolean restock( int nCount, item iItem)
                {
                    int nAmount = available_amount( iItem );
                    
                    if ( nAmount < nCount )
                    {
                        buy( ( nCount - nAmount ), iItem );
                        return true;
                    }
                    
                    return false;
                }
    
                int nCurrentMeat = my_meat();
                restock( 3, $item[twinkly wad] );
                restock( 3, $item[cold wad] );
                restock( 3, $item[stench wad] );
                restock( 3, $item[hot wad] );
                restock( 3, $item[sleaze wad] );
                restock( 3, $item[spooky wad] );
                print("Spent " + to_string(nCurrentMeat - my_meat()) + " meat restocking wads", "blue");
            }
    
            use_skill(3, $skill[Rainbow Gravitation]);        
        }
    }
}
 
Yeah, that's what Rinn's rainbow gravitation does! Mine is mostly about automated wad transmutation, a somewhat different problem.

Though, just for the heck of it I've added automatic wad purchasing if you have mall access and told mafia to purchase from the mall. It'll still only make wads one at a time though.
 
I have been using batass jackets to get my wads. I love this script (and any script helps me do things I normally forget to do).
 
I like the script.

Can I ask you to consider adding a "You don't have 'x' to successfully transmute" error message?

I was missing a spooky wad today and when I ran the script the error message I got was:

Without understanding the Way of the Sauce you cannot transmute wads.

When I figure out I only had 5 of the 6 wads needed, I made the spooky and it ran successfully.

Thanks!
 
Seem simple enough to add that so I took care of it for you. I can't test this properly at the moment though, so please let me know how it works. :D
 
> call scripts\Rainbow Gravitation.ash

You lack a sleaze wad.
You lack a spooky wad.

Without understanding the Way of the Sauce you cannot transmute wads.


You ROCK Bale. Works like a champ!

Thanks so much.

/hoists_a_beer
 
Love this script! Very handy.

I'm greatly saddened by the reports of people smashing all these perfectly collectable bat-ass leather jackets. :(

Bug: I haven't yet permed Way of Sauce, so I run this script primarily as a check after pulverizing during a run, and in aftercore. So I often end up buying wads in aftercore. The problem is, if the script needs to buy missing wads, it will buy them, then just sit there not doing anything, indefinitely:

Code:
Searching for "spooky wad"...
Purchasing spooky wad (1 @ 480)...
You acquire an item: spooky wad
Purchases complete.
Searching for "stench wad"...
Purchasing stench wad (1 @ 470)...
You acquire an item: stench wad
Purchases complete.

And that's it. It doesn't cause a CPU spike like an endless loop would, but nor does it finish running the script, so I'm a little confused as to what's going on. Aborting the script and then running it again will cast Gravitation as expected. Haven't had time to figure out the problem yet but wanted to report it since I knew you are so attentive.
 
Well, my hardcore character has Way and in softcore my breakfast script purchases 3 of each elemental wad and casts RG 3 times. As a result I've never noticed that bug.

I'm not 100% positive (the logic is surprisingly complicated for such a tiny script and it would take me a bit to completely understand it again), but I've got a strong hunch I know what the problem must be. I've updated the file in the first post.

Unfortunately I am not able to test this today. (My softcore character has already used up Rainbow Gravitation for the day.) So please test it for me and let me know if I've fixed the problem.
 
Last edited:
Rollover happened, so I was able to test the script on my multi.

Good news. The little fix I made to Rainbow Gravitation works perfectly!

Should I change it to use the skill all three times if you're in mallcore?
 
Excellent.

And yes, at present I would have to call it 6 times (once to buy wads and once to cast Gravitation, per cast). After grabbing your fix, down to 3. Would prefer 1.

On that note, would also like it to tell me how many of each needed wad I have before doing its thing.
 
Huh? Don't get what you mean. If it needs a wad it has ZERO, right? Or you mean you'd prefer that it not purchase the usually very cheap wads before you agree to have it gravitate the rainbow?
 
is there a way to turn off the mall purchases? i'd like to just transmute, since i've been farming the Battlefield.
 
Why would you want to do that?

An elemental wad usually costs less than the cost of another elemental wad AND a twinkly wad. Or at least, not very much more. Since you have mall access, shouldn't you use it to make your situation better?

Edit: If you really want to do that, I guess you could just change line 13

Code:
[COLOR="Red"]boolean mall = can_interact() && get_property("autoSatisfyWithMall").to_boolean();[/COLOR]

change to:
[COLOR="Green"]boolean mall = false;[/COLOR]
 
Last edited:
like i said, i'm farming the Battlefield. i'll have plenty of twinkly wads, at the very least. i have Pulverize and i'm a Sauceror right now, so i have Way(which i'll be perming after this run). it seems to me that would be the cheaper way to do it. i could be wrong, though. i often am about these things.

thanks for the code. i love your scripts.
 
like i said, i'm farming the Battlefield. i'll have plenty of twinkly wads, at the very least. i have Pulverize and i'm a Sauceror right now, so i have Way(which i'll be perming after this run). it seems to me that would be the cheaper way to do it. i could be wrong, though. i often am about these things.

thanks for the code. i love your scripts.

I don't have Rainbow's Gravitation skill so I haven't looked at this code all that much, but I've peeked.

It looks like, as is, if you have mall access, you buy what you need for wads that you don't have and then cast the skill.

If you don't have mall access, you then proceed into transmuting wads from wads you already have.

My thought on the process is as follows:

Twinkly wads are aplenty, but generally cost about 250 meat per in the mall.
Elemental wads vary in cost dramatically from about 400 to 980 per wad.

Transmutation costs 1 cooking turn. Let's say this cost is 500 meat for example purposes. If you have a chef-in-the-box, the turncost is converted to wear and tear/part replacement)

Transmutation chart:

hot+twinkly=cold
cold+twinkly=spooky
spooky+twinkly=stench
stench+twinkly=sleaze
sleaze+twinkly=hot

Let's say you have 3 cold, 3 spooky, 3 stench, 4 sleaze and 2 hot wads.

Cost to make that hot wad=
1 twinkly + 1 turn = 250+500=750 meat for 1 hot wad
The sleaze wad is not a cost as it is converted into the hot wad.

Now what if you had no extra sleaze wads and being a non-muscle class you can't malus things up. You do have an extra spooky wad though. So take a look at this:

You have 3 cold, 4 spooky, 3 stench, 3 sleaze, and 2 hot wads.

Cost to make the missing hot wad=
1 twinkly + 1 turn = stench +1 twinkly +1 turn=sleaze +1 twinkly +1 turn = hot =3 twinkly + 3 turns = 3(250)+3(500)=750+1500=2250 meat!

In short, transmuting for wads can add up costwise, but whether this matters to you or not is another matter ;)

-Spiny
 
Last edited:
Any way to set it to run 3 times? It's a whole 12 seconds taken off my life each day.

Seriously, I do love the script, but wouldn't mind a little pop up that asks how many wads to make. Perhaps that's more work to code than its worth, though.
 
It does pop-up a box to ask if you want to make wads, so I'm not sure exactly what you wanted in feedback.

As for running 3 times, that seems rather excessive for a script which is really optimized for hardcore. I figure for hardcore usage you'd want to run it three times separately, but if you want you could replace main() with this:

Code:
void main() {
	if(can_gravity())
		for i from 1 upto (3 - get_property("prismaticSummons").to_int())
			gravitate();
}

That will make it run as many times as you have summons.
 
Last edited:
Back
Top