Ejemplo n.º 1
0
    def __init__(self, client, target):
        Engine.__init__(self, client)

        self.target = target

        d = deferred_find_item_in_backpack(client, lambda x: x.item_id == ITEM_BANDAGE)
        d.addCallbacks(self._found_bandage, self._failure)
Ejemplo n.º 2
0
    def __init__(self, client, goal):
        Engine.__init__(self, client)

        self.goal = goal

        d = deferred_skills(client)
        d.addCallbacks(self._got_skills, self._failure)
Ejemplo n.º 3
0
    def __init__(self, client, responses):
        Engine.__init__(self, client)

        assert len(responses) > 0
        self.responses = list(responses)

        self.call_id = reactor.callLater(5, self._timeout)
Ejemplo n.º 4
0
    def __init__(self, client, map):
        Engine.__init__(self, client)
        self._map = map
        self.tries = 5

        print "Bank"
        self._walk()
Ejemplo n.º 5
0
Archivo: items.py Proyecto: shyba/gemuo
    def __init__(self, client, container, ids):
        Engine.__init__(self, client)
        self.container = container
        self.ids = ids

        d = OpenContainer(client, container).deferred
        d.addCallbacks(self._opened, self._failure)
Ejemplo n.º 6
0
    def __init__(self, client, map):
        Engine.__init__(self, client)
        self._map = map
        self.tries = 5

        print "Bank"
        self._walk()
Ejemplo n.º 7
0
    def __init__(self, client, map):
        Engine.__init__(self, client)
        self._map = map
        self.__tries = 5

        d = deferred_find_item_in_backpack(self._client, can_melt)
        d.addCallbacks(self._found_ore, self._no_ore)
Ejemplo n.º 8
0
    def __init__(self, client, responses):
        Engine.__init__(self, client)

        assert len(responses) > 0
        self.responses = list(responses)

        self.call_id = reactor.callLater(5, self._timeout)
Ejemplo n.º 9
0
    def __init__(self, client, path):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.path = list(path)

        self._next_walk()
Ejemplo n.º 10
0
    def __init__(self, client, x, y):
        Engine.__init__(self, client)

        self.__tries = 5
        self.x = x
        self.y = y
        self._next()
Ejemplo n.º 11
0
    def __init__(self, client, server, port, channel):
        Engine.__init__(self, client)

        self.channel = channel
        self.irc = None

        d = reactor.connectTCP(server, port, self)
Ejemplo n.º 12
0
    def __init__(self, client, path):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.path = list(path)

        self._next_walk()
Ejemplo n.º 13
0
    def __init__(self, client, server, port, channel):
        Engine.__init__(self, client)

        self.channel = channel
        self.irc = None

        d = reactor.connectTCP(server, port, self)
Ejemplo n.º 14
0
    def __init__(self, client, goal):
        Engine.__init__(self, client)

        self.goal = goal

        d = deferred_skills(client)
        d.addCallbacks(self._got_skills, self._failure)
Ejemplo n.º 15
0
    def __init__(self, client, container, ids):
        Engine.__init__(self, client)
        self.container = container
        self.ids = ids

        d = OpenContainer(client, container).deferred
        d.addCallbacks(self._opened, self._failure)
Ejemplo n.º 16
0
 def __init__(self, client, red_friends, house_rectangle):
     Engine.__init__(self, client)
     self.target = None
     self.red_friends = red_friends
     self.xmin = house_rectangle[0]
     self.xmax = house_rectangle[2]
     self.ymin = house_rectangle[1]
     self.ymax = house_rectangle[3]
Ejemplo n.º 17
0
    def __init__(self, client, destination):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.walk = client.world.walk
        self.destination = destination

        self._next_walk()
Ejemplo n.º 18
0
    def __init__(self, client, map):
        Engine.__init__(self, client)

        self.map = map
        self.min_x, self.min_y = 1429,1540
        self.max_x, self.max_y = 1516,1734
        self.random = random.Random()
        self._next_walk()
Ejemplo n.º 19
0
    def __init__(self, client, map, destinations):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.map = MapWrapper(map)
        self.destinations = destinations

        self._try()
Ejemplo n.º 20
0
    def __init__(self, client, container=None):
        Engine.__init__(self, client)
        self.__failed = False
        self.__tries = 10
        self.container = container

        d = OpenContainer(client, self.container).deferred
        d.addCallbacks(self._more, self._failure)
Ejemplo n.º 21
0
    def __init__(self, client):
        Engine.__init__(self, client)

        if not self._client.is_dead():
            self._success()
            return

        self._client.send(p.WarMode(True))
