Ejemplo n.º 1
0
    def __init__(self, config_file):
        """Initializes the config file by changing the working directory to the
        root kcauto folder and reading the passed in config file.

        Args:
            config_file (str): name of config file
        """
        Util.log_msg("Initializing config module.")
        os.chdir(getBundlePath())
        os.chdir('..')

        self.config_file = config_file
        self.config_modified_time = None
        self.ok = True
        self.initialized = False
        self.changed = False
        self.program = ''
        self.jst_offset = 0
        self.pause = False
        self.scheduled_sleep = None
        self.scheduled_stop = None
        self.expeditions = None
        self.pvp = None
        self.combat = None
        self.event_reset = None
        self.ship_switcher = None
        self.fleet_switcher = None
        self.quests = None
 def find_module(self, module_name, package_path):
     helpers = os.path.join(os.path.dirname(sikuli.getBundlePath()), "helpers")
     if (helpers) not in sys.path and os.path.exists(helpers):
         sys.path.append(helpers)
     module_helper_path = JH.get().findModule(module_name, package_path, sys.path)
     if not module_helper_path:
       return None
     else:
       return self.HelperLoader(module_helper_path)
Ejemplo n.º 3
0
    def __init__(self, config_file):
        """Initializes the config file by changing the working directory to the
        root kcauto-kai folder and reading the passed in config file.

        Args:
            config_file (str): name of config file
        """
        Util.log_msg("Initializing config module")
        os.chdir(getBundlePath())
        os.chdir('..')
        self.config_file = config_file
        self.read()
Ejemplo n.º 4
0
# Workaround to get jython imports working
# https://bugs.launchpad.net/sikuli/+bug/1504901
# https://github.com/RaiMan/SikuliX-2014/issues/151
import sikuli
import org.sikuli.script.FindFailed as FindFailed
import org.sikuli.util.JythonHelper as JythonHelper
import os
import sys
from time import sleep

JythonHelper.get().addSysPath(sikuli.getBundlePath())
sys.path.append(os.getcwd())

# kcauto imports
from main import KCAuto  # noqa
from kca_globals import Globals  # noqa
from args import Args  # noqa
from config import Config  # noqa
from debug import Debug  # noqa
from recovery import Recovery  # noqa
from util import Util  # noqa

# Sikuli settings
sikuli.Settings.MinSimilarity = Globals.DEFAULT_SIMILARITY
sikuli.Settings.WaitScanRate = Globals.SIKULI_SCANRATE
sikuli.Settings.ObserveScanRate = Globals.SIKULI_SCANRATE
sikuli.Settings.OcrTextRead = True
sikuli.Settings.AutoWaitTimeout = 1
sikuli.Settings.RepeatWaitTime = 0

# check run-time args
Ejemplo n.º 5
0
# import related libraries
import os, inspect, sikuli
# Pulls all sikuli modules for use here
from sikuli import *

# Start subscript by changing bundle (images) directory
print "[S2P00] LOADED: krBot1920:R108"
print "[S2P01] Old Image Path: "+sikuli.getBundlePath()
path_current_file = os.path.dirname( inspect.getfile(inspect.currentframe()) )
sikuli.setBundlePath(path_current_file)
print "[S2P02] New Image Path: "+sikuli.getBundlePath()

# define images
img_game_icon = "img_game_icon.png"
img_play = "img_play.png"
img_town = "img_town.png"
img_refresh = Pattern("img_refresh.png").similar(0.80)
img_toclose = "img_toclose.png"
img_toclose_2 = "img_toclose_2.png"
img_yesconfirm = Pattern("img_yesconfirm.png").similar(0.85)
img_gem = Pattern("img_gem.png").similar(0.85)
img_town_statue_arm = Pattern("img_town_statue_arm.png").similar(0.80)
img_town_window = "img_town_window.png"
img_mana_bar = "img_mana_bar.png"
img_zoomout = Pattern("img_zoomout.png").similar(0.95)
img_goldbonus = Pattern("img_goldbonus.png").similar(0.40)
img_declineinvite = "img_declineinvite.png"
img_accept = "img_accept.png"
img_playalone = "img_playalone.png"
img_auto = Pattern("img_autoplay.png").similar(0.85)
img_free = "img_free.png"