def PutBoards(client, box): world = client.world boards = world.find_item_in(world.backpack(), lambda x: x.item_id in ITEMS_BOARDS) if boards is None: print "No boards" return Fail(client) drop_into(client, boards, box) return Delayed(client, 1)
def TakeLogs(client, box, amount=180): world = client.world logs = world.find_item_in(box, lambda x: x.item_id in ITEMS_LOGS) if logs is None: print "No logs in box" return Fail(client) drop_into(client, logs, world.backpack(), amount) return Delayed(client, 1)
def TakeLogs(client, box, amount=300): world = client.world logs = world.find_item_in(box, lambda x: x.item_id in ITEMS_LOGS) if logs is None: print("No logs in box") return Fail(client) drop_into(client, logs, world.backpack(), amount) return Delayed(client, 1)
def _found(self, i): amount = self.amount if amount > i.amount: amount = i.amount drop_into(self._client, i, self.destination, amount) self.amount -= amount if self.amount > 0: reactor.callLater(1, self._next) else: reactor.callLater(1, self._success)
def found_item(item, client, bag): drop_into(client, item, bag) return reactor.callLater(1, find_next, client, bag)
def _donate(self, gold): drop_into(self._client, gold, self._to, 1) self._success()
def _found_lock(self, item): assert self.busy log.msg("move %s" % item) drop_into(self._client, item, self.locked_box) reactor.callLater(1, self._move)