Author Topic: [TOOL] movepixel  (Read 18690 times)

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
[TOOL] movepixel
« 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.

Requirements:
Autohotkey - Direct download

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));
}
« Last Edit: June 12, 2011, 03:53:52 PM by nightcracker »

Offline SKBT

Re: [TOOL] movepixel
« Reply #1 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!

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #2 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!

Offline Pwnator

  • *
  • Posts: 6676
  • Rep: 15
  • Awards BOTM Winner
    • View Profile
    • http://pwnator.tumblr.com
    • Awards
  • See profile for gamer tags: Yes
Re: [TOOL] movepixel
« Reply #3 on: May 29, 2011, 09:48:00 PM »
YOU ARE AWESOME, BRO.
Clash Cubes 1 - Grey Matter (Runner-Up)
King of Karnage - Sideshow Freak (Runner-Up, Best Engineered)
Rust In Pieces - Paper Cut 3 (Grand Champion, Most Dangerous Bot)
Wheely Tag Tournament - Ion Thruster (Grand Champion, along with Ounces' DiSemboweLment)
UK vs USA - Dark Striker (Grand Champion)
Rust In Pieces 2 - Claymore (Runner-Up, Favourite Bot)
BBEANS 6 - Infection 4 (Runner-Up)
RA2 Team Championships - Serious Business, Skeksis (Runner-Up, along with Scrappy, S_M, and Badnik)
RA2 Team Championships 2 - The Other Stig (Runner-Up, along with Scrappy, S_M, Badnik, 090901, and R1885)
Replica Wars 3 - Abaddon (Runner-Up, Luckiest Bot)
BroBots - wheebot & yaybot (Runner-Up)
Robo Zone 2 - Dipper (4th place, Survival Champion, & Best Axle Bot)
ARBBC - The Covenant (3rd place, BW Rumble Winner, Most Feared BW)

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #4 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 :)

Offline Fracture

  • Super Mega Hyper Giga
  • Ultra Heavyweight
  • Posts: 1506
  • Rep: 11
  • how about i shove my big dog up your hanky panky
  • Awards GTMCS2 Divison Winner BOTM Winner
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #5 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

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #6 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?

Offline Sage

  • *
  • Posts: 6182
  • Rep: 11
  • RA2 Wizard & GTM's Favorite Stock Builder 2015
  • Awards Sage's Favorite BOTM Winner
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #7 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!
You got my vote for RA2 Wizard. Always and forever.

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #8 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.

Offline kill343gs

Re: [TOOL] movepixel
« Reply #9 on: May 29, 2011, 10:53:09 PM »
I support this tenfold. Good work.


For once the mods did something right
#MakeGTMGreatAgain

Offline JoeBlo

Re: [TOOL] movepixel
« Reply #10 on: May 30, 2011, 04:44:05 AM »
Well... That was the single greatest first post on this forum..

Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7587
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #11 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:
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #12 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).

Offline cephalopod

Re: [TOOL] movepixel
« Reply #13 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!
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline Avalanche

  • Retired.
  • Ultra Heavyweight
  • Posts: 3109
  • Rep: -34
  • Yeah, I don't know why I'm still here either.
    • View Profile
    • Awards
  • Discord: ThePootisPower#8377
Re: [TOOL] movepixel
« Reply #14 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
Former DSL HW champion.
Runner-Up in The Cybernetic Colosseum HW division.
Semi-finalist in RNP: Sword of Glory.
Robogames 1 BW Runner-up.
Professional cunt.
Man of a thousand alt accounts.

Offline freeziez

  • Ultra Heavyweight
  • Posts: 4720
  • Rep: 2
  • He's Mr. White Christmas, he's Mr. Snow...
    • youtube.com/freeziezGTM
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
Re: [TOOL] movepixel
« Reply #15 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?
obligatory battlebots 5 comment

GTM Awards 2011

Best Tournament: B4ttlebots (freeziez)
Best New Tournament Host: freeziez
Most Suprising Tournament: B4ttlebots (freeziez)

Offline Sage

  • *
  • Posts: 6182
  • Rep: 11
  • RA2 Wizard & GTM's Favorite Stock Builder 2015
  • Awards Sage's Favorite BOTM Winner
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #16 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.
You got my vote for RA2 Wizard. Always and forever.

Offline Squirrel_Monkey

  • Squirrel_Monkeyweight
  • *
  • Posts: 7587
  • Rep: 7
  • [Insert clever and witty comment here]
    • 0SquirrelMonkey0
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #17 on: May 30, 2011, 11:19:35 AM »
Put the .dll where the movepixel.exe and movepixel.ahk are extracted.
Better than GK since 2009.
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything

Offline nightcracker

  • *
  • Posts: 505
  • Rep: 7
  • Script kiddo
    • View Profile
    • NC Labs
    • Awards
  • Skype: orsonpeters
Re: [TOOL] movepixel
« Reply #18 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.

Offline Sage

  • *
  • Posts: 6182
  • Rep: 11
  • RA2 Wizard & GTM's Favorite Stock Builder 2015
  • Awards Sage's Favorite BOTM Winner
    • View Profile
    • Awards
Re: [TOOL] movepixel
« Reply #19 on: May 30, 2011, 11:40:59 AM »
Works great now, thanks.
You got my vote for RA2 Wizard. Always and forever.