Ejemplo n.º 22
0
 def __init__(self, client, red_friends, house_rectangle):
     Engine.__init__(self, client)
     self.target = None
     self.red_friends = red_friends
     self.xmin = house_rectangle[0]
     self.xmax = house_rectangle[2]
     self.ymin = house_rectangle[1]
     self.ymax = house_rectangle[3]
Ejemplo n.º 23
0
    def __init__(self, client, mana):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.mana = mana

        d = deferred_skill(client, SKILL_MEDITATION)
        d.addCallbacks(self._got_meditation_skill, self._failure)
Ejemplo n.º 24
0
    def __init__(self, client, username, password, character):
        Engine.__init__(self, client)

        self._username = username
        self._password = password
        self._character = character

        self._client.send(p.AccountLogin(username, password))
Ejemplo n.º 25
0
    def __init__(self, client, spell, target):
        Engine.__init__(self, client)

        self.spell = spell
        self.target = target

        self.target_mutex = client.target_mutex
        self.target_mutex.get_target(self._target_ok, self._target_abort)
Ejemplo n.º 26
0
    def __init__(self, client, mana):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.mana = mana

        d = deferred_skill(client, SKILL_MEDITATION)
        d.addCallbacks(self._got_meditation_skill, self._failure)
Ejemplo n.º 27
0
    def __init__(self, client, destination):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.walk = client.world.walk
        self.destination = destination

        self._next_walk()
Ejemplo n.º 28
0
    def __init__(self, client, map, exhaust_db):
        Engine.__init__(self, client)
        self.world = client.world
        self.player = client.world.player
        self.map = map
        self.exhaust_db = exhaust_db

        self._check()
Ejemplo n.º 29
0
 def __init__(self, client, itemid, amount):
     Engine.__init__(self, client)
     self.buy_items = list()
     self.vendor = None
     self.itemid = itemid
     self.amount = amount
     self.call_id = reactor.callLater(2, self._timeout)
     self.get_offer()
Ejemplo n.º 30
0
    def __init__(self, client, username, password, character):
        Engine.__init__(self, client)

        self._username = username
        self._password = password
        self._character = character

        self._client.send(p.AccountLogin(username, password))
Ejemplo n.º 31
0
    def __init__(self, client, map):
        Engine.__init__(self, client)

        self.map = map
        self.min_x, self.min_y = 1429, 1540
        self.max_x, self.max_y = 1516, 1734
        self.random = random.Random()
        self._next_walk()
Ejemplo n.º 32
0
    def __init__(self, client, spell, target):
        Engine.__init__(self, client)

        self.spell = spell
        self.target = target

        self.target_mutex = client.target_mutex
        self.target_mutex.get_target(self._target_ok, self._target_abort)
Ejemplo n.º 33
0
    def __init__(self, client, items, container):
        Engine.__init__(self, client)

        self._items = []
        self._items.extend(items)
        self._container = container

        self._next()
Ejemplo n.º 34
0
Archivo: heal.py Proyecto: shyba/gemuo
    def __init__(self, client, target):
        Engine.__init__(self, client)

        self.target = target

        d = deferred_find_item_in_backpack(client,
                                           lambda x: x.item_id == ITEM_BANDAGE)
        d.addCallbacks(self._found_bandage, self._failure)
Ejemplo n.º 35
0
    def __init__(self, client, map, exhaust_db):
        Engine.__init__(self, client)
        self.world = client.world
        self.player = client.world.player
        self.map = map
        self.exhaust_db = exhaust_db

        self._check()
Ejemplo n.º 36
0
Archivo: buy.py Proyecto: shyba/gemuo
 def __init__(self, client, itemid, amount):
     Engine.__init__(self, client)
     self.buy_items = list()
     self.vendor = None
     self.itemid = itemid
     self.amount = amount
     self.call_id = reactor.callLater(2, self._timeout)
     self.get_offer()
Ejemplo n.º 37
0
    def __init__(self, client, delay, func, *args, **keywords):
        Engine.__init__(self, client)

        self.delay = delay
        self.func = func
        self.args = args
        self.keywords = keywords

        reactor.callLater(self.delay, self._next)
Ejemplo n.º 38
0
    def __init__(self, client, username, password, character, connect=connect):
        Engine.__init__(self, client)

        self.username = username
        self.password = password
        self.character = character
        self.connect = connect

        client.send(p.AccountLogin(username, password))
Ejemplo n.º 39
0
 def __init__(self, client):
     Engine.__init__(self, client)
     self.mutex = thread.allocate_lock()
     self.entities = dict()
     self.player = None
     self.walk = None
     self.combatant = None
     self.map_width = None
     self.map_height = None
