Jump to content

jacko

Citizen
  • Posts

    8
  • Joined

  • Last visited

jacko's Achievements

Watcher

Watcher (1/12)

0

Reputation

  1. Great stuff thanks. I decided to forgo parsing filenames. Here is my working code with test data: def display(self): # todo: import from csv or json mods = [ {'file_name': 'Appropriately Attired Jarls-23793-1-1-1.7z', 'mod_name': 'Appropriately Attired Jarls', 'nexus_id': 23793, 'version': '1.1.1', }, {'file_name': 'Argonian Decapitation Fix-22624-1-0.rar', 'mod_name': 'Argonian Decapitation Fix', 'nexus_id': 22624, 'version': '1.0', }, ] for mod_dict in mods: mod_path = self._mo.downloadsPath() + "/" + mod_dict['file_name'] mod_interface = self._mo.installMod(mod_path) mod_interface.setNexusID(mod_dict['nexus_id']) # mobase.VersionInfo expects version ints & ReleaseType, init params now version_data = [0, 0, 0, mobase.ReleaseType.final] # update zeroed data with actual version data for i,v in enumerate( int(v) for v in mod_dict['version'].split('.') ): version_data[i] = v mod_interface.setVersion(mobase.VersionInfo(*version_data))My question would be how can I handle versions that have letters in them? Snooping around in versioninfo.h I see /** * @brief constructor * @param versionString the string to construct from **/ VersionInfo(const QString &versionString, VersionScheme scheme = SCHEME_DISCOVER);Which seems to indicate (along with other mentions in the code) that not only is there a built-in version parser, but that it can detect version 'schemes' with letters and even dates. I previously tried mod_interface.setVersion(mobase.VersionInfo(version_string))Thinking maybe since the name VersionInfo appeared 2 times it was some kind of overloaded method that would activate if I gave it only a string (half-remembered high-school java class) but no luck. I think this will be the last piece I need to make a simple batch installer. However there are other MO features I'd like to access programmatically if possible instead of having to use a clicker on the GUI. Start my plugin (this is hardest one for clicker and would need OCR to be reliable)Create new profileHide "Quick Install" dialogue for simple mods, "Silent Install"Activate modThanks bye
  2. OK so now I am moving on to installing multiple mods at a time and trying to set each mod's id and version, but I'm getting an error trying to set version string. Here is my display method: def display(self): mods = ["Appropriately Attired Jarls-23793-1-1-1.7z", "Argonian Decapitation Fix-22624-1-0.rar"] for mod_file_name in mods: mod_path = self._mo.downloadsPath() + "/" + mod_file_name mod_interface = self._mo.installMod(mod_path) # change to parse filename? if 'Jarls' in mod_path: mod_interface.setNexusID(23793) mod_interface.setVersion('1.1.1') elif 'Argonian' in mod_path: mod_interface.setNexusID(22624) mod_interface.setVersion('1.0')I get this error: Plugin "Batch Installer" failed: Traceback (most recent call last): File "C:/Steam/SteamApps/common/Skyrim/ModOrganizer/plugins/pyTest.py", line 49, in display mod_interface.setVersion('1.1.1')Boost.Python.ArgumentError: Python argument types in IModInterface.setVersion(IModInterface, str)did not match C++ signature: setVersion(struct IModInterfaceWrapper {lvalue}, class MOBase::VersionInfo) setVersion(class MOBase::IModInterface {lvalue}, class MOBase::VersionInfo)I'm getting the impression it expects something other than a string for version, and I went looking through the code and came upon versioninfo.h which seems to maybe imply that there exists code to parse version strings into version datatypes. Is this available to me? This leads me to another question, if there already exists a parser for filenames to get mod name/id/version from them or will I have to roll my own? thanks bye edit: also, is there a way to "lookup" an ID in the nexus and get back mod name, latest version and other info?
  3. Thanks a lot Tannin, I was thinking the same thing about the installMod function, really nice that you added that return feature.
  4. Now we are making bacon. Thanks for the help things are making sense now, your C code is well commented. I was able to install a mod from its archive quite easily. I stuck the code under display method and it seems to work just fine. Then I wanted to make it so the mod had nexus information so it could be updated directly from MO, so I tried adding setNexusID but then it gives me Plugin "Hello World" failed: Traceback (most recent call last): File "C:/Steam/SteamApps/common/Skyrim/ModOrganizer/plugins/pyTest.py", line 42, in display aaj_mod = self._mo.getMod("Appropriately Attired Jarls")TypeError: No Python class registered for C++ class class MOBase::IModInterfaceHere is my code so far: from PyQt4.QtGui import QIcon, QMessageBoxclass HelloWorld(mobase.IPluginTool): def init(self, organizer): self._mo = organizer return True def name(self): return "Hello World" def author(self): return "Tannin" def description(self): return "Gives a friendly greeting" def version(self): return mobase.VersionInfo(1, 0, 0, mobase.ReleaseType.final) def isActive(self): return True def settings(self): return [] def displayName(self): return "Hello World" def tooltip(self): return "Says "Hello World"" def icon(self): return QIcon(":/pyCfg/pycfgicon") def setParentWidget(self, widget): self.__parentWidget = widget def display(self): mystr = self._mo.downloadsPath() mod_path = self._mo.downloadsPath() + "/Appropriately Attired Jarls-23793-1-1-1.7z" self._mo.installMod(mod_path) aaj_mod = self._mo.getMod("Appropriately Attired Jarls") aaj_mod.setNexusID(23793) #QMessageBox.information(self.__parentWidget, "Hello", mod_path)def createPlugin(): return HelloWorld()
  5. Hey thanks for the replies. I'm looking at the source of that plugin now. I don't have any C or QT knowledge, but I'm trying to understand what's going on more or less. I was expecting an inherited class with methods to override for plugin functionality, but searching for the parent object mobase.IPluginInstallerCustom was tricky since there was no import statement I could follow back, but I think I finally found it in some C code that appears to match the method names (but I have no idea what it does). Also I tried searching all files for a reference of "tool" and found a C file that mentioned IPluginToolWrapper which was also the same file that had IPluginInstallerCustomWrapper which was very similar to the mobase.IPluginInstallerCustom that the plugin inherits from, but when I replace mobase.IPluginInstallerCustom with IPluginTool I predictably get a not found error on MO startup. In summary, I have no idea what's going on. Not because of anything you did but just because I'm a hobbyist programmer so my knowledge is really limited. It's also kinda difficult because the plugin doesn't appear to work so I can't edit and check what changed and hack my way through things. I'd simply like to make a plugin that accepts a text file listing mod locations on the computer and it would go through and install them. I'll keep trying tomorrow to make something work. bye edit: I suppose to keep it simple, how do I make a plugin a "tool"? Then we can go from there.
  6. Hey that's really great news, I stuck that file in there and it appeared in the plugins list. How would I "run" a plugin?
  7. Hi thanks, I read here https://wiki.step-project.com/Guide:Mod_Organizer#tab=Plugins_3 that python is required for users in order to use the plugin is that true? If so I don't think it will be feasible for my project, is there any other way to automate MO (even simple things like keyboard shortcuts will help me)?
  8. Hello, I'm trying to automate mod installation for MO using Autoit. It's going fine so far, but I'd rather have a better experience than needing to take control of the mouse and click all the buttons. But MO doesn't have any keyboard shortcuts that I can see, doesn't seem to have any standard windows "controls" that can be hooked into with Autoit (or probably COM either), and it can't be clicked on at all without using the mouse (attempting to send click events fail). If I am wrong on any of these counts please let me know, I am new to this stuff and just messing around. Is there is some kind of command line access to install and manage mods? Do keyboard shortcuts exist? Is there some other way to automate mod tasks in MO?I noticed there was a way to create python plugins for MO, where can I find out more information? I only saw one example but I didn't see anything that referenced mod installation, would a plugin work? I have some python experience but I would need some guidance on getting set up. Thanks bye
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.