Keybinding Script

tornado · 2021

tornado

  • Full Member
  • ***
    • Posts: 293
  • no questions asked and none answered
on: May 06, 2017, 10:22:58 am
Note:I put it here because here seems most appropriate. if this needs to be moved, go right ahead.

Back when the CW anniversary editions came out I went off and wrote a script for the unit buttons.
since .AHK files are not supported as attachments were is the code:
Code: [Select]
+1::6
+2::7
+3::8
+4::9
+5::0

This is written in Autohotjey, so if you aren't aware of it go look it up.
I made this because I am lazy, and don't want to move my hand off the left half of the keyboard to press the unit buttons.
simply put, pressing 1-5 acts normally. pressing Shift 1-5 pressed the button five numbers along(and for you programmers out there, yes i tried to make it do that, but its big and clunky and has too many exceptions[ what if it tires to add five to the key L or something?]).
I put this up here for a few reasons: the main one being: If i find this so handy, wouldn't other people?
the only major downsides is that you can't easily turn it off, without halting the program in the Task manager.
However, this is in beta. I am working on this(adding an Off button of some kind, re-binding the speed up/slow down/pause options, and adding a Techs button[because apparently CW1 doesn't come with a Techs shortcut, so i have to code that manually]).

I'm rambling a bit here, but if you find this useful(or happen to improve it somehow) do say.
If you have any questions, feel free to ask.

-tornado.
PS:this is not a request to retroactively apply Keybinding options to CW1. im having fun with this.

Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quote
first, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one


tornado

  • Full Member
  • ***
    • Posts: 293
  • no questions asked and none answered
Reply #1 on: May 06, 2017, 11:50:56 am
(click to show/hide)
Update:
Added ability to quite program without using TM(Shift+End by default)
Added techs button(In dev, report back if it doesn't work).

now that thats done i think i might go make one for CW2.

Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quote
first, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one


tornado

  • Full Member
  • ***
    • Posts: 293
  • no questions asked and none answered
Reply #2 on: May 07, 2017, 05:47:22 am
(click to show/hide)

chnagelog:
-modified techs button to also click the Continue button at the end of a map.
-added a few personal keybinds for my playstyle(disabled by default)

this is pretty much as far as it is going.
for references to the code see:
https://autohotkey.com/docs/AutoHotkey.htm

-tornado
« Last Edit: May 07, 2017, 06:01:32 am by tornado »

Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quote
first, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one


tornado

  • Full Member
  • ***
    • Posts: 293
  • no questions asked and none answered
Reply #3 on: May 07, 2017, 09:18:54 am
Minor request to anyone out there:
if you could happen to get me the pixel sizes for the various units it would be much appreciated,

Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quote
first, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one


Karsten75

  • Hero Member
  • *****
    • Posts: 6898
Reply #4 on: May 07, 2017, 09:44:26 am
Minor request to anyone out there:
if you could happen to get me the pixel sizes for the various units it would be much appreciated,

For which game? They ae mostly a few standard sizes in each game. the full images are on the wiki (mostly, I think) for each game and you should be able to get the pixel sizes from there.

'If you want to live a happy life, tie it to a goal, not to people or things.'

Albert Einstein
(1879-1955)


tornado

  • Full Member
  • ***
    • Posts: 293
  • no questions asked and none answered
Reply #5 on: May 07, 2017, 01:16:56 pm
Hadn't though of that. I was actually going to set up a test level in the editor to i could see how large one pixel of terrain was on my monitor, then fiddle with those numbers a bit- the end goal being can I make it place certain units in a certain configuration(if i ever had the spare time).
also, I only ever planned on making this for CW1. CW2 has 6 weapons and systems, but has keys for swapping, so I'm will to move my hand to reach. CW3 has control customization(which I never got around to using), and PF does have keybindings, although admittedly some really strange ones(why would i ever want to set a waypoint? And why does it only work for omnis?). the most I might do is set some ship selection buttons, though the last time i counted there were 24 slots. This literally started out as a bodge for me to be lazy, I've just been adding to it because.

edit:turns out there are no given sizes on the wiki. makes sense give the size/position would change on different resolutions(mines 192081080, which probably changes a few things. also, due to the ubiquity of CW flash games(Such as Evermore, Training Sim, and User Space) which therefore have the button in different places, I'm trying to change the code that clicks on the upgrade button to instead click on the first thing it finds that is the right color(305030). this may come back to bite me later).

Edit:Ok, sorry. it seemed obvious to me that I was referring to CW1. also, this currently only works for CW1 in fullscreen. not for the flash games. sorry.
« Last Edit: May 13, 2017, 09:07:02 am by tornado »

Now CEO of Particular Endeavors. http://knucklecracker.com/forums/index.php?topic=23752.new#new
We apologize for all inconveniences that we caused.
Quote
first, you have to imagine a very big box, fitting inside a very samll box.
then, you have to build one