Museum Item # Check 1-1489 (ASH)

Nightmist

Member
Museum "atleast one of each item" (Upto item 1489 and excluding item 785)

Note: 250 item code blocks since when mafia prints lots of stuff to the CLI it tend to slow down a bit. (On my machine anyway)

( Looks like the forum cut the script off... :( Hopefully, you don't mind attaching it as a file? I'll start a conversation on this elsewhere... -Daychilde ;D )


Edit: hahah yeah sorry about that didnt notice it, figured if it fit into the message box then it posted it all, apparently i was wrong, removed the existed printed text and attached a zip file with the 6 .ash files in it. (Oh... forgot to edit those text files, they are currently set to if less then 10, if you want to edit them to all only if less then 1 then see below Edit2)

Edit2: Oh and if anyone wants more then 1 of each item (My scripts orginally had if less then 10 of item which is why it prints howmany you have already in there.) just use a "replace" function in notepad or something and (The XX = the number you want to have in d-case)

Find = ) < 10)
Replace = ) < 1)

Edit3: Oh didnt know you can add more then two by modding it >> *Adds individual files*
 
This was indeed a heroic effort. However, I think it's possible to do the same task in a MUCH shorter script. This has NOT been tested, I'm writing it as I reply here...
Code:
int itemNumber;
itemNumber = 1;
while itemNumber < 1489
{
    int skip;
    skip = 0;
    if( itemNumber = 13)
        skip = 1;
    if( itemNumber = 26)
        skip = 1;
    if( itemNumber > 62 && itemNumber < 66)
         skip = 1;
// just keep inserting itemNumbers to be skipped...
// until finally, after checking all the to-be-skipped itemNumbers...
    if (skip = 0)
    {
      if( museum_amount( $item[itemNumber]) < 1)
        {
            print( itemNumber + ". You have " + int_to_string( museum_amount( $item[itemNumber])) + " " + item_to_string( $item[itemNumber]));
        }
    }
    itemNumber = itemNumber + 1;
}

EDIT: Changed order of skip/museum count checks to slightly decrease the number of potential server hits... although I think KoLmafia caches that info anyway.
 
Bucket de Mowbray,

That would work, if we could access items by variables. Unless the change was implemented without me knowing (quite possible), that change isn't included yet.

This goes back to some of us wishing there were arrays and such. ;)
 

Nightmist

Member
Indeed since I was under the impression it runs a perfect string match and then if that fails then a item number match. However yes if it does allow items by a variable then that would work. (You might want to add ()'s after your while.
 
Top