Post: [RELEASE] Button Monitoring for local clients
03-30-2013, 03:59 AM #1
Choco
Respect my authoritah!!
(adsbygoogle = window.adsbygoogle || []).push({}); Hey everyone,

This is a little something I wrote up a while back, and since not a whole lot has been happening with this game I figured I'd release it. It only works for local clients, which means that it will only work for you any split screen players attached to you. This is for version 1.08; if future updates come out I will update it.

This is the function in C#, you can add it to your RTE program or whatever, but remember for this code to work, you must have the ps3tmapi_net.dll included as a reference in your program (read about it You must login or register to view this content.).

    private bool Key_Down(int client, int buttonIndex)
{
if(buttonIndex < 0) return false;
byte[] key = new byte[4];
PS3TMAPI.ProcessGetMemory(target, PS3TMAPI.UnitType.PPU, processID, 0xFFFFFFFF, (ulong)(0xEF37EC + (buttonIndex << 4) + (client * 0x112Cool Man (aka Tustin)), ref key);
Array.Reverse(key);
return BitConverter.ToInt32(key, 0) == 1;
}



Here's a little example of how it can be used:

    private void ExampleFunction()
{
if(Key_Down(0, 0x11))
{
MessageBox.Show("Host is pressing R3!");
}
else
{
MessageBox.Show("Host is not pressing R3!");
}
}



Here's a list of all the button indexes that can be used:

    0x01 - X
0x02 - Circle
0x03 - Square
0x04 - Triangle
0x05 - L1
0x06 - R1
0x0E - Start
0x0F - Select
0x10 - L3
0x11 - R3
0x12 - L2
0x13 - R2
0x14 - Dpad Up
0x15 - Dpad Down
0x16 - Dpad Left
0x17 - Dpad Right



Credits: Treyarch for their Key_Down function :p


Have fun guys, hopefully this will lead to some new stuff.
Last edited by Choco ; 04-01-2013 at 04:56 PM.

The following 21 users say thank you to Choco for this useful post:

Anera, BadChoicesZ, BuC-ShoTz, Capo837, Chxii, FM|T Enstone, FM|T xDevOpS, GaMeRGiRL_2310, Guzman, Iventory || RGFR, KCxFTW, Mango_Knife, riggstq, Master Ro, ICS Vortex, SC58, Slice, Taylor, TheJaRniBoi, Zack.
03-30-2013, 03:02 PM #11
SC58
Former Staff
Originally posted by Choco View Post
Hey everyone,

This is a little something I wrote up a while back, and since not a whole lot has been happening with this game I figured I'd release it. It only works for local clients, which means that it will only work for you any split screen players attached to you. This is for version 1.08; if future updates come out I will update it.

This is the function in C#, you can add it to your RTE program or whatever, but remember for this code to work, you must have the ps3tmapi_net.dll included as a reference in your program (read about it You must login or register to view this content.).

    private bool Key_Down(int client, int buttonIndex)
{
if(buttonIndex < 0 || !inGame()) return false;
byte[] key = new byte[4];
PS3TMAPI.ProcessGetMemory(target, PS3TMAPI.UnitType.PPU, processID, 0xFFFFFFFF, (ulong)(0xEF37EC + (buttonIndex << 4) + (client * 0x112Cool Man (aka Tustin)), ref key);
Array.Reverse(key);
return BitConverter.ToInt32(key, 0) == 1;
}

private bool inGame()
{
byte[] isInGame = new byte[4];
PS3TMAPI.ProcessGetMemory(target, PS3TMAPI.UnitType.PPU, processID, 0xFFFFFFFF, 0x1CB45E8, ref isInGame);
return BitConverter.ToInt32(isInGame, 0) == 1;
}



Here's a little example of how it can be used:

    private void ExampleFunction()
{
if(Key_Down(0, 0x11))
{
MessageBox.Show("Host is pressing R3!");
}
else
{
MessageBox.Show("Host is not pressing R3!");
}
}



Here's a list of all the button indexes that can be used:

    0x01 - X
0x02 - Circle
0x03 - Square
0x04 - Triangle
0x05 - L1
0x06 - R1
0x0E - Start
0x0F - Select
0x10 - L3
0x11 - R3
0x12 - L2
0x13 - R2
0x14 - Dpad Up
0x15 - Dpad Down
0x16 - Dpad Left
0x17 - Dpad Right



Credits: Treyarch for their Key_Down function :p


Have fun guys, hopefully this will lead to some new stuff.


Thanks buddyHappy
03-30-2013, 06:25 PM #12
CyberNomadic
Web Developer
Originally posted by Choco View Post
Hey everyone,

This is a little something I wrote up a while back, and since not a whole lot has been happening with this game I figured I'd release it. It only works for local clients, which means that it will only work for you any split screen players attached to you. This is for version 1.08; if future updates come out I will update it.

This is the function in C#, you can add it to your RTE program or whatever, but remember for this code to work, you must have the ps3tmapi_net.dll included as a reference in your program (read about it You must login or register to view this content.).

    private bool Key_Down(int client, int buttonIndex)
{
if(buttonIndex < 0 || !inGame()) return false;
byte[] key = new byte[4];
PS3TMAPI.ProcessGetMemory(target, PS3TMAPI.UnitType.PPU, processID, 0xFFFFFFFF, (ulong)(0xEF37EC + (buttonIndex << 4) + (client * 0x112Cool Man (aka Tustin)), ref key);
Array.Reverse(key);
return BitConverter.ToInt32(key, 0) == 1;
}

private bool inGame()
{
byte[] isInGame = new byte[4];
PS3TMAPI.ProcessGetMemory(target, PS3TMAPI.UnitType.PPU, processID, 0xFFFFFFFF, 0x1CB45E8, ref isInGame);
return BitConverter.ToInt32(isInGame, 0) == 1;
}



Here's a little example of how it can be used:

    private void ExampleFunction()
{
if(Key_Down(0, 0x11))
{
MessageBox.Show("Host is pressing R3!");
}
else
{
MessageBox.Show("Host is not pressing R3!");
}
}



Here's a list of all the button indexes that can be used:

    0x01 - X
0x02 - Circle
0x03 - Square
0x04 - Triangle
0x05 - L1
0x06 - R1
0x0E - Start
0x0F - Select
0x10 - L3
0x11 - R3
0x12 - L2
0x13 - R2
0x14 - Dpad Up
0x15 - Dpad Down
0x16 - Dpad Left
0x17 - Dpad Right

So thats how you did it. Only a few people would know what I am talking about :p


Credits: Treyarch for their Key_Down function :p


Have fun guys, hopefully this will lead to some new stuff.


So thats how you did it. Only a few people would know what I am talking about :p
03-30-2013, 08:02 PM #13
Ass Burgers
Are you high?
Great release Choco. Hope to see this go into good use sometime soon.
03-30-2013, 09:36 PM #14
SC58
Former Staff
Originally posted by NomadsBoy View Post
So thats how you did it. Only a few people would know what I am talking about :p


the all client button binds for mw3 :P
03-31-2013, 01:08 AM #15
Tustin
Balls of Steel
Originally posted by SC58 View Post
the all client button binds for mw3 :P

There's something else... Winky Winky
04-07-2013, 08:50 PM #16
Nice Release good job , the button is the same for mw3 ?? or not .. Smile
04-07-2013, 09:01 PM #17
iOdysseus
Bounty hunter
If your making stealth binds or anything else, make it check inside of a loop.

Originally posted by another user
.while binds == true
;Check for binds here
.endw


Originally posted by another user

bool binds = false;
while ( binds == true)
{
//Check for binds here
}
Last edited by iOdysseus ; 04-07-2013 at 09:04 PM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo