Inserting commands into bind load files?


DarkGob

 

Posted

I remember some time ago someone mentioning a way to insert commands into bind files that execute when the file is loaded - does anyone know the syntax? ParagonWiki doesn't seem to mention it.


 

Posted

As far as I can tell, there is no way to make commands in a bind file automatically run simply by loading a bind file... unless certain circumstances are met. The bindloadfile would have to be already bound to a key that is also inside the file it's loading, and the syntax for the key inside the file would have to tell the client to run it when the key is released.

For example:

Filename.txt
KEY "+$$say I loaded Filename.txt"

/bind KEY "bindloadfile Filename.txt"

The first time you hold down KEY, the file would be loaded.
When you release KEY, the command will execute.
Any future press of KEY will execute the command twice.

The usefulness of this mechanic is kinda limited. After you run it the first time, it defeats it's own purpose and you would have been better off just binding the key directly to what you want it to do instead of to the file.

If you tell me what it is you are specifically trying to do, I might be able to come up with something for you. Without that, it's really hard to explain how to get this to cycle correctly in a useful situation.


 

Posted

Basically, have an editable bunch of stock commands to run at character creation with a minimum of fuss - load universal binds {of course}, but also load a default window and chat layout, create standard-issue macros, etcetera.


 

Posted

Well, when you create a new character, your keybinds.txt file is already loaded. For the most part, window layout is too... (provided you've done a bindsave and wdwsave from a different toon at some point). The positions of global channels do kinda get lost and need to be reloaded, but anyway... here's my suggestion:

In your keybinds.txt file, edit the line for F7. Change it to:
F7 "wdwload$$chatload$$unbind F7"

After you create your new character, simply press F7.
That will ensure that your window layout is loaded.
It will fix your chat to put global channels back where "they are supposed to be".
It will also fix F7 back to it's standard "Ready!" in a Green bubble for future presses.

For your "editable bunch of stock commands", I assume you mean another file (besides your keybind.txt file) that you might want to edit on occasion to keep specific personalized content together. In this case, revise the F7 bind above to:
F7 "wdwload$$chatload$$unbind F7$$bindloadfile Custom.txt"

As for creating your macro buttons for you, that can certainly be done too. You'd just need to fit them into the command line as well, but if there are too many and it gets too long, it might require the use of a chain of binds, or multiple keys instead.

For example, let's take out the "unbind F7" and replace it with another file:
F7 "wdwload$$chatload$$bindloadfile Custom.txt$$bindloadfile Macros1.txt"

Macros1.txt
F7 "macro NAME "some string of commands"$$unbind F7"
F8 "macro NAME "some string of commands"$$unbind F8"
F9 "macro NAME "some string of commands"$$unbind F9"

---- OR ----

Macros1.txt
F7 "macro NAME "some string of commands"$$macro NAME "another sting of commands"$$macro NAME "long string of commands here that reaches the text limit"$$bindloadfile Macros2.txt"

Macros2.txt
F7 "macro NAME "some string of commands"$$macro NAME "another sting of commands"$$macro NAME "long string of commands here that reaches the text limit"$$bindloadfile Macros3.txt"

Macros3.txt
F7 "macro NAME "maybe this is your last macro"$$Tell $player, "Macros finished loading"$$unbind F7"

That would take repeated presses of the key, but it gets the job done, and even tells you when it's finished.

I know it's not as automatic as you might have hoped, but I hope that helps you get started. If there is anything more specific, or you can't get it to work, I'll be glad to help.

Just a note, I usually test my specific examples in-game when I give somebody forum advice, but I'm not in the game right now and headed to work, so I hope it's pretty much accurate for now. If not, we'll figure it out later. haha
Good Luck


 

Posted

Prepending with $$ should work. I use this to generate a set of inspiration-combining macros for new characters. An example of the Tier 1 macro:

Quote:
$$macro T1 "insp_combine Insight Catch_a_Breath$$insp_combine Enrage Catch_a_Breath$$insp_combine Luck Catch_a_Breath$$insp_combine Respite Catch_a_Breath$$insp_combine Sturdy Catch_a_Breath"
This along with the other macros sits in a file called end.txt; typing "/bindloadfile end.txt" puts 4 macros into my character's tray. Not sure if this will work with other slash commands but I don't see why not.


"You don't lose levels. You don't have equipment to wear out, repair, or lose, or that anyone can steal from you. About the only thing lighter than debt they could do is have an NPC walk by, point and laugh before you can go to the hospital or base." -Memphis_Bill
We will honor the past, and fight to the last, it will be a good way to die...

 

Posted

Quote:
Originally Posted by DarkGob View Post
Prepending with $$ should work.
That's the one, thanks. I kept trying with a varying amount of plusses; I didn't think to try with $s.


 

Posted

Quote:
Originally Posted by DarkGob View Post
Prepending with $$ should work. I use this to generate a set of inspiration-combining macros for new characters. An example of the Tier 1 macro:
Quote:
$$macro T1 "insp_combine Insight Catch_a_Breath$$insp_combine Enrage Catch_a_Breath$$insp_combine Luck Catch_a_Breath$$insp_combine Respite Catch_a_Breath$$insp_combine Sturdy Catch_a_Breath"
This along with the other macros sits in a file called end.txt; typing "/bindloadfile end.txt" puts 4 macros into my character's tray. Not sure if this will work with other slash commands but I don't see why not.
That's quite interesting. I can't say I ever messed around with that.

What happens if you put a few $$macro entries into your default keybind.txt file? Would it automatically add them to a new character?


 

Posted

Quote:
Originally Posted by Quinch View Post
Basically, have an editable bunch of stock commands to run at character creation with a minimum of fuss - load universal binds {of course}, but also load a default window and chat layout, create standard-issue macros, etcetera.
I have a custom popmenu I made, bound to Tilde in my default keybinds.txt file. It's named Monitor, and originally, I only used it to monitor the 10 Combat Attributes I prefer to watch.

Now, however, I've modified it to set up my Combat Monitor, and then, based on faction (Hero, Villain, or Praetorian), I load the proper Window, Chat, and Option settings, and finally load my custom keybinds file I made for the character.

When I'm doing the Combat Monitor, I have 10 specific things I load, so in the popmenu, they're set to keys 1-0, in the order I want them. The link for each item I monitor ends with $$popmenu Monitor so that the menu instantly pops back up. All I have to do is press 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 and all 10 items are there.

The Settings are in sub-menus, with H, V, and P set as accelerators. So, if I'm playing a Hero, I press H, and the next level of the menu shows up, where I can then press W to load my Window Settings. Sadly, I've had issues with attempting to add $$ popmenu Monitor to the end of the Options stuff. My chat input becomes active, and my keys stop responding. So, I have to press ~ and then H, V, or P two more times to get the other two settings (Chat and Options). It's not really a bother.

Finally, since I have yet to find a way to load a custom bindfile using the $name string, I have it do this:

Option "&Load Binds" "beginchat /bindloadfile C:\Binds\.txt"

That places the text /bindloadfile C:\Binds\.txt into my chat area, and then I press the left arrow key 4 times to move it between \ and . where I then type the name of the character I'm loading the binds for.

Popmenu is friggin' awesome.




[ ProTip: The banner is a link to art refs!! | The Khellection | The HBAS Repository | Brute Guides (4/16/10) | How To Post An Image - A Quick Guide ]
Biggest Troll on the forums? I'll give you a hint:

 

Posted

Quoting myself:

Quote:
Originally Posted by Master-Blade View Post
What happens if you put a few $$macro entries into your default keybind.txt file? Would it automatically add them to a new character?
I just tried this, and it seems to work just fine (with a couple strange error messages that seem to mean nothing).
It sounds like exactly what the OP wants.

Rather than put them in an extra file that you'd have to manually load, you could include them directly in your keybinds.txt file and the Macro buttons are loaded automatically upon creation.

The only problem is that if you ever have to /bindload again in the future for any reason, the macros will duplicate.

To fix that, I'd simply go back to my first suggestion that says to use the F7 key and kill 2 birds with one stone. Simply have F7's default to load your macros and fix itself upon first press. (F7 "unbind f7$$bindloadfile macros.txt")

That gets the job done at the press of 1 key. No having to remember commands or filenames every time you make a new character. Smoooth. I like it!

I can think of some silly ways to use this (macro commands aren't the only ones that can be automatically loaded from the file btw). I'd like it even more without the error messages every time you load a macro file though. haha