def _box_opened(self, bank): counts = ( (ITEMS_LOGS + ITEMS_BOARDS, 150), ) d = Restock(self._client, bank, counts=counts).deferred d.addCallbacks(self._restocked, self._failure)
def _box_opened(self, result): counts = ( (ITEMS_CARPENTRY_TOOLS, 2), (ITEMS_LOGS + ITEMS_BOARDS, 50), ) d = Restock(self._client, self._box, counts=counts).deferred d.addCallbacks(self._success, self._failure)
def restock(client): world = client.world player = world.player box = find_restock_box(world) if box is None: return defer.fail(NoSuchEntity('No box')) counts = ( (ITEMS_TINKERING_TOOLS, 2), (ITEMS_INGOT, 100), ) return Restock(client, box, counts=counts, func=out_filter).deferred
def restock_miner(client, bank): def out_filter(x): if x.item_id in ITEMS_MINING_TOOLS: return False if player_can_melt(client.world.player) and \ x.item_id in ITEMS_ORE: return False return True counts = ( (ITEMS_MINING_TOOLS, 3), # only if STR=100: #(ITEMS_ORE, 82), ) return Restock(client, bank, func=out_filter, counts=counts).deferred
def chest_opened(client, chest): return Restock(client, chest, func=lambda x: x.item_id == ITEM_WOOL)
def _opened(self, bank): d = Restock(self._client, bank, func=self._out_filter, counts=((ITEMS_AXE, 1),)).deferred d.addCallbacks(self._restocked, self._failure)
def _opened(self, bank): d = Restock(self._client, bank, func=self._out_filter, counts=((ITEMS_AXE, 1), )).deferred d.addCallbacks(self._restocked, self._failure)