예제 #1
0
 def initialize(self):
     """
     Initialization function
     """
     self.questlist=TreeViewFactory('list',
                                ['bool','str','int','int','progress'],
                                ['Finished','Quest','Done','Pending','Progress'],
                                treeview=self.widgets.tvQuestItems)
     self.regexp=re.compile(r'(?P<name>.*)\s\((?P<done>\d+)\/(?P<pending>\d+)\)$')
예제 #2
0
 def initialize(self):
     """
     Initialization function
     """
     self.damagedeal=TreeViewFactory('list',
                                ['str','int','int','int','int'],
                                ['Attack Skill','Hits','Average','Max','Total'],
                                treeview=self.widgets.tvDamageDeal)
     self.dealregexp=re.compile(r'You wound the (?P<mob>.*) (with (?P<attack>.*))* for (?P<damage>\d*) points of (?P<type>.*)\.$')
예제 #3
0
 def initialize(self):
     """
     Initialization function
     """
     self.lootbag=TreeViewFactory('list',
                                ['int','str'],
                                ['Items','Item Name',],
                                treeview=self.widgets.tvLootBag)
     self.itemregexp=re.compile(r'You have acquired .*\[(?P<items>\d*\s)*(?P<name>.*)\]\.$')
     self.itemremregexp=re.compile(r'Item Removed: \[(?P<items>\d*\s)*(?P<name>.*)\].$')
예제 #4
0
 def initialize(self):
     """
     Initialization function
     """
     self.friendlist = TreeViewFactory(
         "list", ["str", "bool"], ["Name", "Status"], treeview=self.widgets.tvFriendList
     )
     self.regexpstatus = re.compile(r"Your friend, (?P<player>.*), has (come|gone) (?P<status>.*)\.$")
     self.regexpmanage = re.compile(
         r"(?P<player>.*) has been (?P<action>(added to|removed from)) your friends list\.$"
     )
예제 #5
0
class Plugin(GUIClass):
    """
    LOTROAssist loot bag plugin class
    """
    metadata={
        'PLUGIN_NAME': 'Loot Bag',
        'PLUGIN_CODENAME': 'lootbag',
        'PLUGIN_VERSION': '0.1',
        'PLUGIN_DESC': 'Lord Of The Rings Online Assistant plugin for loot counting',
        'PLUGIN_COPYRIGHT': '(C) 2010 Oliver Gutiérrez <*****@*****.**>',
        'PLUGIN_WEBSITE': 'http://www.evosistemas.com',
        'PLUGIN_DOCK': 'lists',
    }
    
    def initialize(self):
        """
        Initialization function
        """
        self.lootbag=TreeViewFactory('list',
                                   ['int','str'],
                                   ['Items','Item Name',],
                                   treeview=self.widgets.tvLootBag)
        self.itemregexp=re.compile(r'You have acquired .*\[(?P<items>\d*\s)*(?P<name>.*)\]\.$')
        self.itemremregexp=re.compile(r'Item Removed: \[(?P<items>\d*\s)*(?P<name>.*)\].$')
        # TODO: lotroassist: purchased and sold items
        
    
    def copyItems(self,widget):
        """
        Copy loot bag items to clipboard
        """
        clipboard=gtk.Clipboard()
        # Get stored data
        data=self.lootbag.getData()
        # Copy data to clipboard
        textdata=''
        for row in data:
            textdata+='%s x %s\n' % tuple(row)
        if textdata:
            clipboard.set_text('Loot Bag\n' + textdata)
    
    def removeItem(self,widget):
        """
        Remove selected item
        """
        self.lootbag.remove()
    
    def clearItems(self,widget):
        """
        Clears item list
        """
        self.lootbag.clear()
    
    def newLine(self,line):
        """
        New line analysing function
        """
        return (self.gotItem(line) or self.lostItem(line))
    
    def gotItem(self,line):
        """
        Check if line is a item line and process it
        """
        # Analyze log line
        resp=self.itemregexp.search(line)
        if resp:
            # Get line information
            items=resp.group('items')
            itemname=resp.group('name')
            if not items:
                items=1
            else:
                items=int(items)
            # Check if we have adquired the item before
            item=self.lootbag.getRow(itemname,1)
            if item:
                self.lootbag.update(itemname,[item[0]+items],1)
            else:
                # Add the new quest to tree view
                self.lootbag.append([items,itemname])
            return True
    
    def lostItem(self,line):
        """
        Check if line is a item removing line and process it
        """
        # Analyze log line
        resp=self.itemremregexp.search(line)
        if resp:
            # Get line information
            items=resp.group('items')
            itemname=resp.group('name')
            if not items:
                items=1
            else:
                items=int(items)
            # Check if we have adquired the item before
            item=self.lootbag.getRow(itemname,1)
            if item and item[0]>0:
                self.lootbag.update(itemname,[item[0]-items],1)
            return True
