Mafia Help!

Tenten21

New member
i've been staring at walls of text for what seems like ages trying to figure out how to do seemingly simple things, I simply want to collect daily stuff when I login and can't figure out breakfast, so if someone already has these scripts please avail them to me:

-Extrude 3 browser cookies from Terminal
-Collect Kardashian gin from time-spinner
-Create 3 potions of punctual companionship
-Cheat Mickey Mantle,Gift card, green mana
-Collect 3 splendid martini
-Use Overflowing Gift Basket

This is pretty much all I want and need in life right now.

Also: I did notice Bale had previously created a Clip art script that creates based on mall prices, but this no longer works. I did put serious effort into trying to figure this out before coming here.
 

Pazleysox

Member
i've been staring at walls of text for what seems like ages trying to figure out how to do seemingly simple things, I simply want to collect daily stuff when I login and can't figure out breakfast, so if someone already has these scripts please avail them to me:

-Extrude 3 browser cookies from Terminal
-Collect Kardashian gin from time-spinner
-Create 3 potions of punctual companionship
-Cheat Mickey Mantle,Gift card, green mana
-Collect 3 splendid martini
-Use Overflowing Gift Basket

This is pretty much all I want and need in life right now.

Also: I did notice Bale had previously created a Clip art script that creates based on mall prices, but this no longer works. I did put serious effort into trying to figure this out before coming here.
There's a script for the splendid martini (BRIEFCASE.ASH), and the time spinner (I believe FARFUTURE.ASH is available through mafia's script manager. Click scripts, script manager, install, and search for farfuture, install, run). Ezandora wrote them.

running it in a script like this:

cli_execute ("call farfuture.ash drink");

will allow it to be run daily, without the need to input you want a drink each day.

The rest should be pretty simple. I pulled most of this code from my rollover management script.

Code:
    if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
this should work added to any daily script to get what you need. I don't have an overflowing gift basket, but if I'm reading it properly this should do the trick:
Code:
cli_execute("use overflowing giftbasket");
 

Tenten21

New member
There's a script for the splendid martini (BRIEFCASE.ASH), and the time spinner (I believe FARFUTURE.ASH is available through mafia's script manager. Click scripts, script manager, install, and search for farfuture, install, run). Ezandora wrote them.

running it in a script like this:

cli_execute ("call farfuture.ash drink");

will allow it to be run daily, without the need to input you want a drink each day.

The rest should be pretty simple. I pulled most of this code from my rollover management script.

Code:
    if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
this should work added to any daily script to get what you need. I don't have an overflowing gift basket, but if I'm reading it properly this should do the trick:
Code:
cli_execute("use overflowing giftbasket");
This is quite useful! I do have the briefcase and farfuture scripts downloaded, I just needed to manually run them because I couldn't figure out how to get everything to work in breakfast.

So my daily script should look like this?

Code:
    if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    cli_execute ("call farfuture.ash drink");
    cli_execute ("call briefcase.ash collect");
    cli_execute("use overflowing giftbasket");
 

Pazleysox

Member
This is quite useful! I do have the briefcase and farfuture scripts downloaded, I just needed to manually run them because I couldn't figure out how to get everything to work in breakfast.

So my daily script should look like this?

Code:
    if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
    if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_clipartSummons").to_int() > 3) { cli_execute("create potion of punctual companionship")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    if(get_property("_sourceTerminalExtrudes").to_int() > 3) { cli_execute("extrude food")); }
    cli_execute ("call farfuture.ash drink");
    cli_execute ("call briefcase.ash collect");
    cli_execute("use overflowing giftbasket");
Pretty much. Make sure you add

Code:
main()
{
//code here
}
 

adeyke

Member
There's a problem with that script: every instance of > should be < instead.

(You can also replace the three "if" lines with a single line that has "while" instead.)

Also, I think Mafia's built-in breakfast already handles the overflowing gift basket.
 

Tenten21

New member
I made an ash file using this code:


main()
{
//if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
}

However when I attempt to run it I get the error: "Function 'main( )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (Dailystuff.ash, line 1)
 

Tenten21

New member
The line should probably be

void main()

At some point you might want to start reading https://wiki.kolmafia.us/index.php/KoLmafia_Guide:_Your_first_Script which may be dated but might help you on the next project.
I will take a look! I made the recommended correction and now am getting this error: "Expected ;, found ) (Dailystuff.ash, line 4)"
Which would be the bold line:


void main()
{
//if(get_property("_deckCardsDrawn").to_int() / 5 == 0) { cli_execute("cheat mickey mantle")); }
if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }
if(get_property("_deckCardsDrawn").to_int() / 5 == 2) { cli_execute("cheat green mana")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
if(get_property("_sourceTerminalExtrudes").to_int() < 3) { cli_execute("extrude food")); }
}
 

fronobulax

Developer
Staff member
if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card")); }

should be

if(get_property("_deckCardsDrawn").to_int() / 5 == 1) { cli_execute("cheat gift card"); }


Pro Tip #1 - Not every person who posts a script fragment worries about getting the syntax correct so be prepared to find and fix errors.

Pro Tip #2 - In ash sytnax, many things come in pairs -(), {}, "" and a few more. If you think of each pair as having a left and a right then if the number of lefts is not equal to the number of rights there is something missing or something extra.

I suspect a similar error in every line above :)

No significance to everything being bold.
 

Tenten21

New member
Thanks! I was able to successfully run this script:


void main() {
boolean temp;
temp = cli_execute("terminal extrude booze");
temp = cli_execute("terminal extrude booze");
temp = cli_execute("terminal extrude booze");
temp = cli_execute("cheat ancestral recall");
temp = cli_execute("cheat 1952 mickey mantle");
temp = cli_execute("cheat gift card");
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship"); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship"); }
if(get_property("_clipartSummons").to_int() < 3) { cli_execute("create potion of punctual companionship"); }
}

(Well the temp lines anyways, but the other corrected lines worked separately, so i'll tweak as needed tomorrow, since i'm largely feeding error messages into google and seeing what sticks)
 

Pazleysox

Member
Heh, sorry about that. I pulled the code from another script, and didn't bother to check if it would work first.

You can also setup that script to run when you login, so you don't have to remember to run it.

Go here:

General
Preferences
Automation
On Login:

Simply click on the open space, and direct it to your script, and wah-lah! Every time you login, it will run your script. Which, after your first run will simply tell you that you can't do that anymore. The way I had it scripted will only trigger the action if you have actions available to be triggered.
 

Tenten21

New member
Heh, sorry about that. I pulled the code from another script, and didn't bother to check if it would work first.

You can also setup that script to run when you login, so you don't have to remember to run it.

Go here:

General
Preferences
Automation
On Login:

Simply click on the open space, and direct it to your script, and wah-lah! Every time you login, it will run your script. Which, after your first run will simply tell you that you can't do that anymore. The way I had it scripted will only trigger the action if you have actions available to be triggered.
It's all well and good, i've reduced everything I need to do to one click and have a functioning script. Thanks!
 
Top