Ejemplo n.º 1
0
    def _got_skill(self, result):
        target = tailoring_target(result.value)
        if target is None:
            self._failure(NoTailoringTarget())
            return

        client = self._client
        client.send(p.Use(self.tool.serial))

        d = MenuResponse(client, target).deferred
        d.addCallbacks(self._success, self._success)
Ejemplo n.º 2
0
    def _got_skill(self, result):
        target = tailoring_target(result.value)
        if target is None:
            self._failure(NoTailoringTarget())
            return

        client = self._client
        client.send(p.Use(self.tool.serial))

        d = MenuResponse(client, target).deferred
        d.addCallbacks(self._success, self._success)
Ejemplo n.º 3
0
    def __init__(self, client):
        Engine.__init__(self, client)

        tool = client.world.find_item_in(client.world.backpack(), lambda x: x.item_id in ITEMS_CARPENTRY_TOOLS)
        if tool is None:
            print "No tool"
            self._failure()
            return

        client.send(p.Use(tool.serial))

        d = MenuResponse(client, ('Other', 'board: 1 Logs')).deferred
        d.addCallbacks(self._responded, self._failure)
Ejemplo n.º 4
0
    def __init__(self, client):
        Engine.__init__(self, client)

        tool = client.world.find_item_in(
            client.world.backpack(),
            lambda x: x.item_id in ITEMS_CARPENTRY_TOOLS)
        if tool is None:
            print("No tool")
            self._failure()
            return

        client.send(p.Use(tool.serial))

        d = MenuResponse(client, ('Other', 'board: 1 Logs')).deferred
        d.addCallbacks(self._responded, self._failure)
Ejemplo n.º 5
0
    def _found_tool(self, tool):
        client.send(p.Use(tool.serial))

        d = MenuResponse(client, target).deferred
        d.addCallbacks(self._success, self._success)
Ejemplo n.º 6
0
 def _used(self, result):
     d = MenuResponse(self._client, self.target).deferred
     d.addCallbacks(self._success, self._success)
Ejemplo n.º 7
0
 def _target_sent(self, result):
     d = MenuResponse(self._client, self.choice).deferred
     d.addCallbacks(self._responded, self._failure)
Ejemplo n.º 8
0
 def _used(self, result):
     d = MenuResponse(self._client, self.target).deferred
     d.addCallbacks(self._success, self._success)
Ejemplo n.º 9
0
    def _found_tool(self, tool):
        client.send(p.Use(tool.serial))

        d = MenuResponse(client, target).deferred
        d.addCallbacks(self._success, self._success)
Ejemplo n.º 10
0
 def _target_sent(self, result):
     d = MenuResponse(self._client, self.choice).deferred
     d.addCallbacks(self._responded, self._failure)