StPatty33 Posted May 22, 2019 Share Posted May 22, 2019 Hey, all! I'm looking for a way to create a macro that will rotate text (battle cries, for instance). I know how to do it with keybind files, but I really hate keybinding things that I can do w/a tray icon. I'm pretty certain I had this set up years ago on live, but haven't found anything online yet mentioning how this could be done through a macro rather than a keybind. Thanks in advance! Link to comment Share on other sites More sharing options...
srmalloy Posted May 23, 2019 Share Posted May 23, 2019 It's deep overkill for the purpose, but back before the Snap I had a setup with a PERL script that read in a text file containing a list of insults on startup, then looped every (IIRC) five seconds to select a random insult, then write a file with a bind to say the insult, do a taunt, then load the file again. Then I /binloadfile the file once to 'prime' the taunt, and each time I hit the bind key, the character would deliver the insult, taunt, then reload the bind with a different insult. With about a hundred insults in the file, it was unlikely to repeat insults on consecutive taunts. Link to comment Share on other sites More sharing options...
Kalkin Posted May 23, 2019 Share Posted May 23, 2019 It's deep overkill for the purpose, but back before the Snap I had a setup with a PERL script that read in a text file containing a list of insults on startup, then looped every (IIRC) five seconds to select a random insult, then write a file with a bind to say the insult, do a taunt, then load the file again. Then I /binloadfile the file once to 'prime' the taunt, and each time I hit the bind key, the character would deliver the insult, taunt, then reload the bind with a different insult. With about a hundred insults in the file, it was unlikely to repeat insults on consecutive taunts. If you still have that, I wouldn't mind seeing it. Link to comment Share on other sites More sharing options...
nDervish Posted May 23, 2019 Share Posted May 23, 2019 If you still have that, I wouldn't mind seeing it. It's pretty trivial, if you know Perl. Here's one I just threw together in (literally - I timed it) 7 minutes, including testing: #!/usr/bin/env perl use strict; use warnings; use 5.010; my $bind_file_name = './taunt.txt'; my @taunts = ( 'Hey, ugly!', 'My name is $name. You killed my father. Prepare to die.', 'You are going DOWN!', ); while (1) { open my $out, '>', $bind_file_name or die "Failed to open $bind_file_name: $!"; my $taunt = $taunts[rand @taunts]; say $out qq(t "say $taunt\$\$bindloadfile $bind_file_name"); close $out; sleep 5; } Change $bind_file_name to the name of the file (including full path, just to be safe) you want the taunt bind to be written to. Add all your taunts to the list under "my @taunts = (". Change the text inside the "qq()" if you want to bind to a key other than "t" or if you want the text sent to a specific channel instead of using "say". Change the 5 in "sleep 5" to the number of seconds you want to pass between taunt changes. Then just run it[1] and it will continue running forever (or until you hit ctrl-c to kill the program), changing the taunt file every 5 seconds. [1] Note that "just run it" assumes you already have Perl installed. Installing Perl is left as an exercise for the reader. Link to comment Share on other sites More sharing options...
Kalkin Posted May 23, 2019 Share Posted May 23, 2019 Nice. Thank you. I *use* perl but I am not a coder. I can kitbash scripts together through The Power Of Google but this is a great starting point. It wouldn't be hard to leverage for a few other things too (random costume select, random flight pose select, even random emote select from a list). Appreciate it. Link to comment Share on other sites More sharing options...
srmalloy Posted May 24, 2019 Share Posted May 24, 2019 I'm going to have to either find or recreate the set of bind files I made for my Bots/Dark MM that ran a dialog among the bits -- the Assault Bot does the taunt emote and says "Your mother wears the footgear of a soldier!", then one of the Battle Drones double-takes and says "That's supposed to be an _insult_?", after which another Battle Drone does the Research emote, then says "That's what the phrasebook says.", then one of the Protector Bots finishes the sequence by doing the shrug emote and saying "I will _never_ understand organics." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now