Tiny Plastic Series 1 collection script

lordbaum

New member
I didn't see anything on the board regarding this, so I thought I'd try my first posting of a script.

It doesn't get the items you need, but it does tell you which ones you are missing for the complete set of the Series 1 TP figures.

There's always the possibility to update it but it's a start.  I couldn't find anything to actually pull items from your store. If it finds it there, it just alerts you that you're selling something you need.

I had some problems... maybe just inexperience with these scripts, but there were some things I couldn't get to work after reading the Manual.
The museum_amount(item it) function wouldn't work so it doesn't tell you if the item is in your DC already.

And if anyone knows the .ash equivalent of if... elseif... else, it could be cleaned up a lot. I couldn't find anything about it in the manual.

*apologies if this should have gone into Item Management... it didn't really manage anything since it was more informational. So I put it here*
 

Attachments

  • tpfseries1.ash
    1.1 KB · Views: 133

Veracity

Developer
Staff member
[quote author=lordbaum link=topic=1330.msg6149#msg6149 date=1195680918]
And if anyone knows the .ash equivalent of if... elseif... else, it could be cleaned up a lot. I couldn't find anything about it in the manual.[/quote]

It works just as you expect. Here's a test script I wrote a year and a half ago:

Code:
void func( int x )
{
    print( "Testing x = " + x );
    if ( x < 5 )
        print( "x lt 5" );
    else if ( x == 5 )
        print( "x == 5" );
    else if ( x == 7 )
        print( "x == 7" );
    else if ( x > 20 )
        print( "x > 20" );
    else if ( x < 10 )
        print( "x lt 10" );
    else
        print( "Nothing special" );
    print( "Done testing x" );
}

func( 3 );
func( 5 );
func( 7 );
func( 25 );
func( 12 );
 
[quote author=lordbaum link=topic=1330.msg6149#msg6149 date=1195680918]

There's always the possibility to update it but it's a start. I couldn't find anything to actually pull items from your store. If it finds it there, it just alerts you that you're selling something you need.
[/quote]

Code:
if(shop_amount(it) > 0)
{
 //print("You have " + it + ", but it's being sold in your store.");
 print("Pulling " + it + " from your store.");
 visit_url("managestore.php?action=take&whichitem=" + to_int(it));
}

[quote author=lordbaum link=topic=1330.msg6149#msg6149 date=1195680918]
I had some problems... maybe just inexperience with these scripts, but there were some things I couldn't get to work after reading the Manual.
The museum_amount(item it) function wouldn't work so it doesn't tell you if the item is in your DC already.
[/quote]

Code:
visit_url("managecollection.php");

Then proceed to get info about your DC. Kolmafia doesn't grab the info about your DC till you actually visit your DC, or make kolmafia do it. This is probably because for normal day to day use this information is irrelevant, and in my case at least would be a large block of un-needed data which would just consume memory, and slow kolmafia down.
 
Top