Пример #1
0
 def set_steam_path(self):
     path = self.main_window.steam_path.text()
     if not path == "":
         with core.get_config() as config:
             config.steam_path = path
     
     self.toggle_widget(self.main_window.set_steam_path_window)
Пример #2
0
    def save_settings(self):
        with core.get_config() as config:
            config.steam_path = self.main_window.settings_steam_path.text()
            config.greenluma_path = self.main_window.settings_greenluma_path.text(
            )
            config.check_update = self.main_window.update_checkbox.isChecked()

        self.toggle_widget(self.main_window.settings_window)
Пример #3
0
    def run_GreenLuma(self):
        self.toggle_widget(self.main_window.generic_popup, True)

        if not self.generate_app_list(False):
            return

        args = ["DLLInjector.exe"]
        self.replaceConfig("FileToCreate_1", " NoQuestion.bin", True)

        with core.get_config() as config:
            config.no_hook = self.main_window.no_hook_checkbox.isChecked()
            config.compatibility_mode = self.main_window.compatibility_mode_checkbox.isChecked(
            )

        # if : else used instead of ternary operator for better readability
        if core.config.compatibility_mode or core.config.no_hook:
            self.replaceConfig("EnableMitigationsOnChildProcess", " 0")
        else:
            self.replaceConfig("EnableMitigationsOnChildProcess", " 1")

        if core.config.no_hook:
            self.replaceConfig("CommandLine", "")
            self.replaceConfig("WaitForProcessTermination", " 0")
            self.replaceConfig("EnableFakeParentProcess", " 1")
            self.replaceConfig("CreateFiles", " 2")
            self.replaceConfig("FileToCreate_2", " StealthMode.bin", True)
        else:
            self.replaceConfig("CommandLine", " -inhibitbootstrap")
            self.replaceConfig("WaitForProcessTermination", " 1")
            self.replaceConfig("EnableFakeParentProcess", " 0")
            self.replaceConfig("CreateFiles", " 1")
            self.replaceConfig("FileToCreate_2", "")

        if core.config.steam_path != core.config.greenluma_path:
            self.replaceConfig("UseFullPathsFromIni", " 1")
            self.replaceConfig(
                "Exe", " " + os.path.join(core.config.steam_path, "Steam.exe"))
            self.replaceConfig(
                "Dll", " " + os.path.join(core.config.greenluma_path,
                                          "GreenLuma_2020_x86.dll"))
        else:
            self.replaceConfig("UseFullPathsFromIni", " 0")
            self.replaceConfig("Exe", " Steam.exe")
            self.replaceConfig("Dll", " GreenLuma_2020_x86.dll")

        if self.is_steam_running():
            self.toggle_widget(self.main_window.closing_steam)
            os.chdir(core.config.steam_path)
            subprocess.run(["Steam.exe", "-shutdown"])  #Shutdown Steam
            while self.is_steam_running():
                core.time.sleep(1)
            core.time.sleep(1)

        os.chdir(core.config.greenluma_path)
        subprocess.Popen(args)
        self.close()
Пример #4
0
 def search_games_done(self, result):
     self.toggle_hidden(self.main_window.searching_frame)
     if type(result) is list:
         self.populate_table(self.main_window.search_result, result)
     else:
         if isinstance(result, CloudflareException) or isinstance(
                 result, CaptchaException):
             self.show_popup(
                 "Cloudflare bypass failed, disabling SteamDB.", lambda:
                 self.toggle_widget(self.main_window.generic_popup, True))
             with core.get_config() as config:
                 config.use_steamdb = False
         else:
             self.show_popup(
                 "Can't connect to " +
                 ("SteamDB" if core.config.use_steamdb else "Steam") +
                 ". Check if you have internet connection.", lambda: self.
                 toggle_widget(self.main_window.generic_popup, True))
Пример #5
0
 def set_greenluma_path(self):
     path = self.main_window.greenluma_path.text()
     if not path == "":
         if os.path.isdir(path):
             if os.path.isfile(os.path.join(path, "DLLInjector.exe")):
                 path = os.path.abspath(path)
                 with core.get_config() as config:
                     config.greenluma_path = path
                 self.toggle_widget(
                     self.main_window.set_greenluma_path_window)
             else:
                 self.main_window.label_greenluma_error.setText(
                     "DLLInjector.exe not in path")
         else:
             self.main_window.label_greenluma_error.setText(
                 "Not a valid path")
     else:
         self.main_window.label_greenluma_error.setText(
             "Please enter a path")
