Exemplo n.º 1
0
        "^da$",
        "throw daggers aconite!",
        lambda m: _throw_dagger(s.target, "aconite")
    ),
    (
        "^ds$",
        "throw daggers slike!",
        lambda m: _throw_dagger(s.target, "slike")
    ),
    (
        "^dv$",
        "throw daggers vernalius!",
        lambda m: _throw_dagger(s.target, "vernalius")
    ),
]
c.add_aliases("dagger", dagger_aliases)


juggled_items = []


def begin_juggling(matches):
    global juggled_items
    juggled_items = list(matches)
    c.echo(f"juggling: {juggled_items}")


def threw_something(matches):
    # You c**k back your arm and throw an obsidian dagger at Parthenope.
    # You c**k back your arm and throw an obsidian dagger southwest at Ellryn.
Exemplo n.º 2
0
wielding_triggers = [
    (
        r"^(\w+\d+): (.*) in your left hand.$",
        # getting what's being wielded
        lambda m: wielding("left", m[0], m[1]),
    ),
    (
        r"^(\w+\d+): (.*) in your right hand.$",
        # getting what's being wielded
        lambda m: wielding("right", m[0], m[1]),
    ),
    (
        r"^(Left|Right) hand:\s+(\w+\d+)\s+(\w.*)$",
        # getting what's being wielded
        lambda m: wielding(m[0].lower(), m[1], m[2]),
    ),
    # You cease wielding a puppet roughly resembling Lynair in your left hand.
    # You begin to wield a small blackjack in your left hand.
]
c.add_triggers(wielding_triggers)

inventory_aliases = [
    # (   "^i$",
    #    "get inventory from achaea",
    #    lambda m: c.gmcp_send("Char.Items.Inv \"\"")
    # ),
    ("^wl (.*)$", "wield left item", lambda m: wield("left", m[0])),
    ("^wr (.*)$", "wield right item", lambda m: wield("right", m[0])),
]
c.add_aliases("inventory", inventory_aliases)
Exemplo n.º 3
0
    if matches == "on":
        echo("Turning on balance timer!")
        s.show_balance_times = True
    elif matches == "off":
        echo("Turning on balance timer!")
        s.show_balance_times = False


balance_aliases = [
    (
        "^btimer (.*)$",
        "btimer on/off - balance timer",
        lambda matches: set_display_balance_timer(matches[0]),
    ),
]
c.add_aliases("balance", balance_aliases)


def create_end_timer(timer_type, end_msg):
    start_time = time.time()

    def tmp_trig(matches):
        total = time.time() - start_time
        echo(f"{timer_type}: {total:0.2}s")
        c.remove_temp_trigger(timer_type)

    timer_trig = (end_msg, tmp_trig)
    c.add_temp_trigger(timer_type, timer_trig)


