Example #1
0
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)
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)
Example #5
0
    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)
Example #6
0
def found_item(item, client, bag):
    drop_into(client, item, bag)
    return reactor.callLater(1, find_next, client, bag)
Example #7
0
def found_item(item, client, bag):
    drop_into(client, item, bag)
    return reactor.callLater(1, find_next, client, bag)
Example #8
0
 def _donate(self, gold):
     drop_into(self._client, gold, self._to, 1)
     self._success()
Example #9
0
 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)
Example #10
0
 def _donate(self, gold):
     drop_into(self._client, gold, self._to, 1)
     self._success()