Пример #6
0
def main():
    if not re.match(r'^[A-Za-z0-9_]+$', args.subname):
        sys.exit("Invalid subreddit name, aborting.")
    s = reddit.reddit.subreddit(args.subname)
    config = core.get_config()
    debug_mode = config['DEFAULT'].getboolean('DebugMode')
    common.debug_msg('Mod Permission: ' + str(s.user_is_moderator))
    if not s.user_is_moderator:
        logmsg.critical("[ERROR] Bot check as mod failed, aborting.")
        sys.exit("Shutting down due to bot permission issue.")
    checklog.check_for_admins(s)
    checklog.health_check(s)
    common.cleanup_modmail(s)
    if not common.bool_sidebar_queued(s):
        sys.exit(
            "Shutting down due to no need to run bot... no new sidebar content found."
        )
    new_sidebar = common.sync_sidebar_widget(s)
    sidebar_state = common.check_sidebar_freespace(s.display_name, new_sidebar)
    if not debug_mode:
        try:
            s.mod.update(description=new_sidebar)
        except Exception as e:
            logmsg.critical("[ERROR] Updating sidebar - %s", e)
    common.debug_msg("Bot run has completed.. API usage: " +
                     str(reddit.reddit.auth.limits))
    if not debug_mode:
        configf = configparser.ConfigParser()
        configf.read('config.ini')
        configname = 'SysLastRun' + s.display_name
        currentrun = datetime.utcnow().strftime(
            configf['DEFAULT']['lastrunformat'])
        configf['DEFAULT'][configname] = currentrun
        usern = "u_" + reddit.reddit.user.me().name
        statusmsg = "Bot last online " + currentrun + " UTC. "
        if checklog.check_log_errors(s):
            statusmsg = statusmsg + "❌Errors seen today."
        else:
            statusmsg = statusmsg + "✔️No errors today."
        reddit.reddit.subreddit(usern).mod.update(public_description=statusmsg)
        with open('config.ini', 'w') as configfile:
            configf.write(configfile)
Пример #7
0
    def select_profile(self, name):
        with core.get_config() as config:
            config.last_profile = name

        self.show_profile_games(profile_manager.profiles[name])
Пример #8
0
 def __init__(self):
     super(GameScene, self).__init__()
     self.board = Board(core.get_config().board_size)
     self.register_display(self.board)
     self.register_update(self.board)
Пример #9
0
#  setattr(parser.values, option.dest, value.split(','))

parser.add_option('-c', '--config',   dest='config', action='store', type='string', help="config", default=None)
parser.add_option('-i', '--identity-file',   dest='ident_file', action='store', type='string', help="ssh identity file", default=None)
parser.add_option('-u', '--user',   dest='user', action='store', type='string', help="remote ssh user", default='root')
parser.add_option('-H', '--host',   dest='hosts', action='store', type='string', help="hosts")
#parser.add_option('-r', '--recipe',   dest='recipe', action='store', type='string', help="recipe", default=0.5)

(options, args) = parser.parse_args()
env.host_string = options.hosts
if len(args) > 0:
  recipe_name = args[0]
  if len(args) > 1:
    print args[1:]
else:
  parser.print_help()
  sys.exit(-1)


if options.config:
  CONFIG = get_config(options.config)
else:
  CONFIG = {}
if options.ident_file:
  env.user = options.user
  env.key_filename = options.ident_file
else:
  print 'using ssh config'
  env.use_ssh_config = True
recipes.run(recipe_name, CONFIG)
Пример #10
0
import praw
import re
import reddit
import feedparser
import pytz
import core
try:
    import xi
except ImportError:
    pass
try:
    import xiv
except ImportError:
    pass

config = core.get_config()
logmsg = logging.getLogger("Rotating_Log")


### Outputs debug messages ###
def debug_msg(debug_str):
    if config['DEFAULT'].getboolean('DebugMode'):
        print("   <<<- [DEBUG INFO]")
        if debug_str:
            pprint(debug_str)
        else:
            print("[WARNING] debug_msg: No data.")
        print("    ->>>")


### Send us a modmail to alert something ###
Пример #11
0
 def __init__(self):
     self.board = Board(core.get_config().board_size)
     self.screen = pygame.Surface(core.get_config().screen_size)
     self.rect = self.screen.get_rect()