Need help using a recorded macro

GPC2 script programming for Titan Two. Code examples, questions, requests.

Re: Need help using a recorded macro

Postby Mad » Mon Jul 15, 2019 4:28 am

Not sure exactly what you mean. Also the keyboard header comes with Gtuner in the include folder.

Gtuner>File>New>Empty GPC File

Then paste the last one Buffy posted for you, Click the icon in the toolbar that shows "Install active work to memory slot"

Then make sure the macro's you recorded are renamed to 0.gmk up to 9.gmk
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help using a recorded macro

Postby Airforce » Mon Jul 15, 2019 4:58 am

Forgive me, the faults mine as I get frustrated and I don't communicate clearly;
My setup as follows: Xim Apex-> Titan 2 -> PS4.

I have been a user of the anti-recoil utility by AlanMcGregor since being introduce to the Titan 2. During setup of his script, I opted for the use of the number pad to select what profile I wanted to run. (Purchased a cheap number pad and hooked it into Input-B as I'm using apex link).

So, during normal gameplay, all I had to do was hit the number on the number pad to change the anti-recoil profile. That number would also be displayed on the segment display of the Titan 2.

I'm essentially wanting to do the exact same thing except use my anti-recoil macros.
Please help me, My knowledge of C is very limited lol. So far, I got far enough to play 1 macro when Button_5 is activated. As for switching profiles- no such luck,.. much less the segment display.

"Num Key 1 = Slot 1
Num Key 2 = Slot 2
Num Key 3 = Slot 3
Num Key 4 = Slot 4
Num Key 5 = Slot 5"
User avatar
Airforce
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 10, 2019 5:46 pm

Re: Need help using a recorded macro

Postby Mad » Mon Jul 15, 2019 5:13 am

The num keys 0-9

You name the macro 0.gmk - press num 0
You name the next macro 1.gmk - press num 1

All the way up to 9.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help using a recorded macro

Postby Airforce » Mon Jul 15, 2019 5:56 am

Mad wrote:The num keys 0-9

You name the macro 0.gmk - press num 0
You name the next macro 1.gmk - press num 1

All the way up to 9.



Heeeey, I got it to work :) The macro wasn't activating because I wasn't holding down "XB1_LT" or right click for me. :smile0517:

Code: Select all
if(is_active(XB1_LT) && is_active(XB1_RT)) {



Wouldn't know how to add the segment display to correspond to the numberpad would ya?
User avatar
Airforce
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 10, 2019 5:46 pm

Re: Need help using a recorded macro

Postby Mad » Mon Jul 15, 2019 6:36 am

Download "DWrite" in the online resource section.

Code: Select all
#include <keyboard.gph>
#include <xb1.gph>
#include "DWrite.gph"
 
uint8 key_idx;
char* str = "n.gmk";
 
main {
    if(is_active(XB1_LT) && is_active(XB1_RT)) {
        if(sqrt(sq(get_actual(XB1_RX)) + sq(get_actual(XB1_RY))) < 30.0) {
            macro_run(str);
        }
    }
    else if(macro_time() > 0) macro_stop();
}
 
// macro selector
main {
    if(key_status((KEY_PAD1 + key_idx))) {
        *str = (key_idx == 9) ? '0' : '1' + key_idx;
        DWriteInt(key_idx);
    }
    key_idx = (key_idx+1)%10;
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help using a recorded macro

Postby Airforce » Mon Jul 15, 2019 7:15 am

Sooo close, it's displaying one number higher..

Example: When I hit 0, I'm getting 1.
When I hit 1, I'm getting 2. so on and so forth.
User avatar
Airforce
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 10, 2019 5:46 pm

Re: Need help using a recorded macro

Postby Buffy » Mon Jul 15, 2019 10:17 am

Airforce wrote:Nothing so far is working :(

I'm wondering though, "Include <keyboard.gph>" I have went to the online resources and downloaded/saved that file... I'm wondering since it shows red instead of gold if its an indicator that I'm doing something wrong?


The second script I posted will work as long as you set everything up correctly. Your macros should be named [ "0.gmk", "1.gmk", "2.gmk" ... "9.gmk" ] and dropped onto the microSD card.

Along with that. since you said your scripts are anti-recoil values, I made the second part of the script so the macros will only run when L2 and R2 are pressed, and you are not moving the physical analog stick itself.
ConsoleTuner Support Team || Discord || Custom Scripts
User avatar
Buffy
Lieutenant
Lieutenant
 
Posts: 422
Joined: Wed Jul 20, 2016 5:23 am

Re: Need help using a recorded macro

Postby Airforce » Mon Jul 15, 2019 8:10 pm

Buffy wrote:The second script I posted will work as long as you set everything up correctly. Your macros should be named [ "0.gmk", "1.gmk", "2.gmk" ... "9.gmk" ] and dropped onto the microSD card.

Along with that. since you said your scripts are anti-recoil values, I made the second part of the script so the macros will only run when L2 and R2 are pressed, and you are not moving the physical analog stick itself.



....................................................................................................................................................

Hey bud, I first wanted to say that I greatly appreciate your time and support. It means a lot (you too Mad). :smile0517: I've been working at these anti-recoil weapon macros for a long time, and it's nice to see a light at the end of this tunnel.
Using the Macro-editor T2 is one thing, but applying them is a whole another ballgame.

......................................................................................................................................................
That being said, I'm still in need of your talents. :smile1002:
Currently, when I hit -for instance- number 1 on the Numpad (connected directly to Titan 2). The segment display blinks once the number 0. (It's always 1 number less than the Key- Flashes once on the segment display and returns to the # corresponding with the memory slot).

1. When hitting number 2 on the numpad; "1" Flashes once on the segment display and then returns to the number of the
memory slot.
2. When hitting number 3 on the numpad; "2" Flashes on the segment display. Then returns..
3. When hitting number 4 on the numpad; "3" Flashes on the segment display.
4. When hitting number 0 on the numpad; "9" Flashes on the segment display. so on and so forth.

My request: When hitting a number on the Number pad (Example: key 1)- The segment display will display the correct number (1) **and hold that number. It's switching the profiles correctly, just displaying the wrong number.

Here is the full copy& Paste of what I have so far:
Code: Select all
#pragma METAINFO("Anti-Recoil for Apex Legends", 1, 2, "Logan")
//Apex Legends Anti-Recoil Macros
#include <keyboard.gph>
#include <xb1.gph>
#include <display.gph>
#include "DWrite.gph"
 
uint8 key_idx;
char* str = "n.gmk";
 
main {
    if(is_active(BUTTON_5)) {
        macro_run(str);
    }
    else macro_stop();
}
 
 
 
// macro selector
 
main {
    if(key_status((KEY_PAD1 + key_idx))) {
        *str = (key_idx == 9) ? '0' : '1' + key_idx;
        DWriteInt(key_idx);
    }
    key_idx = (key_idx+1)%10;
}
 
 
User avatar
Airforce
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Jul 10, 2019 5:46 pm

Previous

Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2 and 107 guests