예제 #6
0
class Plugin(GUIClass):
    """
    LOTROAssist quest items plugin class
    """

    metadata={
        'PLUGIN_NAME': 'Quest Items',
        'PLUGIN_CODENAME': 'questitems',
        'PLUGIN_VERSION': '0.1',
        'PLUGIN_DESC': 'Lord Of The Rings Online Assistant plugin for quest item count',
        'PLUGIN_COPYRIGHT': '(C) 2010 Oliver Gutiérrez <*****@*****.**>',
        'PLUGIN_WEBSITE': 'http://www.evosistemas.com',
        'PLUGIN_DOCK': 'main',
    }
    
    def initialize(self):
        """
        Initialization function
        """
        self.questlist=TreeViewFactory('list',
                                   ['bool','str','int','int','progress'],
                                   ['Finished','Quest','Done','Pending','Progress'],
                                   treeview=self.widgets.tvQuestItems)
        self.regexp=re.compile(r'(?P<name>.*)\s\((?P<done>\d+)\/(?P<pending>\d+)\)$')
    
    def copyQuestItems(self,widget):
        """
        Copy quest items to clipboard
        """
        clipboard=gtk.Clipboard()
        # Get stored data
        data=self.questlist.getData()
        # Copy data to clipboard
        textdata=''
        for row in data:
            textdata+='%s (%s/%s)\n' % tuple(row[1:-1])
        if textdata:
            clipboard.set_text('Quest Items\n' + textdata)
    
    def removeQuestItem(self,widget):
        """
        Remove selected quest item
        """
        self.questlist.remove()
    
    def clearQuestItems(self,widget):
        """
        Clears quest item list
        """
        self.questlist.clear()
    
    def newLine(self,line):
        """
        New line analysing function
        """
        # Analyze log line
        resp=self.regexp.search(line)
        if resp:
            # Get line information
            questname=resp.group('name')
            questdone=int(resp.group('done'))
            questpending=int(resp.group('pending'))
            questfinished=(questdone==questpending)
            questprogress=questdone*100/questpending
            # If autoremove is active, remove quest
            if questfinished and self.widgets.tlbcAutoRemoveQuestItem.get_active():
                self.questlist.remove(questname,1)
            else:
                # Modify quest if already added
                if not self.questlist.update(questname,[questfinished,questname,questdone,questpending,questprogress],1):
                    # Add the new quest to tree view
                    self.questlist.append([questfinished,questname,questdone,questpending,questprogress])
            return True
