# Forum:Cancellation wand vs. bag of holding
&lt; Forum:Watercooler

I was getting ready to ascend a lvl 29 Barbarian -25 AC twoweaponing +7 FireBrand and +6 silver saber along with +6 FrostBrand
for those that needed that kind of punishment. I had three bags of holding and was on lvl 1 when I made the unforgivable mistake
of putting a wand of cancellation into my main bag. I had already dropped the other 2 BoHs and was looting and sorting on lvl 1
in preparation of the ascent. Oh well -- Stochastic giveth and Stochastic taketh away. Might I suggest a warning similar to running
into peacefuls? "Do you really want to attack the gremlin?" could become something like "Do you really want to put that wand of
cancellation into your bag of holding" Alas, I had only one scroll of gold detection and no booze/confusion so it was probably a 
lost cause anyway.  C'est la guerre.  Mannc (talk) 00:56, 11 March 2015 (UTC)

that hurts. maybe amy can help you with the prompt. as far as the wiki goes, it's got a whole section on this in "bag of holding" and a quick search reveals it is mentioned in "wand of cancellation", "magical explosion", "lessons learned the hard way" and "Bad Idea". --195.2.244.193 13:04, 11 March 2015 (UTC)
Something like this might help:

if (Is_mbag(current_container) &amp;&amp; &amp;objects[current_container-&gt;otyp]-&gt;oc_name_known &amp;&amp; (obj-&gt;otyp == WAN_CANCELLATION || obj-&gt;otyp == BAG_OF_TRICKS || obj-&gt;otyp == BAG_OF_HOLDING) &amp;&amp; &amp;objects[obj-&gt;otyp]-&gt;oc_name_known) {
	if (yn_function("Really put that inside?", ynchars, 'n') == 'y' {
	/* do nothing */
	}
	else return 0;
}

function: in_container_(obj,invobj) (pickup.c); it might need some adjustments though. --Bluescreenofdeath (talk) 14:20, 11 March 2015 (UTC)
Cool - thanks very much. I've read the pages you linked. Thanks too for the script; I knew I had screwed up instantly but was examining a HUGE inventory (3 BOH)and it just got by me. Will let you know how it works after playing a quick Wiz mode game. Thx again. Mannc (talk) 01:44, 12 March 2015 (UTC)