コード例 #1
0
    def __init__(self, caption):

        self.caption = caption
        self.au3 = au3bind.autoit()

        self.au3.AU3_AutoItSetOption("SendKeyDelay", 50)
        self.au3.AU3_AutoItSetOption("SendKeyDownDelay", 50)
        self.au3.AU3_AutoItSetOption("SendCapslockMode", 0)
        self.au3.AU3_AutoItSetOption("WinTitleMatchMode", 2)
        self.au3.AU3_AutoItSetOption("MouseClickDownDelay", 25)
        self.au3.AU3_AutoItSetOption("MouseCoordMode", 2)
        self.au3.AU3_AutoItSetOption("PixelCoordMode", 2)

        self.size = 16
        self.x0 = 12
        self.y0 = 55

        self.blocks = {
            0xce783f7d: "closed",
            0xa463f89d: "flagged",
            0x4bf47e84: "bomb",
            0x96a1c9e5: "bomb",
            0x97e328df: 0,
            0xd5fcf6a8: 1,
            0x5a6db710: 2,
            0xa000db12: 3,
            0x55ebc6d0: 4,
            0xa9aeae50: 5,
            0x7291ced0: 6,
            0xa4c5c5d0: 7,
        }
コード例 #2
0
ファイル: pluginrecipe.py プロジェクト: pohmelie/netpack
    def run(self):
        self.au3 = autoit()
        sleep(0.25)
        self.au3.AU3_ControlSend(self.caption, "", "", "{ESCAPE}")
        sleep(0.1)
        self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 400, 260)
        sleep(3)
        if self.create:
            self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 590, 460)
        else:
            self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 700, 460)

        sleep(1)
        self.au3.AU3_ControlSend(self.caption, "", "", self.gamename + "{TAB}" + self.gamepass + "{ENTER}")
コード例 #3
0
    def __init__(self, char_name):
        self.sorc = self.mule1 = self.mule2 = None
        self.act = self.prepare
        self.char_name = char_name
        self.first = True

        self.subact = None
        self.prefix = None
        self.runnum = None

        self.info = InfoGrabber()
        self.au3 = autoit()

        self.subacts = (

        )
コード例 #4
0
ファイル: pluginrecipe.py プロジェクト: pohmelie/netpack
    def run(self):
        self.au3 = autoit()
        sleep(0.25)
        self.au3.AU3_ControlSend(self.caption, "", "", "{ESCAPE}")
        sleep(0.1)
        self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 400, 260)
        sleep(3)
        if self.create:
            self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 590,
                                      460)
        else:
            self.au3.AU3_ControlClick(self.caption, "", "", "left", 1, 700,
                                      460)

        sleep(1)
        self.au3.AU3_ControlSend(
            self.caption, "", "",
            self.gamename + "{TAB}" + self.gamepass + "{ENTER}")
コード例 #5
0
ファイル: plugin.py プロジェクト: pohmelie/netpack
    def __init__(self):

        self.f = open("log.txt", "w")

        self.welcome = info("Welcome to netpack. Type \\? or \\help for more information.", "green")
        self.plugins = ()
        self.hlp = ()
        self.plugs = ()
        self.char_name = None
        self.au3 = autoit()

        for fname in os.listdir("."):
            if os.path.isfile(fname):
                mname, ext = os.path.splitext(fname)
                if mname.startswith("plugin_") and ext == ".py":
                    file, pathname, desc = imp.find_module(mname)
                    m = imp.load_module(mname, file, pathname, desc)
                    if "netpack_plugin" in dir(m):
                        self.plugins = self.plugins + (m.Logic,)
                        self.hlp = self.hlp + (m.Logic.name + " - " + m.Logic.desc,)
コード例 #6
0
ファイル: plugin.py プロジェクト: pohmelie/netpack
    def __init__(self):

        self.f = open("log.txt", "w")

        self.welcome = info("Welcome to netpack. Type \\? or \\help for more information.", "green")
        self.plugins = ()
        self.hlp = ()
        self.plugs = ()
        self.char_name = None
        self.au3 = autoit()

        for fname in os.listdir("."):
            if os.path.isfile(fname):
                mname, ext = os.path.splitext(fname)
                if mname.startswith("plugin_") and ext == ".py":
                    file, pathname, desc = imp.find_module(mname)
                    m = imp.load_module(mname, file, pathname, desc)
                    if "netpack_plugin" in dir(m):
                        self.plugins = self.plugins + (m.Logic,)
                        self.hlp = self.hlp + (m.Logic.name + " - " + m.Logic.desc,)
コード例 #7
0
def muber(dst_ips, dst_ports, accounts, starter, timeout=10, soj_limit=10):

    soj_ip_stats = {}
    soj_info = multiprocessing.Queue()
    soj_info_history = set()
    sojw = sojwatcher.SojWatcher(dst_ips, dst_ports, soj_info)
    sojw.start()

    games_per_ip = math.ceil(len(accounts) / len(dst_ips))
    au3 = au3bind.autoit()

    au3.AU3_AutoItSetOption("SendKeyDelay", 50)
    au3.AU3_AutoItSetOption("SendKeyDownDelay", 50)
    au3.AU3_AutoItSetOption("SendCapslockMode", 0)
    au3.AU3_AutoItSetOption("WinTitleMatchMode", 2)
    au3.AU3_AutoItSetOption("MouseClickDownDelay", 25)
    au3.AU3_AutoItSetOption("MouseCoordMode", 2)
    au3.AU3_AutoItSetOption("PixelCoordMode", 2)

    wins = []
    for account, password in accounts:

        wins.append(D2Window(account, password, starter, au3))

    while True:

        while not soj_info.empty():

            soj, ip = soj_info.get()

            if (soj, ip) in soj_info_history:

                continue

            soj_info_history.add((soj, ip))

            if soj > 0:

                if ip not in soj_ip_stats:

                    soj_ip_stats[ip] = soj - 1

                log(
                    str.format(
                        "{} ({}) stones of jordan on {}",
                        soj,
                        soj - soj_ip_stats[ip],
                        ip
                    )
                )

                if soj - soj_ip_stats[ip] > soj_limit:

                    log(
                        str.format(
                            "more than {} stones of jordan sold on same ip, trying to connect to {}",
                            soj_limit,
                            ip
                        )
                    )
                    dst_ips = (ip,)
                    games_per_ip = len(accounts)

            elif soj == -1:

                log(str.format("diablo walks the earth on {}, stopped", ip))
                sojw.terminate()

                ns = netstat((ip,), dst_ports)
                log(
                    str.format(
                        "uber windows: {}",
                        str.join(", ", map(lambda w: w.title, filter(lambda w: w.pid in ns, wins)))
                    )
                )

                input()
                exit()

        ns = netstat(dst_ips, dst_ports)
        badwins = []

        for win in wins:

            if win.pid not in ns:

                if win.start_time:

                    log(
                        str.format(
                            "{} dropped after {}",
                            win.title,
                            seconds_to_human(time.time() - win.start_time)
                        )
                    )

                if win.join():

                    ns = netstat(dst_ips, dst_ports)

                    if win.pid in ns and tuple(ns.values()).count(ns[win.pid]) <= games_per_ip:

                        log(str.format("{} -> {}", win.title, ns[win.pid]))

                    else:

                        win.leave()

                else:

                    badwins.append(win)
                    log(str.format("{} (*{}) wrong acc or pass". win.title, win.account))

        wins = list(filter(lambda w: w not in badwins, wins))
        time.sleep(timeout)