gametechmods

Robot Arena => Discussion => Topic started by: nightcracker on May 29, 2011, 09:25:54 PM

Title: [TOOL] movepixel
Post by: nightcracker on May 29, 2011, 09:25:54 PM
I'm sorry if this is not allowed/wrong forum/against any other rule. I just find this useful and wanted to share.

I got sick of trying to move one pixel while stacking and stuff in the bot lab, so I wrote this little application. It allows you to move your cursor one pixel at a time by using a keybind for super precise movement, and while your at it you can rotate, elevate and place the component too. Basically this allows you to do keyboard component placing.

Download here (http://nclabs.org/downloads/movepixel_beta.zip).

Requirements:
Autohotkey (http://autohotkey.com/) - Direct download (http://www.autohotkey.net/~Lexikos/AutoHotkey_L/AutoHotkey_L_Install.exe)

Usage:
Unzip and extract somewhere. Double click movepixel.ahk and you're good to go! The default keybindings can be found below this paragraph. You can edit the keybindings in the movepixel.ahk file. Read up on Autohotkey documentation for further guidance.

Once you look at your keyboard these keybindings will make sense :)
Enter - click mouse button
F8 - alternative for pause break
SHIFT+Del - rotate counter-clockwise one "tick"
SHIFT+Pagedown - rotate clockwise one "tick"
CTRL+SHIFT+Del - rotate counter-clockwise 90 degrees
CTRL+SHIFT+Pagedown - rotate clockwise 90 degrees
CTRL+Home - move component up
CTRL+End - move component down
Home - move cursor one pixel up
End - move cursor one pixel down
Delete - move cursor one pixel left
Pagedown - move cursor one pixel right

If you do not trust my binary, here is the source, compile it yourself:
Code: [Select]
#include <cstring>

#include <windows.h>

void movecursor(long x, long y);
void leftclick();

#ifdef _MSC_VER
#define argc __argc
#define argv __argv
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow) {
#elif
int main(int argc, char *argv[]) {
#endif
if (argc == 2 && !strcmp(argv[1], "click")) {
leftclick();
} else if (argc == 4 && !strcmp(argv[1], "move")) {
long x, y;
x = atol(argv[2]);
y = atol(argv[3]);

movecursor(x, y);
}

return 0;
}

void movecursor(long x, long y) {
INPUT buffer = {0};

buffer.type = INPUT_MOUSE;
buffer.mi.dwFlags = MOUSEEVENTF_MOVE;
buffer.mi.dx = x;
buffer.mi.dy = y;

SendInput(1, &buffer, sizeof(INPUT));
}


void leftclick() {
INPUT buffer = {0};
buffer.type = INPUT_MOUSE;

buffer.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
SendInput(1, &buffer, sizeof(INPUT));

Sleep(50);

buffer.mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(1, &buffer, sizeof(INPUT));
}
Title: Re: [TOOL] movepixel
Post by: SKBT on May 29, 2011, 09:38:18 PM
Sweet... Now we can all build at 123's level of precision.

Oh and welcome to GTM!
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 29, 2011, 09:43:56 PM
Sweet... Now we can all build at 123's level of precision.

Oh and welcome to GTM!
Thanks!
Title: Re: [TOOL] movepixel
Post by: Pwnator on May 29, 2011, 09:48:00 PM
YOU ARE AWESOME, BRO.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 29, 2011, 09:53:07 PM
YOU ARE AWESOME, BRO.
*Cough*

I'm an awesome programmer/script kiddo, but so far I haven't been able to create even a half-decent bot xD

But thanks :)
Title: Re: [TOOL] movepixel
Post by: Fracture on May 29, 2011, 09:55:12 PM
We're getting so close to BFE/AAM, yet far enough to not cross the line. xD
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 29, 2011, 09:57:50 PM
We're getting so close to BFE/AAM, yet far enough to not cross the line. xD
Forgive my noobness, but what is BFE/AAM?
Title: Re: [TOOL] movepixel
Post by: Sage on May 29, 2011, 09:58:49 PM
THATS SO AMAZING.

EDIT: BFE/AAM is going outside of the game and editing the files that are inside the game, aka cheating. But this is inside the game, so I think it's ok!
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 29, 2011, 10:04:50 PM
THATS SO AMAZING.

