Roblox Studio Macros

Hello developers,

Today I’d like to talk about macro keys. So I’ve come across a numkey pad and I decided to try and get into using macros for studio. Partially to save time over the long term but also just because I enjoy tinkering. I’d like to hook up 2 buttons to switch the Roblox Move increments between 0 and 0.2. The only problem is I have no idea what I’m doing.

How would one write a script in Python or Java or whatever to change the Move Increment in Studio to a specific number? I’m looking forward to your responses!

2 Likes

I would recommend AutoHotkey, which to my knowledge can interact with things such as textboxes and buttons directly in Windows applications.

4 Likes

Ah, that solves my first problem. Thank you very much! But now I need to figure out how to hook up the script to select the Scale Increment textbox in the active Studio window and change it to a set float. Do you know how that would be done?

2 Likes

I would first ensure that you’re on the correct tab (click on Model), then replace the text box’s contents. (Ctrl-A backspace 0.whatever?)

I can’t really tell you how to script for AHK specifically because I have never used it. Google would be good for this. First you need to learn the names of the buttons/textbox, then figure out how to trigger than using AHK. Both things there are probably tuts for on google.

2 Likes

I see. I’ve been perusing google for answers but it seems like there are some specific textbox names I need to acquire. Where would I go in my computer to find the names of these things that AHK would recognize?

And what does CTRL-A backspace do?

I’ll buy u a pizza for the help

1 Like

There’s an app for this somewhere (like some sort of inspector, that tells you the names)

With the window spy, you’ll be able to find the control’s Name/ID

Maybe this will help?

Also: Ctrl-A backspace is ‘select all and delete’. Just normal keyboard shortcuts.

1 Like

The trouble I’ve been having with Window Spy is that regardless of where my mouse is or where I click in a Studio window, the output for that window is always the same (ignoring Mouse Position).

https://gyazo.com/b1910bfc15d1566d52b7ee41c63cd661.mp4

You might have to use mouse position, to be honest.

Just record the mouse position that is the center of the Model button, then the center of the Move snap textbox… I think.

Try it out?

1 Like

Well, I did manage to get it working with the code below about an hour ago using mouse position (x & y being any random point inside the textbox). The only problem is I often switch my studio’s positioning/sizing around depending on if I’m streaming, if I need multiple studio windows open in the same view, etc. It would only work if I were able to somehow obtain the text box and edit it without just smacking the mouse onto a preset position. The image below depicts everything printed in Window Spy under “All Text”

MouseGetPos, StartX, StartY
MouseClick, left, x, y
Send, 0
MouseMove, StartX, StartY
return

1 Like

Yeah, I really really hate automating mouse movements like this. I know that clicking the button directly, and focusing the textbox directly would work, but I don’t think Studio uses Windows UI (it definitely uses Qt something).

You could have the hotkey send the mouse movements/clicks to the window you have focused. Then multiple windows wouldn’t matter.

Also I believe the mouse positions are relative to the top left of the window, not your entire screen.

1 Like

Ah, you’re right. These are definitely window-specific coordinates.

So I’m guessing AHK doesn’t like Qt? Is that something a different hotkey program/file type could delve into?

2 Likes

It’s not that AHK doesn’t like Qt. It’s just that Qt uses a different system. It doesn’t use traditional Windows widgets, AFAIK.

3 Likes

I’ve followed the steps to add a new “Lib” folder under C:\Program Files\AutoHotkey and save Acc.ahk, AccViewer.ahk, and Anchor.ahk, however when I try to run this code

MsgBox % Acc_Get(Acc)
return

Just gives me an empty MsgBox. Do you have any ideas about what could be the issue here?

2 Likes

This isn’t an AHK support forum I’m afraid, I don’t know how to solve your issue, and you might not get an answer until you try their forums.

I hope you find a way! :stuck_out_tongue:

3 Likes