Ejemplo n.º 40
0
    def __init__(self, client, map, destination):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.walk = client.world.walk
        self.map = MapWrapper(map)
        self.destination = destination

        self._path_find()
Ejemplo n.º 41
0
    def __init__(self, client, map):
        Engine.__init__(self, client)
        self.map = map

        self.accept = None
        self.walk = None

        if client.is_dead():
            self.on_death()
Ejemplo n.º 42
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)
Ejemplo n.º 43
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.spinningwheel = find_reachable_spinning_wheel(client.world)
        if self.spinningwheel is None:
            self._failure(NoSuchEntity('No spinning wheel'))
            return

        self._next()
Ejemplo n.º 44
0
    def __init__(self, client, map, destination):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.walk = client.world.walk
        self.map = MapWrapper(map)
        self.destination = destination

        self._path_find()
Ejemplo n.º 45
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)
Ejemplo n.º 46
0
    def __init__(self, client, username, password, character, connect=connect):
        Engine.__init__(self, client)

        self.username = username
        self.password = password
        self.character = character
        self.connect = connect

        client.send(p.AccountLogin(username, password))
Ejemplo n.º 47
0
 def __init__(self, client):
     Engine.__init__(self, client)
     self.mutex = thread.allocate_lock()
     self.entities = dict()
     self.player = None
     self.walk = None
     self.combatant = None
     self.map_width = None
     self.map_height = None
Ejemplo n.º 48
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.spinningwheel = find_reachable_spinning_wheel(client.world)
        if self.spinningwheel is None:
            self._failure(NoSuchEntity('No spinning wheel'))
            return

        self._next()
Ejemplo n.º 49
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.oven = find_reachable_oven(client.world)
        if self.oven is None:
            self._failure(NoSuchEntity("No oven"))
            return

        self._cook_single_steak()
Ejemplo n.º 50
0
    def __init__(self, client, delay, func, *args, **keywords):
        Engine.__init__(self, client)

        self.delay = delay
        self.func = func
        self.args = args
        self.keywords = keywords

        reactor.callLater(self.delay, self._next)
Ejemplo n.º 51
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.oven = find_reachable_oven(client.world)
        if self.oven is None:
            self._failure(NoSuchEntity('No oven'))
            return

        self._cook_single_steak()
Ejemplo n.º 52
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.target_mutex = client.target_mutex
        self.loom = find_reachable_loom(client.world)
        if self.loom is None:
            self._failure(NoSuchEntity('No loom'))
            return

        self._next()
Ejemplo n.º 53
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.target_mutex = client.target_mutex
        self.loom = find_reachable_loom(client.world)
        if self.loom is None:
            self._failure(NoSuchEntity('No loom'))
            return

        self._next()
Ejemplo n.º 54
0
    def __init__(self, client):
        Engine.__init__(self, client)

        world = client.world

        if amount_in(world, world.backpack(), lambda x: x.item_id in (ITEMS_LOGS + ITEMS_BOARDS)) >= 20:
            self._success()
            return

        d = OpenBank(client).deferred
        d.addCallbacks(self._box_opened, self._failure)
Ejemplo n.º 55
0
    def __init__(self, client, map, exhaust_db):
        Engine.__init__(self, client)
        self.player = client.world.player
        self.map = map
        self.exhaust_db = exhaust_db

        if self.player.mass_remaining() < 50:
            self._success()
            return

        self._walk()
Ejemplo n.º 56
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self._player = client.world.player
        self._waiting = False

        if self._player.is_hidden():
            self._client.send(p.UseSkill(SKILL_STEALTH))
        else:
            self._client.send(p.UseSkill(SKILL_HIDING))
        self.call_id = reactor.callLater(0.5, self._next)
Ejemplo n.º 57
0
    def __init__(self, client):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.skills = None
        self.stats = None

        # get current stat & skill values
        client.send(p.MobileQuery(0x04, self.player.serial))
        client.send(p.MobileQuery(0x05, self.player.serial))

        self.update()
Ejemplo n.º 58
0
    def __init__(self, client, goal):
        Engine.__init__(self, client)

        self.player = client.world.player
        self.goal = goal
        self.tries = 10

        if self.player.stat_locks is None:
            # query stats
            client.send(p.MobileQuery(0x04, self.player.serial))

        self._check_stats()
Ejemplo n.º 59
0
    def __init__(self, client, ids):
        Engine.__init__(self, client)

        self._source = client.world.backpack()
        if self._source is None:
            self._failure(NoSuchEntity('No backpack'))
            return

        self.ids = ids

        d = OpenContainer(client, self._source).deferred
        d.addCallbacks(self._source_opened, self._failure)