예제 #1
0
 def _check(self):
     if self.player.mass_remaining(
     ) < 50 or self.world.combatant is not None:
         self._restock()
     else:
         d = deferred_find_player_item(self._client,
                                       lambda x: x.item_id in ITEMS_AXE)
         d.addCallbacks(self._found_axe, self._no_axe)
예제 #2
0
    def __init__(self, client, to):
        Engine.__init__(self, client)

        self._to = to

        d = deferred_find_player_item(client, lambda x: x.item_id == ITEM_GOLD)
        # No gold is success, because this engine is meant for use
        # cases where you donate all your money to raise Karma
        d.addCallbacks(self._donate, self._success)
예제 #3
0
파일: donate.py 프로젝트: cculianu/gemuo
    def __init__(self, client, to):
        Engine.__init__(self, client)

        self._to = to

        d = deferred_find_player_item(client, lambda x: x.item_id == ITEM_GOLD)
        # No gold is success, because this engine is meant for use
        # cases where you donate all your money to raise Karma
        d.addCallbacks(self._donate, self._success)
예제 #4
0
    def _begin(self):
        player = self._client.world.player
        if player.mass_remaining() < 25:
            self._success()
            return

        d = deferred_find_player_item(
            self._client, lambda x: x.item_id in ITEMS_MINING_TOOLS)
        d.addCallbacks(self._found_tool, self._failure)
예제 #5
0
 def _check(self):
     if self.player.is_dead():
         log.msg("Waiting for resurrection")
         reactor.callLater(10, self._check)
     elif self.player.mass_remaining(
     ) < 50 or self.world.combatant is not None:
         log.msg("Flee to safe place until combat is over")
         self._restock()
     else:
         d = deferred_find_player_item(self._client,
                                       lambda x: x.item_id in ITEMS_AXE)
         d.addCallbacks(self._found_axe, self._no_axe)
예제 #6
0
파일: lumber.py 프로젝트: cculianu/gemuo
 def _check(self):
     if self.player.mass_remaining() < 50 or self.world.combatant is not None:
         self._restock()
     else:
         d = deferred_find_player_item(self._client, lambda x: x.item_id in ITEMS_AXE)
         d.addCallbacks(self._found_axe, self._no_axe)
예제 #7
0
 def _find_axe(self):
     d = deferred_find_player_item(self._client, lambda x: x.item_id in ITEMS_AXE)
     d.addCallbacks(self._found_axe, self._failure)