EDIT: BFE/AAM is going outside of the game and editing the files that are inside the game, aka cheating. But this is inside the game, so I think it's ok!
Ah yeah, anything you can do with this can be done the normal way, it just makes it a bit easier.
Title: Re: [TOOL] movepixel
Post by: kill343gs on May 29, 2011, 10:53:09 PM
I support this tenfold. Good work.
Title: Re: [TOOL] movepixel
Post by: JoeBlo on May 30, 2011, 04:44:05 AM
Well... That was the single greatest first post on this forum..
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 04:52:19 AM
I get "The system cannot find movepixel.exe" when I try anything.
EDIT: Missing .dll file. Fixed now. Pretty cool. Might help with stacking in Stock  :eek:
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 07:26:11 AM
I get "The system cannot find movepixel.exe" when I try anything.
EDIT: Missing .dll file. Fixed now. Pretty cool. Might help with stacking in Stock  :eek:

I'm sorry, this is my fault I guess I'll recompile it soon and make sure to have as little weird visual c++ dll requirements as possible.

Well... That was the single greatest first post on this forum..
I feel flattered :)

Since there is such a huge interest I've been thinking and when I get home I will add three more keys:
ALT+Page up - save cursor position
ALT+Insert - load cursor position
SHIFT+Insert - click the left mouse button, this is to prevent accidently moving the mouse while clicking

The save/load cursor position should make tweaking with sliders a bit easier (since some sliders always reset to their default value, like the height slider).
Title: Re: [TOOL] movepixel
Post by: cephalopod on May 30, 2011, 08:03:26 AM
I agree with JB's post... This might make it actually possible for me to stack o.o thank you very much, new and very awesome person!
Title: Re: [TOOL] movepixel
Post by: Avalanche on May 30, 2011, 09:47:29 AM
Now,We are so precise i may well check what the limit height is for a HPZ,a supervolt(with CB on?)And a DDT.
Nah,not me ill be eyeballing it :P
Title: Re: [TOOL] movepixel
Post by: freeziez on May 30, 2011, 10:18:32 AM
Now,We are so precise i may well check what the limit height is for a HPZ,a supervolt(with CB on?)And a DDT.
Nah,not me ill be eyeballing it :P

Are you speaking English?

Or is your computer funky from inside your jail cell?
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 11:16:53 AM
Mine's not working... it keeps saying im missing MSVCR100.dll from my system, even though ive downloaded it and reinstalled twice.
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 11:19:35 AM
Put the .dll where the movepixel.exe and movepixel.ahk are extracted.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 11:29:51 AM
Alright, updated the tool. This time I statically compiled the VC++ runtime environment so you don't need to download and install all kinds of DLL's. Now supports loading and saving cursor positions and emulating left mouse clicks. Give me two secs to upload and update main post.

--

EDIT: Update done, but saving/loading cursor positions still seem bugged. Hang on while I'm trying to get this fixed. You can still download and install, the rest of the features work fine.
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 11:40:59 AM
Works great now, thanks.
Title: Re: [TOOL] movepixel
Post by: Somebody on May 30, 2011, 11:41:03 AM
Ok, I downloaded an installed AutoHotKey_L

Then I unzipped movepixel and double clicked the script, and Autohotkey says that it IS running.

But when I go to use it, I get this.

