Page 1 of 6 1 2 3 ... LastLast
Results 1 to 10 of 53

Thread: Save items from pvp theft

  1. #1

    Default Save items from pvp theft

    I wanted a quick way to make sure nothing valuable would get stolen after breaking my hippy stone, so I made this little script. I would have attached it, but this seems like the type of thing other people will modify and make much more useful.

    Code:
    int expensiveValue = 10000;
    
    int get_price( item itm )
    {
    	if ( historical_age( itm ) < 14 ) return historical_price( itm );
    	return mall_price( itm );
    }
    
    boolean is_pvpable( item thing )
    {
    	return thing.tradeable && thing.discardable && !thing.gift && !thing.quest;
    }
    
    void main()
    
    {
    	int[item] inventory = get_inventory();
    	batch_open();
    	foreach it in inventory
    	{
    		if( is_pvpable( it ) && get_price( it ) > expensiveValue )
    		{
    			print_html( it + ": " + get_price( it ) );
    			#put_closet( item_amount( it ), it);
    		}
    	}
    	batch_close();
    }
    Change expensiveValue to set the threshold for item value that you care about. This form just prints information, but you can move the comment to have everything closeted. Or change that one line to do whatever you want with the items (mall, display case, whatever).
    Last edited by lostcalpolydude; 01-03-2013 at 05:29 AM.

  2. #2
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,185

    Default

    I always thought that items in the closet, as well as inventory, were available to be stolen. The Wiki says that, too, so we know that MUST be right.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  3. #3

    Default

    I thought closet items were only eligible if you didn't have an item in that category in your inventory. I don't know why I thought that.

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,185

    Default

    I just saw somebody say that on G-D.
    It might be true.

    Things in the DC and Storage are completely immune. I'll be trying PVP after I ascend again and free the king - without emptying my storage, which I started doing, after CDM changed it such that things could go into your closet when you did that.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  5. #5

    Default

    CDMoyer already explained in the forums:

    What kinds of items can and cannot be stolen.

    Items in your closet were safe, and always will be.

    So will the ones in Hagnks and DC.


    Edit: Also, here's my rudimentary PvP item safeguard script. It closets all steal-able items above a specific mall price, excluding a few items.
    The pvp_unimportant thing was added because mall_price() was returning 1000 meat for the oven/cocktail kit/hammer. Weird.

    PHP Code:
    int minimum_value 1000;
    boolean [itempvp_unimportant $items[tenderizing hammerdramatic rangeQueue Du Coq cocktailcrafting kit];

    //Rudimentary function
    boolean is_stealable(item it) { return is_tradeable(it) && autosell_price(it) > 0; }

    //Note: Ever since the Closet revamp, multi-putting and multi-taking is impossible.
    // Thus batch_open() and batch_close() are not needed.
    foreach itqty in get_inventory() {
        if (
    is_stealable(it) && mall_price(it) >= minimum_value && !(pvp_unimportant contains it)) {
            print(
    'Gonna closet ' qty ' ' + (qty == to_string(it) : to_plural(it)) + '.''teal');
            
    put_closet(qtyit);
        }
    }

    print_html('<b>Done!</b>'); 
    Attached Files
    Last edited by philmasterplus; 05-01-2012 at 02:45 PM.
    I started playing back in the summer of 2008, and began using KoLmafia about two months after.

  6. #6

    Default

    Safe, only if you had a legal target.

    100 fortune cookies give food legal targets, 100 boxed wine gives booze legal targets, 100 hair spray gives 'other' legal target.

    Then again, I could be misunderstanding, I do that quite a bit.

  7. #7

    Default

    Safe, only if you had a legal target.

    100 fortune cookies give food legal targets, 100 boxed wine gives booze legal targets, 100 hair spray gives 'other' legal target.

    Then again, I could be misunderstanding, I do that quite a bit.
    Originally Posted by Nightwind_292 View Post
    That works, as long as you closet or uncloset stuff about a hundred times per day as you gain items or decide you want to use them. At some point the meat saved isn't worth the effort.

    Code:
    //Note: Ever since the Closet revamp, multi-putting and multi-taking is impossible.
    // Thus batch_open() and batch_close() are not needed.
    While true, I included it in case KoL changes. Or in case someone decides to use their display case instead.

  8. #8

    Default

    Just had a thought...how does KoL decide which item to yoink from the victim's inventory?

    Hypothesis: Choose any item from a pool of tradeable, autosell-able, non-gift item in the inventory. Does not take item quantities into account.

    This would mean that having 2-3 each of thousands of items would significantly reduce chances of any important item getting stolen. Whereas "buy 100 hair sprays" approach wouldn't be as effective.

    Now this solution would make your inventory a huge cluttered mess.
    I started playing back in the summer of 2008, and began using KoLmafia about two months after.

  9. #9
    Senior Member
    Join Date
    Dec 2006
    Location
    Seattle, WA
    Posts
    287

    Default

    Code:
    ...is_giftable( thing )...
    Originally Posted by lostcalpolydude View Post
    If I understand correctly, gift items are not stealable. (I am also assuming "is_giftable" means "Gift Item")

  10. #10
    Senior Member
    Join Date
    Jan 2009
    Posts
    195

    Default

    Whereas "buy 100 hair sprays" approach wouldn't be as effective.
    Originally Posted by philmasterplus View Post
    I believe the idea of that plan is: Closet everything and then buy 100 hairsprays (and 100 fortune cookies and 100 day-old beers) so that someone PVPing you for items, food, or booze gets a hairspray/cookie/beer and does not touch your "real" inventory at all.

    It's a bit different from the plan of "Closet the expensive stuff, and the rest is up for grabs."

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
  •