def recovered_eq(matches):
Exemplo n.º 4
0
    ),
    (
        "^flux(?: (.+))?$",
        "golem timeflux []/t (disc) - slow salve",
        lambda matches: send(f"stand;golem timeflux {matches[0] or s.target}"),
    ),
    (
        "^impur(?: (.+))?$",
        "golem impurity []/t (egg) - give aff (TODO) paralysis",
        lambda matches: send(
            f"stand;golem impurity {matches[0] or s.target} paralysis"),
    ),
    (
        "^bar$",
        "golem barrier (spiral) - shield",
        lambda matches: send(f"stand;golem barrier"),
    ),
    (
        "^shd$",
        "golem barrier (spiral) - shield",
        lambda matches: send(f"stand;golem barrier"),
    ),
    (
        "^disfig(?: (.+))?$",
        "golem disfigure []/t (torus) - disfigure",
        lambda matches: send(f"stand;golem disfigure {matches[0] or s.target}"
                             ),
    ),
]
c.add_aliases("ab_artificing", artificing_aliases)
Exemplo n.º 5
0
        "fling lust at []/t",
        lambda matches: eqbal(f"fling lust at {matches[0] or s.target}"),
    ),
    (
        "^univ(?: (.+))?$",
        "fling universe at ground",
        lambda matches: eqbal("fling universe at ground"),
    ),
    (
        "^moon(?: (.+))?$",
        "fling moon at []/t",
        lambda matches: eqbal(f"fling moon at {matches[0] or s.target}"),
    ),
    (
        "^devil$",
        "fling devil at ground",
        lambda matches: eqbal("fling devil at ground"),
    ),
    (
        "^rde(?: (.+))?$",
        "rub death on []/t",
        lambda matches: eqbal(f"rub death on {matches[0] or s.target}"),
    ),
    (
        "^fde(?: (.+))?$",
        "fling death at []/t",
        lambda matches: eqbal(f"fling death at {matches[0] or s.target}"),
    ),
]
c.add_aliases("ab_tarot", tarot_aliases)
Exemplo n.º 6
0
        for key, value in _party_announce.items():
            echo(f"{key}: {value}")
        return

    if len(pieces) != 2:
        echo(f"incorrect config: {line}")

    status = pieces[1]

    if cmd in _party_announce.keys() and status in {"on", "off"}:
        echo(f"setting {cmd} = {status}")
        _party_announce[cmd] = status
    else:
        echo(f"incorrect config: {line}")
        echo("pan config status should be on/off")


def party_announce(msg, pan_type):
    global _party_announce
    if _party_announce[pan_type] == "on":
        send(f"pt {msg}")


party_aliases = [
    ("^pan (.*)$", "party announcment config",
     lambda m: handle_pan_config(m[0])),
]
c.add_aliases("party", party_aliases)

# (Party): Nephiny says, "Target: Axios."
Exemplo n.º 7
0
c.add_gmcp_handler("Char.Name", handle_login_info)


def show_help(alias_group):
    lines = [
        f"{pattern:15.15} : {desc}"
        for pattern, desc in c.help_info.get(alias_group, [])
    ]
    help_lines = "\n".join(lines)
    return echo(f"{alias_group}:\n{help_lines}")


base_aliases = [
    ("#help (.*)", "show help", lambda m: show_help(m[0])),
]
c.add_aliases("base", base_aliases)


def eqbal(msg, prepend=False):

    # TODO: is this even necessary any more?
    s.eqbal_queue.append(msg)

    for msg in s.eqbal_queue:
        if prepend:
            send(f"queue prepend eqbal {msg}")
        else:
            send(f"queue add eqbal {msg}")
    s.eqbal_queue.clear()

Exemplo n.º 8
0
from client import c

from .state import s

sigil_aliases = [
    (
        "^eyesig$",
        "wield eyesigil;throw eyesigil at ground",
        lambda matches: c.send("wield eyesigil;throw eyesigil at ground"),
    ),
]
c.add_aliases("sigil", sigil_aliases)
Exemplo n.º 9
0
        "^adef (.+) (.+)$",
        "auto defences",
        lambda matches: auto_defences([matches[0]], matches[1]),
    ),
    (
        r"^relax (\w+)$",
        "relax defence 5",
        lambda matches: relax(matches[0], "5"),
    ),
    (
        r"^relax (\w+) (\d+)$",
        "relax defence #sec",
        lambda matches: relax(matches[0], matches[1]),
    ),
]
c.add_aliases("defences", defence_aliases)


def do_nothing():
    pass


bliss_defs = {"constitution", "toughness", "resistance"}

# these will be defs we keep on all the time
basic_defs = {
    # "boartattoo",
    "mosstattoo",
    "deathsight",
    "insomnia",
    # "lifevision",
Exemplo n.º 10
0
        limb_num = 7
        golem_attack_num = int(matches[1])
    else:
        strike_type_num = int(matches[0])
        limb_num = int(matches[1])
        golem_attack_num = int(matches[2])

    if strike_type_num not in strike_map:
        echo("Not a valid strike num!")
        return
    if limb_num not in limb_map:
        echo("Not a valid limb num!")
        return
    if golem_attack_num not in golem_map:
        echo("Not a valid golem num!")
        return

    strike_attack = strike_map[strike_type_num]
    limb = limb_map[limb_num]
    golem_attack = golem_map[golem_attack_num]

    attack = f"stand;{strike_attack}{limb};{golem_attack}".format(target=s.target)
    echo(attack)
    send(attack)


fancy_attack_aliases = [
    (r"^(\d)(\d)(\d)?$", "(staffstrike)(limb)(golem)", parse_number_attack),
]
c.add_aliases("fancy_attacks", fancy_attack_aliases)
Exemplo n.º 11
0
        "^nog(?: (.+))?$",
        "noogie t/[]",
        lambda matches: send("noogie {matches[0] or '&tar'}"),
    ),
    (
        "^ja(?: (.+))?$",
        "throw jacks at t/[]",
        lambda matches: send("throw jacks at {matches[0] or '&tar'}"),
    ),
    (
        "^ens(?: (.+))?$",
        "ensconce firecracker on t/[]",
        lambda matches: send("ensconce firecracker on {matches[0] or '&tar'}"),
    ),
]
c.add_aliases("ab_battlerage", jester_battlerage_aliases)


def shatter_target():
    # not checking for shielder == target because it might be a long mob name
    c.echo(f"rage: {s.rage}")
    if s.rage >= 17:
        c.send("throw jacks at &tar"),


battlerage_triggers = [
    (
        r"^A nearly invisible magical shield forms around (.*?).$",
        # someone just shielded!
        lambda matches: shatter_target(),
    ),
Exemplo n.º 12
0
        name, path_recorder = path_recording
        path = path_recorder.path
        paths[name] = path

        echo(f"stopping path recording ({id(path_recorder)}): {name}")
        path_recording = None
        path_recorder.stop()

        echo(f"paths[\"{name}\"] = {path}")

    elif paths.get(name):
        echo(f"path {name} already exists")
        echo(f"PATH CLEAR {name.toupper()} to clear the path")

    elif path_recording:
        name, path_recorder = path_recording
        echo(f"already recording: {name}")
        echo(f"PATH RECORD STOP to stop recording and start a new one")

    else:
        echo(f"Beginning path record: {name}")
        path_recording = (name, PathRecorder())


path_aliases = [
    ("path list", "path list", lambda m: path_list()),
    ("path record (.*)", "path record name", lambda m: path_record(m[0])),
    ("path record stop", "path record stop", lambda m: path_record("stop")),
]
c.add_aliases("path", path_aliases)
Exemplo n.º 13
0
        ratter.rats_killed += 1


ratting_aliases = [
    (
        "^rat on",
        "rat on",
        lambda _: rat_on(),
    ),
    (
        "^rat off",
        "rat off",
        lambda _: rat_off(),
    ),
]
c.add_aliases("ratting", ratting_aliases)


ratting_triggers = [
    (
        r"^You have slain a baby rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain a young rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain a rat, retrieving the corpse.$",
Exemplo n.º 14
0
    eqbal(f"stand;backflip {direction}")


def run_and_bomb(bomb_type, direction):
    if direction == "":
        direction = choose_direction()
    run_away(direction)

    global run_back_direction
    timers.add(f"run_and_bomb",
               lambda: throw_bomb(bomb_type, run_back_direction), 0.1)


def run_back():
    global run_back_direction
    run_away(run_back_direction)


run_away_aliases = [
    ("^r(?: (.+))?$", "runaway dir",
     lambda matches: run_away(matches[0] or "")),
    (
        "^rc(?: (.+))?$",
        "runaway dir;throw concussion",
        lambda matches: run_and_bomb("concussion", matches[0] or ""),
    ),
    ("^rb$", "run back", lambda _: run_back()),
]
c.add_aliases("run_away", run_away_aliases)
Exemplo n.º 15
0
        "recite ash ?/me",
        lambda m: eqbal(f"recite ash {m[0] or '&tar'}"),
    ),
    (
        "^pen(?: (.+))?$",
        "recite penance ?/me",
        lambda m: eqbal(f"recite penance {m[0] or '&tar'}"),
    ),
    (
        "^ref(?: (.+))?$",
        "recite reflection ?/me",
        lambda m: eqbal(f"recite reflection {m[0] or '&tar'}"),
    ),
    (
        "^burn(?: (.+))?$",
        "recite burn ?/me",
        lambda m: eqbal(f"recite burn {m[0] or '&tar'}"),
    ),
    (
        "^lig$",
        "recite light",
        lambda m: eqbal(f"recite light"),
    ),
    (
        "^ref(?: (.+))?$",
        "recite reflection ?/me",
        lambda m: eqbal(f"recite reflection {m[0] or '&tar'}"),
    ),
]
c.add_aliases("ab_zeal", zeal_aliases)
Exemplo n.º 16
0
from client import c

assisted = None


def set_assisted(new_assisted):
    global assisted
    assisted = new_assisted


assist_aliases = [
    (
        "^assist (.+)$",
        "assist someone",
        lambda m: set_assisted(m[0]),
    ),
]
c.add_aliases("assist", assist_aliases)
Exemplo n.º 17
0
from client import c, send

from achaea.basic import eqbal
from achaea.state import s

runelore_aliases = [
    (
        "^uruz$",
        "sketch uruz on ground",
        lambda matches: eqbal(f"sketch uruz on ground"),
    ),
    (
        "^jera(?: (.+))?$",
        "sketch jera on me/*",
        lambda matches: eqbal(f"sketch jera on {matches[0] or 'me'}"),
    ),
    (
        "^algiz(?: (.+))?$",
        "sketch algiz on me/*",
        lambda matches: eqbal(f"sketch algiz on {matches[0] or 'me'}"),
    ),
]
c.add_aliases("ab_runelore", runelore_aliases)
Exemplo n.º 18
0
from client import c, echo
from achaea.basic import eqbal

enchantment_aliases = [
    ("iw (.*)", "icewall dir", lambda m: eqbal(f"point ench/icewall {m[0]}")),
    ("fl (.*)", "firelash dir",
     lambda m: eqbal(f"point ench/firelash at {m[0]}")),
]
c.add_aliases("enchantment", enchantment_aliases)
Exemplo n.º 19
0
from client import c, send

from .basic import eqbal

# note: if I play someone who can shield differently again
# I can make a function that checks the current class and does different things

tattoo_aliases = [
    ("^shd$", "touch shield", lambda m: eqbal("touch shield")),
    ("^clk$", "touch cloak", lambda m: eqbal("touch cloak")),
    ("^tree$", "touch tree", lambda m: eqbal("touch tree")),
    ("^minds$", "touch mindseye", lambda m: eqbal("touch mindseye")),
]
c.add_aliases("ab_tattoos", tattoo_aliases)
Exemplo n.º 20
0
from achaea.basic import eqbal
from achaea.defences import auto_defences
from client import c, send
from client.timers import timers


def generosity():
    auto_defences(["selfishness"], "off")
    timers.add(f"turnon_selfish", lambda: auto_defences(["selfishness"], "on"),
               10)
    eqbal("generosity")


survival_aliases = [
    ("^self$", "selfishness", lambda m: auto_defences(["selfishness"], "on")),
    ("^gener$", "generosity", lambda m: generosity()),
    ("^eg$", "enter grate", lambda m: eqbal("enter grate")),
]
c.add_aliases("ab_survival", survival_aliases)
Exemplo n.º 21
0
def parse_who_here(current_chunk):
    current_chunk = strip_ansi(current_chunk)
    found_start = False
    for line in current_chunk.split("\r\n"):
        if "You see the following people here:" in line:
            found_start = True
        elif found_start:
            people_here = line.split(", ")
            break
    echo(f"people here: {people_here}")


who_here_triggers = [
    (
        r"^You see the following people here:$",
        # who here
        lambda _: parse_who_here(c.current_chunk),
    ),
]
c.add_triggers(who_here_triggers)

who_here_aliases = [
    (
        "^wh$",
        "who here",
        lambda _: c.send("who here"),
    ),
]
c.add_aliases("who_here", who_here_aliases)
Exemplo n.º 22
0
from client import c, send

misc_aliases = [
    (
        "^he$",
        "say house phrase",
        lambda matches: send("speak mhaldorian;say Evil subjugates all things."
                             ),
    ),
]
c.add_aliases("sarmenti_misc", misc_aliases)
Exemplo n.º 23
0
        "staffstrike t with air",
        lambda matches: eqbal(f"stand;staffstrike {s.target} with air"),
    ),
    (
        "^sse(?: (.+))?$",
        "staffstrike t with earth",
        lambda matches: eqbal(f"stand;staffstrike {s.target} with earth"),
    ),
    (
        "^ssf(?: (.+))?$",
        "staffstrike t with fire",
        lambda matches: eqbal(f"stand;staffstrike {s.target} with fire"),
    ),
    (
        "^ssw(?: (.+))?$",
        "staffstrike t with water",
        lambda matches: eqbal(f"stand;staffstrike {s.target} with water"),
    ),
    (
        "^hail$",
        "cast hailstorm",
        lambda matches: eqbal(f"stand;cast hailstorm"),
    ),
    (
        "^ham(?: (.+))?$",
        "cast stormhammer at [] and [] and []",
        lambda matches: stormhammer(matches[0] or None),
    ),
]
c.add_aliases("ab_elementalism", elementalism_aliases)
Exemplo n.º 24
0
    (
        "^sap(?: (.+))?$",
        "angel sap t/[]",
        lambda matches: eqbal(f"angel sap {matches[0] or '&tar'}"),
    ),
    (
        "^care(?: (.+))?$",
        "angel care []",
        lambda matches: eqbal(f"angel care {matches[0]}"),
    ),
    ("^refuge$", "angel refuge", lambda _: eqbal("angel refuge")),
    (
        "^emp(?: (.+))?$",
        "angel empathy []",
        lambda matches: eqbal(f"angel empathy {matches[0] or ''}"),
    ),
    ("^cont$", "contemplate t", lambda _: eqbal(f"contemplate &tar")),
    ("^sacri$", "angel sacrifice", lambda _: eqbal("angel sacrifice")),
    ("^absolve$", "angel absolve t", lambda _: eqbal(f"angel absolve &tar")),
]
c.add_aliases("ab_spirituality", spirituality_aliases)

