Problem description:
Hi there. I'm trying to find a way to get a list of macros (key and the command the key corresponds to) code wise from the client.
I cannot hardcode it because people (myself included) would use custom skin files which would not match.
Preferably through client-side Javascript (less server load), however DM code is alright too.
Mar 26 2016, 2:35 pm
|
|
Is this a game you're working on? If so, I wouldn't even go that far. I would just make your own macro-maker in-game and when players save their macro list export it to .xml or whatever. That way you can get a list of each individual player's macros and it helps for saving/loading so macros are saved on a player basis and not saved on BYOND's end (in case a player had to uninstall/reinstall BYOND the .xml could be saved server-side and client-side and in case a server crashes and the player wants to transfer the macro list to another server they could just import it).
|
In response to Maximus_Alex2003
|
|
People can already edit the macros manually by editing it in BYOND/skins/[...]/[..], I believe an in game macro editor is way too overkill.
I don't need a list to do something like an in game macro editor. I need a list of macros so I can use the macros from a HTML window if the client has focus on that instead (but still have some level of control, to allow copy paste for example) |
I don't think there's any way to export the macro list, even using JS or HTML, unless you're hard-coding maybe using winget()?
|
According to this thread on this exact topic:
http://www.byond.com/forum/?post=158428#comment676635 Only macros with IDs can be accessed at runtime. The default macros do not have IDs. As for a general list of all non-printable keys: http://www.byond.com/docs/notes/macro.html |
To add to this, if you're going to create/modify macros using winset(), in the Interface file, you have to have the "macros" file existing, though it can be empty. If it doesn't exist, you cannot create/modify any macros through that method.
|
In response to Kaiochao
|
|
Alright well I'll be adding IDs to every macro then, thanks!
|
Alright well I'll be adding IDs to every macro then, thanks! Quick piece of advice. Edit your DMF files in a text editor when dealing with batches of macros. So much faster than using the UI. Believe me. |
In response to Ter13
|
|
Yup, Sublime keybindings in Atom is exactly what I used to do the changes.
|