Page 6 of 6 FirstFirst ... 4 5 6
Results 51 to 53 of 53

Thread: Save items from pvp theft

  1. #51
    Senior Member
    Join Date
    Oct 2017
    Posts
    344

    Default

    replace "autosell_price(it) > 0" with "is_discardable(it)"
    Originally Posted by Veracity View Post
    Thanks. This worked, I then went ahead and made some changes of my own (beyond integrating the fix above):

    1. verbosity now has levels. 0 = don't print individual items; 1 = print closeted items; 2 = also too cheap to closet; 3 = also unstealable.
    2. instead of popup you set run/simulate in config
    3. if verbosity is on 1 or higher, it will show you the mall item price of the pvp stealable items.
    4. remove pluralization in verbose so you can copy paste it into searchbar without need to start futzing with it.

    Code:
    //history.
    //v1 by lostcalpolydude, initial functionality
    //v2 by mstieler, multiclosetting no longer a thing
    //v3 by nworbetan, fancied up
    //v4 by Veracity, fixed script not working anymore
    //v5 by taltamir, verbosity now has levels, instead of popup you set run/simulate in config, list item mall price if set to verbose, remove pluralization in verbose so you can copy paste it into searchbar without need to start futzing with it.
    //v6 by Thok, missing comment caught
    
    //CONFIG START - set your options below
    
    
    int minimum_value = 5000; // Closet everything stealable worth more than this; 0 = closet everything stealable.
    int verbose = 1; //0 = don't print individual items; 1 = print closeted items; 2 = also too cheap to closet; 3 = also unstealable.
    boolean go = true; //false to simulate, true to run script.
    
    
    //CONFIG ENDS
    
    
    void main()
    {
        if (minimum_value < 0) abort ("A minimum_value less than zero makes no sense at all.");
        int count_cheap, count_closet, count_total, count_unstealable;
        int [item] inv = get_inventory();
        boolean [item] pvp_unimportant = $items[tenderizing hammer, dramatic range, Queue Du Coq cocktailcrafting kit];
        boolean is_stealable(item it) { return is_tradeable(it) && is_discardable(it); }
        foreach it, qty in inv {
            int price = -1;
            if (is_stealable(it) && !(pvp_unimportant contains it)) price = historical_price(it);
            if (price < 0) 
            {
                count_unstealable += 1;
                if (verbose>=3) print_html("<span color=\"green\">Unstealable: " + qty + " " + it + "</span>");
            }
            else if (price < minimum_value) 
            {
                count_cheap += 1;
                if (verbose>=2) print_html("<span color=\"red\">Don't closet " + qty + " " + it + " @ " + historical_price(it) + " each in the mall.</span>");
            }
            else if (price >= minimum_value) 
            {
                count_closet += 1;
                if (verbose>=1) print_html("<span color=\"teal\">" + (go ? "Closet " : "Simulate closet ") + qty + " " + it + " @ " + historical_price(it) + " each in the mall.</span>");
    
    
                if (go) put_closet(qty, it);
            }
            
        }
        count_total = count_closet + count_cheap + count_unstealable;
        print(""); //linebreak
        if (count_closet > 0) print("+ " + count_closet + (go ? "" : " woulda been") + " closeted", "teal");
        if (count_cheap > 0) print("+ " + count_cheap + " worth less than " + minimum_value + " meat", "red");
        if (count_unstealable > 0) print("+ " + count_unstealable + " unstealable", "green");
        if (count_total > 0) print(" = " +  count_total + " of " + count(inv) + " items accounted for.");
        print_html("<b>Done! <a href=\"http://kolmafia.us/showthread.php?10059\">discussion thread link</a></b>");
    }
    Last edited by taltamir; 11-28-2018 at 08:36 AM.

  2. #52
    Junior Member Thok's Avatar
    Join Date
    May 2009
    Posts
    19

    Default

    Slight bug there. Needs a comment character, like so:

    Code:
    int verbose = 1; // 0 = don't print individual items; 1 = print closeted items; 2 = also too cheap to closet; 3 = also unstealable.

  3. #53
    Senior Member
    Join Date
    Oct 2017
    Posts
    344

    Default

    Slight bug there. Needs a comment character, like so:

    Code:
    int verbose = 1; // 0 = don't print individual items; 1 = print closeted items; 2 = also too cheap to closet; 3 = also unstealable.
    Originally Posted by Thok View Post
    thanks. I accidentally deleted the // symbol when I rephrased that comment for clarity
    Last edited by taltamir; 11-28-2018 at 08:50 AM.

Similar Threads

  1. Replies: 0
    Last Post: 08-07-2015, 06:00 PM
  2. Feature - Implemented Cache store items so that shop_amount() can save server hits
    By zarqon in forum Bug Reports
    Replies: 9
    Last Post: 09-10-2012, 11:33 PM
  3. Replies: 0
    Last Post: 06-24-2011, 08:41 PM
  4. Feature - Rejected Save Connection Options
    By mredge73 in forum Bug Reports
    Replies: 10
    Last Post: 02-14-2011, 11:59 PM
  5. Ubuntu Save Path
    By conan359 in forum Community Support
    Replies: 3
    Last Post: 01-01-2010, 08:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •