• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Python for Hotkeys - transitioning to ButtonMaster

Wrote this to help transition my hotkeys over to Button Master format, thought others might be able to use it to.

What does this script do?
The script will read the Toon_server.ini file specified and spit out your hotkeys in the formatting that ButtonMaster.ini will be looking for. It will start with "[Button_1]" and continue until there are no more hotkeys found in the specified file. So if you have a ButtonMaster.ini file already, I would back it up and start with a blank one.

Things you will still need to do after running this:
  1. Copy and paste your results from this script into a vanilla ButtonMaster.ini file
  2. Start Button Master and assign your hotkeys to your buttons
  3. Add your button colors

Example of Output:
Code:
----
[Button_2]
Cmd1=/shd resetcamp
Label=Reset CAMP

[Button_3]
Cmd1=/boxr Pause
Label=Pause ME

[Button_4]
Cmd1=/dgga /target clear
Cmd2=/dgga /attack off
Cmd3=/dgga /pet back off
Cmd4=/dgga /alt act 1215
Label=CLEAR

[Button_5]
Cmd1=/dgga /boxr Manual
Label=Camp OFF

[Button_6]
Cmd1=/dgga /boxr Pause
Label=P GRP
----


Things I used for this are:
VS Code
Python 3.9.x
Lua ButtonMaster

hotkey_converter.py
Python:
import re

# Edit the next line with the path to your hotkey file
path = 'C:\Games\Everquest\Server\Toon_server.ini'
results = []

def read_hotkeys(file_path):
    with open(file_path, 'r') as data:
        for line in data:
            line = line.strip()
            match = re.search(rf"(^Page\dButton\d+(Name|Line\d+).*)", line)
            if match:
                yield match.group(1).replace('Name', ' Label').replace('Line', ' Cmd')

def sort_hotkeys(hotkeys):
    return sorted(hotkeys)

def append_hotkeys(hotkeys):
    for hotkey in hotkeys:
        hotkey = hotkey.strip()
        match = re.search(r"(^Page\dButton\d+\s((Cmd\d+|Label).*))", hotkey)
        if match:
            results.append(f"{match.group(2)}")

def format_hotkeys(results):
    button_count = 1
    previous_cmd = 0

    for x in results:
        label_match = re.search(r"(Label=.*)", x)
        cmd_match = re.search(r"(Cmd\d.*)", x)

        if cmd_match:
            if previous_cmd == 0:
                print(f"[Button_{button_count}]")
            print(cmd_match.group(0))
            previous_cmd += 1
        elif label_match:
            print(f"{label_match.group(0)}\n")
            button_count += 1
            previous_cmd = 0

if __name__ == '__main__':
    hotkeys = read_hotkeys(path)
    hotkeys = sort_hotkeys(hotkeys)
    append_hotkeys(hotkeys)
    format_hotkeys(results)


While this has worked well for me, you will still want to review your hotkey output before going into battle. Hopefully this will save you some time.

-Taz
 
Python for Hotkeys - transitioning to ButtonMaster

Users who are viewing this thread

Back
Top
Cart