spirituality_triggers = [
    (
        "^White strands of light weave themselves together before your eyes, and within seconds you hold a spiritual mace within your grasp.$",
        # you're mace is here! wield it!
        lambda _: eqbal("wield mace;attach fist to mace"),
    ),
]
c.add_triggers(spirituality_triggers)
Exemplo n.º 25
0
        "crack t/[]",
        lambda matches: send("crack {matches[0] or '&tar'}"),
    ),
    (
        "^deso(?: (.+))?$",
        "perform rite of desolation on t/[]",
        lambda matches: send(
            "perform rite of desolation on {matches[0] or '&tar'}"),
    ),
    (
        "^ham(?: (.+))?$",
        "hammer t/[]",
        lambda matches: send("hammer {matches[0] or '&tar'}"),
    ),
]
c.add_aliases("ab_battlerage", battlerage_aliases)
"""
"""

# occultist battlerage
"""
battlerage_aliases = [
    (   "^har(?: (.+))?$",
        "harry []/t",
        lambda matches: send(f"harry {matches[0] or '&tar'}")
    ),
    (   "^temper(?: (.+))?$",
        "temper []/t",
        lambda matches: send(f"temper {matches[0] or '&tar'}")
    ),
    (   "^ruin(?: (.+))?$",
Exemplo n.º 26
0
        lambda matches: eqbal(
            f"stand;combo {matches[0] or s.target} snk left hfp left hfp left"
        ),
    ),
    (
        "^rl(?: (.+))?$",
        "snk hfp hfp right []/t",
        lambda matches: eqbal(
            f"stand;combo {matches[0] or s.target} snk right hfp right hfp right"
        ),
    ),
    (
        "^sk(?: (.+))?$",
        "swk hfp left hfp right []/t",
        lambda matches: eqbal(
            f"stand;combo {matches[0] or s.target} swk hfp left hfp left"
        ),
    ),
    (
        "^xx(?: (.+))?$",
        "axk upc upc []/t",
        lambda matches: eqbal(f"stand;combo {matches[0] or s.target} axk upc upc"),
    ),
    (
        "^bb(?: (.+))?$",
        "bbt []/t",
        lambda matches: eqbal(f"stand;bbt {matches[0] or s.target}"),
    ),
]
c.add_aliases("ab_tekura", tekura_aliases)
Exemplo n.º 27
0
from achaea.basic import curebal, eqbal
from achaea.state import s
from client import c, echo, send

seafaring_aliases = [
    # (   "^cdef$",
    #    "list of defences",
    #    check_defences,
    # ),
]
c.add_aliases("seafaring", seafaring_aliases)
Exemplo n.º 28
0
def ally_party(matches):
    send("party members")
    # set the enemy trigger
    party_member_trigger = (
        "^Your party has the following members:$",
        find_and_ally_party,
    )
    c.add_temp_trigger(f"party_member_trigger",
                       party_member_trigger,
                       flags=re.IGNORECASE)


group_fighting_aliases = [
    ("^men (.+)$", "multiply enemy", lambda matches: multiple_enemy(matches)),
    (
        "^enemy(?: (.+))?$",
        "enemy []/target",
        lambda matches: enemy_person(matches[0] or "&tar"),
    ),
    ("^unenemy (.+)$", "unenemy []",
     lambda matches: unenemy_person(matches[0])),
    ("^unemall$", "unenemy all", lambda matches: unenemy_person("all")),
    ("^mall (.+)$", "multiple ally", lambda matches: multiple_ally(matches)),
    (
        "^pally$",
        "ally party",
        ally_party,
    ),
]
c.add_aliases("group_fighting", group_fighting_aliases)
Exemplo n.º 29
0
from client import c, send

from .basic import eqbal

vision_aliases = [
    ("^night$", "nightsight", lambda m: eqbal("nightsight")),
]
c.add_aliases("ab_vision", vision_aliases)
Exemplo n.º 30
0
        "^bw(?: (.*))?$",
        "throw bombs!",
        lambda matches: throw_bomb("web", matches[0] or ""),
    ),
    (
        "^bd(?: (.*))?$",
        "throw bombs!",
        lambda matches: throw_bomb("dust", matches[0] or ""),
    ),
    (
        "^mb(?: (.+))?$",
        "make bombs!",
        lambda matches: make_bomb(matches[0] or "")
    ),
]
c.add_aliases("bombs", bomb_aliases)


def _throw_bomb(bomb_type, direction=""):
    return f"stand;unwield left;wield {bomb_type} left;throw {bomb_type} {direction}"


def throw_bomb(bomb_type, direction):

    if direction == "":
        direction = "at ground"

    c.echo(f"throw_bomb type: {bomb_type} dir: {direction}")

    if bomb_type == "":
        c.echo(THROW_BOMB_HELP)