(https://gametechmods.com/uploads/images/1292Movepixel.png)

halp?
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 11:46:36 AM
Another update, fixed in-game loading and saving cursor positions, apparently robot arena only supports relative mouse movement events.

Still working on fixing clicking.

@Somebody: Hmm, try removing all related files of movepixel and reinstall with the latest download found in the first post. That should fix this issue.
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 11:55:10 AM
Great job.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 11:58:02 AM
Alright, another update fixing the mouse click. I simply had to wait 50 miliseconds between sending  "mousedown" and "mouseup" for RA2 to register it.
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 12:01:23 PM
REPORT: All is fine but the X axis of the mouse when loading location seems to be too far to the right.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 12:05:31 PM
REPORT: All is fine but the X axis of the mouse when loading location seems to be too far to the right.

Thanks for the report, very useful.

Hmm, I suspect that you run RA2 on a different ratio than your desktop. What is the resolution of your desktop and at what resolution do you use RA2?
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 12:09:41 PM
Both 1280x1024. Outside of RA2 it's only horizontal. Inside it's both horizontally and vertically out.
EDIT: In fact it seems to be choosing random spots all over the place then settling on one random spot.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 12:42:43 PM
Both 1280x1024. Outside of RA2 it's only horizontal. Inside it's both horizontally and vertically out.
EDIT: In fact it seems to be choosing random spots all over the place then settling on one random spot.

Is it off in the default desktop too?

And do you use full screen?
Title: Re: [TOOL] movepixel
Post by: Squirrel_Monkey on May 30, 2011, 12:49:27 PM
Both 1280x1024. Outside of RA2 it's only horizontal. Inside it's both horizontally and vertically out.
EDIT: In fact it seems to be choosing random spots all over the place then settling on one random spot.

Is it off in the default desktop too?

And do you use full screen?
It's off on the desktop as well and I've tried both full screen and windowed mode.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 01:31:10 PM
Ok, I have a bit deeper understanding of the game cursor in RA2 now, it's a custom cursor that works by tracking the Windows cursor's movement and reflecting that with the in-game cursor. But the second you smash into the side of the RA2 window this data messes up. I'll try and look for alternative ways for saving/restoring the game cursor.
Title: Re: [TOOL] movepixel
Post by: Jack Daniels on May 30, 2011, 01:43:59 PM
Excellent work sir! Figuring out the mouse tracking voodoo when the game is in window-ed mode will be a pain.

Whenever I run the game in window-ed mode my shadowed cursor runs amok on the desktop.  It only seems to be a factor on the right hand side of the game though. If I push the cursor too far and click it will bring me to the desktop instead (more than half the time it makes RA2 lock up in the process).
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 01:53:29 PM
Exactly. The reason why there is only a problem with the right hand side can be easily explained by the fact that the origin of screen coordinates in windows are in the topleft.

If I only had the RA2 source so I could check exactly how they do it it would make it a lot easier. This isn't the first thing I've reverse-engineered but my hopes aren't very high.

On the other hand, I'm going to leave the feature in. It should probably work as long as you don't bump into the sides of the window after saving a position. Perhaps more test cases would help, I would <3 you if you could test the save/load feature under windowed mode and under fullscreen mode.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 02:05:14 PM
UGH.

I only just noticed that things like "Attach" move your cursor, which is impossible for me to track. I guess I'll scrap the load/save feature.

Any other requests before I make the first "real" release (so far it was pretty much beta)?
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 03:20:11 PM
i wonder if you can make shortcuts for rotating a raising components... like a hotkey for 90 degree rotation and a hotkey for 1 shift upwards of a component.
Title: Re: [TOOL] movepixel
Post by: GarvinTheGreat on May 30, 2011, 03:31:17 PM
Lol, This guy only has 14 posts and hes got rep of three. By the time I had 14 posts, I was already Pulling Garvins  :mrgreen: Anyway welcome to GTM and dont end up like me!
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 03:50:08 PM
i wonder if you can make shortcuts for rotating a raising components... like a hotkey for 90 degree rotation and a hotkey for 1 shift upwards of a component.

Allright, I'll try. Though I think plain rotating is more useful then 90 degree rotating. Do the following (updated) keybinds sound OK (I'm forced to use shift and control because of obvious reasons)?

ALT+Enter - click mouse button
SHIFT+Del - rotate counter-clockwise
SHIFT+Pagedown - rotate clockwise
CTRL+Home - move component up
CTRL+End - move component down
ALT+Home - move cursor one pixel up
ALT+End - move cursor one pixel down
ALT+Delete - move cursor one pixel left
ALT+Pagedown - move cursor one pixel right

@Garvin: I think it's a matter of contributing. If you contribute you get rep :)
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 04:01:50 PM
Looks great cracker! Thanks
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:08:58 PM
Looks great cracker! Thanks

Please, when you shorten my name use NC :)

And update is done, new program uploaded, editing main post.

Removed save/load and added rotating/elevating components.
Title: Re: [TOOL] movepixel
Post by: Enigm@ on May 30, 2011, 04:10:48 PM
Looks great cracker! Thanks

Please, when you shorten my name use NC :)

I'm guessing you're white. XD
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:13:45 PM
Looks great cracker! Thanks

Please, when you shorten my name use NC :)

I'm guessing you're white. XD

As in skin color or ??
Title: Re: [TOOL] movepixel
Post by: GarvinTheGreat on May 30, 2011, 04:15:03 PM
Looks great cracker! Thanks

Please, when you shorten my name use NC :)

I'm guessing you're white. XD
Lol
Title: Re: [TOOL] movepixel
Post by: Enigm@ on May 30, 2011, 04:15:16 PM
Looks great cracker! Thanks

Please, when you shorten my name use NC :)

I'm guessing you're white. XD

As in skin color or ??
As in your skin color is Caucasian. and "cracker" is a racial slur for a person that is Caucasian.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:16:16 PM
I had no clue, but yes I'm "white". Getting offtopic are we?
Title: Re: [TOOL] movepixel
Post by: GarvinTheGreat on May 30, 2011, 04:18:11 PM
Getting offtopic are we?

Absoulutley!
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 04:27:16 PM
Enigma I think he just likes NC better... :)

Cool I'll check out the new features NC, and let you know if there are any bugs.

EDIT: what would you like us to do with the .ink file?
Title: Re: [TOOL] movepixel
Post by: Kujii on May 30, 2011, 04:30:12 PM
Nice Job man

The save-tool unfortunately may not work perfectly due to how the engine works, but I'd still keep it in there since it works under some conditions, if not many. It also still places us generally in the same area, so it would be a great tool if we need a general reminder of where we had been.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:32:53 PM
Nah, I won't put it back in unless I can guarantee pixelperfect repositioning. Otherwise it's use would be nullified.

@Sage: The .lnk was accidently zipped in xD It's out now though.
Title: Re: [TOOL] movepixel
Post by: Scorpion on May 30, 2011, 04:37:11 PM
Wow, what a great way to introduce yourself.
The clockwise rotation will be very handy in particular, save me a lot of time fiddling around with multis...

I'd also be curious to see your bots that you mentioned before at some point, you seem like the kind of person who'd be able to take advice well and improve quickly.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:41:25 PM
Wow, what a great way to introduce yourself.
The clockwise rotation will be very handy in particular, save me a lot of time fiddling around with multis...

I'd also be curious to see your bots that you mentioned before at some point, you seem like the kind of person who'd be able to take advice well and improve quickly.

I'm working on a popup ATM, I'll guess I'll open a stock showcase in a few days once the first version is done. And yes, I usually take advice well, as long as it's not written in trollspeak (LOLZ UR IRONSPIKE SUXX USE MACEZ).
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 04:41:30 PM
https://gametechmods.com/uploads/files/movepixelSAGEMOD.zip (https://gametechmods.com/uploads/files/movepixelSAGEMOD.zip)
For all of those who don't have any of the keys that NC is using (like, say, on an old macbook pro) i modded the file to use UHJK instead (which should be on everyones keyboard). Heres the commands:

ALT+Enter - click mouse button
SHIFT+H - rotate counter-clockwise
SHIFT+K - rotate clockwise
CTRL+U - move component up
CTRL+J - move component down
ALT+U - move cursor one pixel up
ALT+J - move cursor one pixel down
ALT+H - move cursor one pixel left
ALT+K - move cursor one pixel right
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:43:37 PM
I approve sage, if you will take down that RAR and ZIP it instead. I have a huge hate against RAR and would prefer not to see my stuff redistributed in these containers :)

I forgot to mention, if anyone cares, this is the license:
Quote
Copyright 2011 Orson Peters. All rights reserved.

Redistribution of this work, with or without modification, is permitted if
Orson Peters is attributed as the original author or licensor of
this work, but not in any way that suggests that Orson Peters endorses
you or your use of the work.

This work is provided by Orson Peters "as is" and any express or implied
warranties are disclaimed. Orson Peters is not liable for any damage
arising in any way out of the use of this work.
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 04:45:53 PM
done.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:49:41 PM
Hmm, perhaps I should cooperate your change in my version instead. You are right about these keys on many laptops (like weird positioning).

I think I'll go with JIKL instead of HUJK, because if you take two wirings, one for normal AWSD and one for inversed next to it that would be FTGH. That overlaps with HUJK so JIKL can be considered "safe" if we look at the most common wiring setups.
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 04:53:11 PM
Hmm, perhaps I should cooperate your change in my version instead. You are right about these keys on many laptops (like weird positioning).

I think I'll go with JIKL instead of HUJK, because if you take two wirings, one for normal AWSD and one for inversed next to it that would be FTGH. That overlaps with HUJK so JIKL can be considered "safe" if we look at the most common wiring setups.

Good idea. Just remind everyone to exit the script once you're done playing RA2 if we're all going to being using letters. (It messes up with typing occasionally)
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 04:59:08 PM
Perhaps even one more shifted to the right so your pink can rest on the enter key. And now were not at those critical Pageup/delete/etc keys, we might as well remove the ALT modifier. What about this?

Enter - mouse click

O - move cursor one pixel up
L - move cursor one pixel down
K - move cursor one pixel left
; - move cursor one pixel right

SHIFT + K - rotate counter-clockwise
SHIFT + ; - rotate clockwise
CTRL + O - move component up
CTRL + L - move component down

And yes, you must remember to exit the script after exiting RA2, but I guess most users will find that out soon enough ;)
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 05:02:14 PM
Perhaps even one more shifted to the right so your pink can rest on the enter key. And now were not at those critical Pageup/delete/etc keys, we might as well remove the ALT modifier. What about this?

Enter - mouse click

O - move cursor one pixel up
L - move cursor one pixel down
K - move cursor one pixel left
; - move cursor one pixel right

SHIFT + K - rotate counter-clockwise
SHIFT + ; - rotate clockwise
CTRL + O - move component up
CTRL + L - move component down

And yes, you must remember to exit the script after exiting RA2, but I guess most users will find that out soon enough ;)

Is there a way to start the script automatically and close it automatically with RA2?

Also, new commands look great.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 05:22:03 PM
Is there a way to start the script automatically and close it automatically with RA2?

Also, new commands look great.

Well, I could write a wrapper for RA2 and bypass Autohotkey completely (this looks interesting: http://stackoverflow.com/questions/1820825/global-hotkey-with-win32-api (http://stackoverflow.com/questions/1820825/global-hotkey-with-win32-api)). Then instead of a shortcut to RA2 you have a shortcut to the wrapper. But perhaps this is overkill and reduces configurability/portability.
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 05:26:26 PM
Oh, alright. Yea it's probably simpler this way, just didn't know if you could "latch" a script to a certain .exe to open and close when the .exe does or something. If it requires a completely different way, then it's fine.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 05:54:23 PM
I have an idea. My tool is a little process that runs in the background. It registers the appropriate hotkeys (for which I will make some configuration utility). When a hotkey fires it c if the active window is RA2, if yes then it does it's magic, else it passes on the hotkey.
Title: Re: [TOOL] movepixel
Post by: Badnik96 on May 30, 2011, 06:34:39 PM
oh man this looks cool

totally DLing it when I get my own PC back
Title: Re: [TOOL] movepixel
Post by: SKBT on May 30, 2011, 07:24:30 PM
O - move cursor one pixel up
L - move cursor one pixel down
K - move cursor one pixel left
; - move cursor one pixel right

I see a problem with these keys. I often use these in naming a robot and the L key gets used in AIing robots. If you went back to it being something like you press alt as a modifier or shift key it would be better than not.
Title: Re: [TOOL] movepixel
Post by: Somebody on May 30, 2011, 07:39:06 PM
nightcracker should become quickest Tech Adviser in history of GTM! I'm callin it!
Title: Re: [TOOL] movepixel
Post by: Sage on May 30, 2011, 10:11:21 PM
SKBT brings up a good point... i would just keep the alt modifier.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 30, 2011, 10:19:32 PM
Yeah, but I guess it will be the easiest with two versions, one for home/end/etc and one for the legacy keys for laptops. I've tried using kol; and jikl but my fingers just can't find the orientation.
Title: Re: [TOOL] movepixel
Post by: nightcracker on May 31, 2011, 05:58:00 AM
All right, I think this is a pretty decent way of making the application:

There are two files, "launcher.exe" and "keys.cfg". Both get installed in the RA2 folder. The user must update shortcuts on his/her desktop to point to launcher.exe instead of Robot Arena 2.exe.

launcher.exe sets up the keybindings (to be configured in keys.cfg) and launches RA2. When RA2 is finished it exits itself too. The keybindings are only active if RA2 is the active window.
Title: Re: [TOOL] movepixel
Post by: Sage on May 31, 2011, 03:09:44 PM
Amazing! Can't wait for it to be ready.
Title: Re: [TOOL] movepixel
Post by: Scrap Daddy on May 31, 2011, 03:36:46 PM
nice dude
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 01, 2011, 05:30:42 AM
All right, just a quick update on my progress. I can register the global hotkeys and act accordingly (click, move cursor, etc).

I still have to do the configuration part which can be really hard, I think I'm going to make it easy for myself by forcing you guys to use the hexadecimal numbers found here (http://msdn.microsoft.com/en-us/library/dd375731%28v=vs.85%29.aspx).

And what also still needs to be done is the disabling/enabling the keybinds on the fly and shutting down the program at the right time, which is not easy either since I'm not used to win32 multi-threading and it needs to be done in an other thread.
Title: Re: [TOOL] movepixel
Post by: Naryar on June 08, 2011, 02:03:41 AM
Oh, goodie.
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 10, 2011, 05:52:50 AM
Another quick update!

... I haven't been able to do anything. In total I've been online for like 4 hours the past two weeks, of which most on school. The only moments I have been behind my own computer have been consumed by the building of my first "worthy" popup.

I hope I can finish this somewhere this month, but I'm not sure (exams are coming soon).
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 11, 2011, 10:07:36 AM
Well, nvm. A lot of work for very little reward would this be. If I ever get my hands on a LOT of free time then I will do this, but not now.

However, I have an idea for the next version (which will use AutoHotkey):

How about... using F12 for Pause Break for the people that don't have it?
Title: Re: [TOOL] movepixel
Post by: Sage on June 11, 2011, 10:20:38 AM


How about... using F12 for Pause Break for the people that don't have it?

YES THANK YOU OH MY GOD

Although not f12 (that button shows the collision mesh of your robot)... maybe something like alt+P
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 11, 2011, 10:31:14 AM
Hah I knew you'd react like that :D

ALT+P seems a bit vague, is F11 free?
Title: Re: [TOOL] movepixel
Post by: Wacky Bob on June 11, 2011, 10:34:39 AM
F11 is for screenshots, so I think Alt+P would make sense.
Title: Re: [TOOL] movepixel
Post by: JoeBlo on June 11, 2011, 10:45:01 AM
to save you some time

F1-F4 and F9-F12 are all used by RA2
Title: Re: [TOOL] movepixel
Post by: Sage on June 11, 2011, 11:02:03 AM
go for f8. thats where it SAYS i have a pause button but none of the mac functions work while running windows. I don't even have a delete button.
Title: Re: [TOOL] movepixel
Post by: Resetti's Replicas on June 11, 2011, 11:37:37 AM
Just discovering this thread, I ought to peruse this section more often.

To be clear, is this all ready to go, or still in development (This page and the one before make it unclear)?  Either way, I tip my illuminating hard hat to you, this will save me a ton of aggro when trying to rotate the extenders.
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 11, 2011, 12:18:24 PM
It's not completely done yet, but the features stated one the first post are all working and implemented. Installation instructions are on the first post as well.

All right, in a few days I will bring out the new version with:

F8 - Alternative for Pause Break since some computers/keyboards lack it
SHIFT+CONTROL+Delete - Rotate 90 degrees to the left
SHIFT+CONTROL+Page Down - Rotate 90 degrees to the right

And most likely Sage will bring out an alternative version with different keys that I will add to the main page also.
Title: Re: [TOOL] movepixel
Post by: nightcracker on June 12, 2011, 03:54:43 PM
Features added, first post updated.

Sage, are you going to bring out an alternative keybind version again?
Title: Re: [TOOL] movepixel
Post by: Sage on June 12, 2011, 07:20:11 PM
Don't have time today, sorry NC. I'm going out of town the next two weeks. Fortunately, I'm one of the only people who actually needs the alternative keybind :D
Title: Re: [TOOL] movepixel
Post by: TriTon on July 04, 2011, 02:01:26 AM
Sorry for bump. But I keep getting this every time I try to use it.

Code: [Select]
Error: Failed attempt to launch program or document:
Action: <mouse.exe>
Params: <click>

The current thread will exit.

Specifically: The system cannot find the file specified


              Line#
              001: Return
              001: Run,mouse.exe click
              001: Return
              003: Pause
              003: Return
              005: Run,mouse.exe move 0 - 1
              005: Return
              006: Run,mouse.exe move 0 1
              006: Return

This happens every time I try to use any of the commands. Each command has a slight different result in the error. What I mean by that is the numbers shown in the code above will be different from each command. This was from the command "ENTER".
Title: Re: [TOOL] movepixel
Post by: nightcracker on July 05, 2011, 03:23:03 AM
Make sure when extracting that you extract the .ahk file and .exe file in the same folder.
Title: Re: [TOOL] movepixel
Post by: NFX on July 05, 2011, 05:22:59 AM
Just a quick question about the keyboard controls. Home and End move the cursor up and down one pixel respectively, but my keyboard uses Fn+F9 and Fn+F10 as Home and End. I'm just wondering if that would still work with the program. =]
Title: Re: [TOOL] movepixel
Post by: TriTon on July 05, 2011, 04:45:53 PM
Make sure when extracting that you extract the .ahk file and .exe file in the same folder.

I did, both of them were in the same folder. When I first tried running it, my anti-virus program said it contained a virus.
Title: Re: [TOOL] movepixel
Post by: Resetti's Replicas on July 09, 2011, 10:08:05 PM
There's a file in the zip called "Mouse.exe."  Where do I want to put that?
Title: Re: [TOOL] movepixel
Post by: nightcracker on July 11, 2011, 02:28:28 PM
In the same folder as the .ahk file.
Title: Re: [TOOL] movepixel
Post by: NFX on July 11, 2011, 02:44:01 PM
Just a quick question about the keyboard controls. Home and End move the cursor up and down one pixel respectively, but my keyboard uses Fn+F9 and Fn+F10 as Home and End. I'm just wondering if that would still work with the program. =]
Not sure if anyone picked up on this the first time. Just making sure.
Title: Re: [TOOL] movepixel
Post by: nightcracker on July 11, 2011, 04:29:00 PM
Just a quick question about the keyboard controls. Home and End move the cursor up and down one pixel respectively, but my keyboard uses Fn+F9 and Fn+F10 as Home and End. I'm just wondering if that would still work with the program. =]
Not sure if anyone picked up on this the first time. Just making sure.

Have you tried it?
Title: Re: [TOOL] movepixel
Post by: Scorpion on July 11, 2011, 04:54:20 PM
The only keys that work for me are the 2 "rotate component by one click" keys.
Have I done something wrong, or would I need the alternate keybindings Sage was talking about?
Title: Re: [TOOL] movepixel
Post by: nightcracker on July 13, 2011, 11:36:12 AM
Yes you do, I'm still working on a better version, but I really don't have the time atm :(
Title: Re: [TOOL] movepixel
Post by: Fracture on July 14, 2011, 03:37:23 PM
This has helped me a LOT and I realized I've never thanked you, so thanks. This is awesome.

Maybe the next step is to assign a holdable Alt+Enter to a button near Alt like Z? That would really help with chassis design, where you have to hold down the left mouse button and drag the gridpoints/slider.
Title: Re: [TOOL] movepixel
Post by: Scorpion on July 14, 2011, 04:14:31 PM
Yes you do, I'm still working on a better version, but I really don't have the time atm :(
Ok then, thanks
Title: Re: [TOOL] movepixel
Post by: Skiitzzox220 on July 14, 2011, 04:25:49 PM
EDIT: Nevermind
Title: Re: [TOOL] movepixel
Post by: The Zephyr on August 15, 2011, 01:18:15 PM
(Slight bump...)

Ugh, I need help... I installed this and put the .exe and .ahk files in the same folder. Then I ran the .exe, went into RA2 and tried the controls... Nothing happened. Page Down and Page Up just zoomed in and out and didn't move the black that I was trying to stack. Any help?
Title: Re: [TOOL] movepixel
Post by: NFX on August 15, 2011, 01:26:48 PM
Have you downloaded AutoHotKey as well? There's a link in the first post if you don't have it.
Title: Re: [TOOL] movepixel
Post by: The Zephyr on August 15, 2011, 01:40:59 PM
Yup, I have that.
Title: Re: [TOOL] movepixel
Post by: nightcracker on August 15, 2011, 01:46:02 PM
All right guys, I noticed at a friends house that AutoHotkey doesn't work every RA2 installation. I can confirm it works with the one downloadable from here: https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=4. (https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=4.) Please try that.
Title: Re: [TOOL] movepixel
Post by: RpJk on August 15, 2011, 02:33:06 PM
What does AutoHotKey do exactly?
Title: Re: [TOOL] movepixel
Post by: Serge on August 15, 2011, 03:18:42 PM
What does AutoHotKey do exactly?
A simple scripting environment with the added bonus of being able to bind global hotkeys to predefined actions.

I'd write a kernel module to intercept keyboard input (inb4 there are user32 calls to do this), but AHK works fine, too. :D
Title: Re: [TOOL] movepixel
Post by: nightcracker on August 15, 2011, 04:24:28 PM
Serge, that's what my C version is doing but I CBA to write a config gui for it so it's not released ;)
Title: Re: [TOOL] movepixel
Post by: Mecha on March 23, 2014, 03:58:59 PM
BUMP

The first page download is broken. are there any other working links?
Title: Re: [TOOL] movepixel
Post by: Naryar on March 23, 2014, 04:19:30 PM
yeah, i would be interested
Title: Re: [TOOL] movepixel
Post by: Mr. AS on March 23, 2014, 04:38:36 PM
http://www.solidfiles.com/d/a384a6d301/movepixel_beta.rar (http://www.solidfiles.com/d/a384a6d301/movepixel_beta.rar)

I also included an edited version that uses the WASD keys instead of the defaults for laptops like mine that don't have the default END/DEL/PGDOWN/HOME setup.

e: Also there's this one sage made.
https://gametechmods.com/uploads/files/movepixelSAGEMOD.zip (https://gametechmods.com/uploads/files/movepixelSAGEMOD.zip)
For all of those who don't have any of the keys that NC is using (like, say, on an old macbook pro) i modded the file to use UHJK instead (which should be on everyones keyboard). Heres the commands:

ALT+Enter - click mouse button
SHIFT+H - rotate counter-clockwise
SHIFT+K - rotate clockwise
CTRL+U - move component up
CTRL+J - move component down
ALT+U - move cursor one pixel up
ALT+J - move cursor one pixel down
ALT+H - move cursor one pixel left
ALT+K - move cursor one pixel right
Title: Re: [TOOL] movepixel
Post by: Naryar on May 27, 2016, 06:41:08 AM
bump

the script is working within Windows for me but not for my version of RA2. I'll try replacing my ra2.exe with the one in Sage's installer, or is the problem located somewhere else than in the .exe ?
Title: Re: [TOOL] movepixel
Post by: Badger on May 27, 2016, 07:04:38 AM
bump

the script is working within Windows for me but not for my version of RA2. I'll try replacing my ra2.exe with the one in Sage's installer, or is the problem located somewhere else than in the .exe ?
It's an autohotkey script, it should work regardless of whatever else you have running, be that RA2, RA3, CSGO or nothing at all. Maybe try changing the hotkeys?
Title: Re: [TOOL] movepixel
Post by: Naryar on May 27, 2016, 07:31:25 AM
bump

the script is working within Windows for me but not for my version of RA2. I'll try replacing my ra2.exe with the one in Sage's installer, or is the problem located somewhere else than in the .exe ?
It's an autohotkey script, it should work regardless of whatever else you have running, be that RA2, RA3, CSGO or nothing at all. Maybe try changing the hotkeys?
i dont think you understood my question. the autohotkey script works in windows but whenever i do it in RA2 it does not move the mouse at all.

edit : it does not work with the .exe from sage's download that i have extracted into my old directory. let's see if it works with the fresh Sage download as well, and if it works within the confines of a full install instead of an .exe.

edit 2 : well, it DOES indeed work in that install. Time to refresh the files of my NAR AI folder, then.
Title: Re: [TOOL] movepixel
Post by: R01 on July 26, 2016, 05:49:24 PM
I know, bump, but I was having the same issue as Naryar, on all kinds of RA2 versions, using the normal and a custom version I made.
At first I thought the .exe was outdated(in the credits it still says the .exe is version 1.2), ran the patcher and found out that the 1.3 patch doesn't add a new .exe.

After seeing the issue in Ironforge I quickly thought that it had to do with the compatibility settings and removed them all. That worked and further testing showed that the "run as administrator" flag caused the issue(guess the program is run under the admin user account which autohotkey can't send keys to/since it's started by a normal user it's not running on the admin.)

Just thought I'd add this for people having the same issue, hope this isn't a negative bump.
Title: Re: [TOOL] movepixel
Post by: UberPyro on September 25, 2016, 11:13:36 AM
For some reason the movepixel thing never works on the computer I use now. It always gives me the same error "failed attempt to launch program or document," which is referring to the mouse.exe used in the ahk script. I think I might be missing something that lets the mouse.exe work, I'm not sure.

I'm on Windows 10, although that probably isn't all too important.

Anyway, I've tried using fresh copies of the "Sage Mod" thing, doesn't work. Although when I did use the program, I edited the controls to the arrow keys: http://pastebin.com/ca1FHUuQ
Also I can't get the link that Mr. AS gave to work at all.

When I extract the Sage Mod folder, I see nothing but the ahk script which makes me feel like I'm missing something.

I do have a button on my mouse which lowers sensitivity which makes it easier to built on some level, but its still hard and time consuming compared to using movepixel. And with the GTM Championship tournament coming up I really want to get it working.

Can anyone help? Edit: I've figured out I'm clearly missing the .exe, can someone make a download link?

Edit 2: After looking around, I found out it was uploaded to the site in March and it has everything. Welp I should have looked harder beforehand.