Hey guys recently I started making all of my stuff in C++ because of the release of the method for .sprx modding. So here is a button monitoring script I have made... Hope this helps you with your menus/binds! :)
ReadInt function:
Button Monitoring:
How to use:
Credits
Me - Making script
seb5594 - Button monitoring offset
ReadInt function:
Code:
int intArray[100];
int* ReadInt(int address, int length)
{
for (int i = 0; i < length; i++)
{
intArray[i] = *(int*)(address + (i * 0x04));
}
return intArray;
}
Button Monitoring:
Code:
namespace Buttons
{
int
X = 262144,
Square = 805306368,
L1 = 526336,
L2 = 8388608,
L3 = 35651584,
R1 = 16777216,
R2 = 4194304,
R3 = 67108868;
};
bool ButtonPressed(int Client, int Button)
{
if (*(int*)Mem::ReadInt(0xF47CB0 + (Client * 0x3700), 1) == Button)
return true;
else return false;
}
How to use:
Code:
//Run in a thread
void Test()
{
for (;;)
{
if (ButtonPressed(0, Buttons::X)
iPrintln(0, "Client 0 Pressed X!");
else if (ButtonPressed(1, Buttons::R1)
iPrintln(1, "Client 1 Pressed R1!");
}
}
Me - Making script
seb5594 - Button monitoring offset