예제 #7
0
class Plugin(GUIClass):
    """
    LOTROAssist friend list plugin class
    """

    metadata = {
        "PLUGIN_NAME": "Friends",
        "PLUGIN_CODENAME": "friendlist",
        "PLUGIN_VERSION": "0.1",
        "PLUGIN_DESC": "Lord Of The Rings Online Assistant plugin for friend list tracking",
        "PLUGIN_COPYRIGHT": "(C) 2010 Oliver Gutiérrez <*****@*****.**>",
        "PLUGIN_WEBSITE": "http://www.evosistemas.com",
        "PLUGIN_DOCK": "lists",
    }

    def initialize(self):
        """
        Initialization function
        """
        self.friendlist = TreeViewFactory(
            "list", ["str", "bool"], ["Name", "Status"], treeview=self.widgets.tvFriendList
        )
        self.regexpstatus = re.compile(r"Your friend, (?P<player>.*), has (come|gone) (?P<status>.*)\.$")
        self.regexpmanage = re.compile(
            r"(?P<player>.*) has been (?P<action>(added to|removed from)) your friends list\.$"
        )

    def newLine(self, line):
        """
        New line analysing function
        """
        return self.friendStatus(line) or self.friendManage(line)

    def friendManage(self, line):
        """
        Friend management check
        """
        # Analyze log line
        resp = self.regexpmanage.search(line)
        if resp:
            player = resp.group("player")
            action = resp.group("action")
            # Send management notification
            self.maingui.showNotification(
                "%s have been %s Friends" % (player, action), icon="plugins/friendlist/pixmaps/friendmanage.png"
            )
            return True

    def friendStatus(self, line):
        """
        Friend status check
        """
        # Analyze log line
        resp = self.regexpstatus.search(line)
        if resp:
            status = resp.group("status")
            player = resp.group("player")
            # Modify player if already added
            if not self.friendlist.update(player, [player, status == "online"], 0):
                # Add the new player to tree view
                self.friendlist.append([player, status == "online"])
            # Send friend notification
            self.maingui.showNotification(
                "%s is %s" % (player, status), icon="plugins/friendlist/pixmaps/%s.png" % status
            )
            return True
예제 #8
0
class Plugin(GUIClass):
    """
    LOTROAssist Combat stats plugin class
    """
    metadata={
        'PLUGIN_NAME': 'Combat stats',
        'PLUGIN_CODENAME': 'combatstats',
        'PLUGIN_VERSION': '0.1',
        'PLUGIN_DESC': 'Lord Of The Rings Online Assistant plugin for combat stats',
        'PLUGIN_COPYRIGHT': '(C) 2010 Oliver Gutiérrez <*****@*****.**>',
        'PLUGIN_WEBSITE': 'http://www.evosistemas.com',
        'PLUGIN_DOCK': 'main',
    }
        
    def initialize(self):
        """
        Initialization function
        """
        self.damagedeal=TreeViewFactory('list',
                                   ['str','int','int','int','int'],
                                   ['Attack Skill','Hits','Average','Max','Total'],
                                   treeview=self.widgets.tvDamageDeal)
        self.dealregexp=re.compile(r'You wound the (?P<mob>.*) (with (?P<attack>.*))* for (?P<damage>\d*) points of (?P<type>.*)\.$')
        # You wound the Snarling Overseer with Retaliation for 370 points of Common damage.
        # You wound the Snarling Overseer for 305 points of Common damage.

    def clearStats(self,widget):
        """
        Clear combat stats
        """
        pass

    def newLine(self,line):
        """
        New line analysing function
        """
        # Analyze log line
        return self.damageDeal(line)
    
    def damageDeal(self,line):
        """
        Check if line is a damage dealing line
        """
        # Analyze log line
        resp=self.dealregexp.search(line)
        if resp:
            # Get line information
            # 'Attack','Used','Max damage','Total damage'
            mob=resp.group('mob')
            attack=resp.group('attack')
            damage=int(resp.group('damage'))
            type=resp.group('type')
            if not attack:
                attack='Unknown Attack'
            # Check if we have set this attack
            row=self.damagedeal.getRow(attack,0)
            if row:
                self.damagedeal.update(attack,[attack,row[1]+1,(row[2]+damage)/2,row[3]>damage and row[3] or damage,row[4]+damage],0)
            else:
                # Add the new quest to tree view
                self.damagedeal.append([attack,1,damage,damage,damage])
            return True