Page 1 of 1

Using Python by gimx

Posted: Thu Aug 03, 2023 6:57 am
by Abra23
Who can explain for me how to use python by gimx for modify Xbox one controller .

What I should to do ?!

Re: Using Python by gimx

Posted: Thu Aug 03, 2023 7:48 am
by GoDlike

Re: Using Python by gimx

Posted: Thu Aug 03, 2023 7:59 am
by Abra23
Can you tell me example how to do it.

where I should type the code

Re: Using Python by gimx

Posted: Thu Aug 03, 2023 9:42 pm
by Abra23
How to use this code on gimx by python ?
I downloaded python but idk how to work on it :evil: :lol:
[*]import socket
from enum import IntEnum
from time import sleep
import struct
import sys

DEFAULT_IP = "127.0.0.1"
DEFAULT_PORT = 51914


class XboxOneControls(IntEnum):
# ... (other controls)

RS = 143


class ButtonState(IntEnum):
RELEASED = 0
PRESSED = 255


def send_message(ip, port, changes):
# ... (same as before)


def check_status(ip, port):
# ... (same as before)


def main():
# ... (same as before)

holding_rs = False
left_stick_x = 0
left_stick_y = 0

while True:
# Check for the RS button press
if not holding_rs and XboxOneControls.RS in changes:
holding_rs = True
send_message(ip, port, {XboxOneControls.RS: ButtonState.PRESSED})
print("RS button is being held.")
elif holding_rs and XboxOneControls.RS in changes:
holding_rs = False
send_message(ip, port, {XboxOneControls.RS: ButtonState.RELEASED})
print("RS button is released.")

# Check for left stick x and y thresholds
if XboxOneControls.LEFT_STICK_X in changes:
left_stick_x = changes[XboxOneControls.LEFT_STICK_X]
if left_stick_x >= 60:
changes[XboxOneControls.LEFT_STICK_X] = 100

if XboxOneControls.LEFT_STICK_Y in changes:
left_stick_y = changes[XboxOneControls.LEFT_STICK_Y]
if left_stick_y >= 40:
changes[XboxOneControls.LEFT_STICK_Y] = 100

# Send the modified changes to GIMX
send_message(ip, port, changes)
sleep(0.05)


if __name__ == "__main__":
main()

Re: Using Python by gimx

Posted: Sat Aug 05, 2023 8:55 am
by GoDlike
If you don't have programming knowledge you won't be able to use it.

Re: Using Python by gimx

Posted: Sat Aug 05, 2023 10:46 am
by Abra23
GoDlike wrote: Sat Aug 05, 2023 8:55 am If you don't have programming knowledge you won't be able to use it.
I'm evolving :mrgreen:

you can see what i came up with :roll:
gimx respond my python code but nothing happened on xbox console, am trying to find solution :evil:

Image